diff --git a/config/speakers.json b/config/speakers.json index 2012d7e0..ce02e884 100644 --- a/config/speakers.json +++ b/config/speakers.json @@ -1,4 +1,9 @@ [ + { + "location": "", + "city": "All", + "lists": [] + }, { "location": "Madrid, Spain", "city": "Madrid", diff --git a/pages/index.js b/pages/index.js index 47208089..4fa070fc 100644 --- a/pages/index.js +++ b/pages/index.js @@ -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 (
@@ -90,7 +91,7 @@ export default function Home() {
) : (
-
+
{speakers.map((speaker) => { return (