Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvie-Wxr committed Sep 12, 2023
1 parent 0d797d9 commit 59390de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions config/speakers.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"location": "",
"city": "All",
"lists": []
},
{
"location": "Madrid, Spain",
"city": "Madrid",
Expand Down
19 changes: 10 additions & 9 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ export default function Home() {
ReactGA.initialize('UA-109278936-3');
ReactGA.pageview(window.location.pathname + window.location.search);
}
speakers[0].lists = [];
speakers.map((speaker) => {
if (Array.isArray(speaker.lists) && Object.keys(speaker.lists).length > 0) {
speakers[0].lists.push(...speaker.lists);
}
});
useEffect(() => {
const newArr = []
speakers.map((speaker) => {
if (Array.isArray(speaker.lists) && Object.keys(speaker.lists).length > 0) {
newArr.push(...speaker.lists)
}
});
setSpeakersList(newArr)
},[])
setCity(speakers[0]);
setSpeakersList(speakers[0].lists);
},[]);
return (
<div>
<Head>
Expand Down Expand Up @@ -90,7 +91,7 @@ export default function Home() {
</div>
) : (
<div className='flex justify-center'>
<div className='w-[720px] lg:w-full flex justify-between'>
<div className='lg:w-full flex justify-between'>
{speakers.map((speaker) => {
return (
<div
Expand Down

0 comments on commit 59390de

Please sign in to comment.