Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add all speakers button #192

Merged
merged 4 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading