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: community events page #1120

Merged
merged 89 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
e3c6b33
add event page to community section
AceTheCreator Nov 18, 2022
9fa5d97
added event filter functionality
AceTheCreator Nov 18, 2022
edce858
adding events path to layout
AceTheCreator Nov 18, 2022
f2f7f0e
Added events to page
AceTheCreator Nov 18, 2022
6a98ffb
integrated events with google cal
AceTheCreator Dec 13, 2022
08f39da
completely rendering event lists
AceTheCreator Dec 13, 2022
b61a991
extended event post item functionality
AceTheCreator Dec 14, 2022
b44ae02
added suggested changes
AceTheCreator Dec 14, 2022
276c9c8
.
AceTheCreator Dec 14, 2022
00a44ee
testing get static props
AceTheCreator Dec 14, 2022
f9f843b
fixing build issue
AceTheCreator Dec 14, 2022
6b86998
extended build-meeting script
AceTheCreator Dec 14, 2022
6563dc9
completed meeting script extension
AceTheCreator Dec 14, 2022
2489840
feat: community landing page (#1119)
AceTheCreator Dec 7, 2022
7cbe104
fix: producer page wrong link (#1081)
Amishakumari544 Nov 7, 2022
fe56faf
chore: update meetings.json and newsrooom_videos.json (#1085)
asyncapi-bot Nov 8, 2022
083dcff
chore(deps): bump loader-utils from 1.4.0 to 1.4.1 (#1086)
dependabot[bot] Nov 8, 2022
a31990c
fix: homepage link to studio not matching asyncapi version (#1077)
gabel Nov 8, 2022
b0ce6b3
docs: update the Bump.sh brand (#1074)
ChristopheDujarric Nov 9, 2022
5f20be5
fix: enable ids in list of features from landing page (#1087)
derberg Nov 9, 2022
76c263d
docs(spec): v3.0.0-next-major-spec.5 release (#1092)
asyncapi-bot Nov 9, 2022
9f60c3b
ci: update generic workflows (#1093)
asyncapi-bot Nov 9, 2022
1b4e165
docs: add message concepts doc (#944)
thulieblack Nov 9, 2022
7934ac9
chore: update meetings.json and newsrooom_videos.json (#1098)
asyncapi-bot Nov 10, 2022
99805c6
chore: update meetings.json and newsrooom_videos.json (#1101)
asyncapi-bot Nov 11, 2022
90192c1
chore: update meetings.json and newsrooom_videos.json (#1103)
asyncapi-bot Nov 12, 2022
92badf8
docs: update the buttons for the channel page doc (#1100)
thulieblack Nov 12, 2022
7ee1809
docs: update index.md tutorial-overview buttons (#1102)
thulieblack Nov 12, 2022
27d4c05
chore: update meetings.json and newsrooom_videos.json (#1104)
asyncapi-bot Nov 13, 2022
e568722
chore: update meetings.json and newsrooom_videos.json (#1107)
asyncapi-bot Nov 14, 2022
45fe250
chore: update meetings.json and newsrooom_videos.json (#1109)
asyncapi-bot Nov 15, 2022
9d391eb
docs: fix the bug in button display section (#1106)
Annysah Nov 15, 2022
a83996c
chore: update meetings.json and newsrooom_videos.json (#1110)
asyncapi-bot Nov 16, 2022
1391ed8
chore(deps): bump loader-utils from 1.4.1 to 1.4.2 (#1111)
dependabot[bot] Nov 16, 2022
316f75c
fix: dashboard improvement (#1108)
KhudaDad414 Nov 17, 2022
94c6bbc
chore: update meetings.json and newsrooom_videos.json (#1115)
asyncapi-bot Nov 18, 2022
e51023f
chore: update meetings.json and newsrooom_videos.json (#1116)
asyncapi-bot Nov 19, 2022
3743512
chore: update meetings.json and newsrooom_videos.json (#1117)
asyncapi-bot Nov 21, 2022
ee3be57
chore: update meetings.json and newsrooom_videos.json (#1124)
asyncapi-bot Nov 22, 2022
fbcc42e
ci: update generic workflows (#1125)
asyncapi-bot Nov 23, 2022
42cfdf5
chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#1126)
dependabot[bot] Nov 23, 2022
30d8c16
chore: update meetings.json and newsrooom_videos.json (#1127)
asyncapi-bot Nov 24, 2022
5cc6639
chore: update meetings.json and newsrooom_videos.json (#1129)
asyncapi-bot Nov 25, 2022
152146f
docs: fix invalid links in markdown files (#756)
KhudaDad414 Nov 26, 2022
df8bd71
chore: update meetings.json and newsrooom_videos.json (#1130)
asyncapi-bot Nov 27, 2022
47a32cf
chore: update meetings.json and newsrooom_videos.json (#1133)
asyncapi-bot Nov 30, 2022
e52b791
ci: improve logging for tools build script (#1128)
derberg Nov 30, 2022
3bef86e
feat: support yaml as format for `.asyncapi-tools` (#1135)
derberg Dec 1, 2022
e3c7aa1
chore: update meetings.json and newsrooom_videos.json (#1136)
asyncapi-bot Dec 2, 2022
4777d6b
chore: update meetings.json and newsrooom_videos.json (#1140)
asyncapi-bot Dec 3, 2022
43574cc
docs: add protocol concepts doc (#1013)
nelsonmic Dec 6, 2022
8c119f7
docs: new concept doc application (#992)
quetzalliwrites Dec 6, 2022
fafba57
ci: update generic workflows (#1142)
asyncapi-bot Dec 6, 2022
eaa5428
feat: added link to YT video to TSC page (#1141)
Anurag607 Dec 6, 2022
1d9017c
feat: added new md component (#1137)
AceTheCreator Dec 6, 2022
1e1266b
integrated events with google cal
AceTheCreator Dec 13, 2022
43f6580
extended build-meeting script
AceTheCreator Dec 14, 2022
94def97
completed meeting script extension
AceTheCreator Dec 14, 2022
6db478a
.
AceTheCreator Dec 14, 2022
98d20f9
.
AceTheCreator Dec 14, 2022
315b101
.
AceTheCreator Dec 14, 2022
0b59af8
updated meeting list
AceTheCreator Dec 14, 2022
a4f89b9
removed unused page
AceTheCreator Dec 14, 2022
b9c1c31
.
AceTheCreator Dec 14, 2022
30f14c1
Merge branch 'community' of https://github.com/AceTheCreator/website …
AceTheCreator Dec 20, 2022
d2d14d5
enhancing event page
AceTheCreator Dec 20, 2022
ff3e4a2
enhanced meeting card
AceTheCreator Dec 20, 2022
02a7174
made page responsive
AceTheCreator Dec 20, 2022
12046c2
enhanced event page
AceTheCreator Dec 20, 2022
7b05940
fixed merge conflict
AceTheCreator Dec 20, 2022
f5acf21
enhaced event page
AceTheCreator Dec 22, 2022
8b721a8
removed unused code
AceTheCreator Dec 22, 2022
b75948c
made meeting card description visible
AceTheCreator Jan 11, 2023
0ddd4fc
updated host name
AceTheCreator Jan 11, 2023
fdd0445
Merge branch 'community' of https://github.com/AceTheCreator/website …
AceTheCreator Jan 11, 2023
c3ba1cc
fixed deployment error
AceTheCreator Jan 12, 2023
efa78b2
fixed typo
AceTheCreator Jan 12, 2023
2d78493
Merge branch 'community' of https://github.com/AceTheCreator/website …
AceTheCreator Jan 18, 2023
cb429f6
enhancements
AceTheCreator Jan 18, 2023
c199753
added missing link
AceTheCreator Jan 23, 2023
2bd67ea
updated image
AceTheCreator Jan 23, 2023
94e4b48
Merge branch 'community' of https://github.com/AceTheCreator/website …
AceTheCreator Jan 23, 2023
2f6ad50
removed unused console.log
AceTheCreator Jan 23, 2023
f223dbc
.
AceTheCreator Jan 23, 2023
392f5d0
fix broken logo url
AceTheCreator Jan 31, 2023
2bdb2d6
Update pages/community/events/index.js
AceTheCreator Feb 1, 2023
f632914
Update components/Meeting.js
AceTheCreator Feb 1, 2023
056fffb
.
AceTheCreator Feb 1, 2023
8d296ce
revert
AceTheCreator Feb 1, 2023
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
55 changes: 36 additions & 19 deletions components/Meeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,50 @@ import YoutubeButton from './buttons/YoutubeButton';
import Paragraph from './typography/Paragraph';
import TextLink from './typography/TextLink';
import Heading from './typography/Heading';
import { ArrowRightIcon } from '@heroicons/react/outline';

export default function Meeting({
name = '',
purpose = '',
host = '',
hostProfile = '',
youtube = ''
youtube = '',
bg = ''
}) {

return (
<div className="rounded-md border border-gray-200 overflow-hidden bg-white p-4">
<Heading level="h2" typeStyle="heading-md-semibold">
{ name }
</Heading>
<Paragraph typeStyle="body-md" className="my-4">
<strong>Purpose:</strong> { purpose }
</Paragraph>
<Paragraph typeStyle="body-md" className="my-4">
<strong>Host:</strong>
{ hostProfile
? (<TextLink href={ hostProfile } target="_blank">
{ host }
</TextLink>)
: ` ${host}.`
}
</Paragraph>
<YoutubeButton text="Watch recordings" href={ youtube }/>
</div>
<a href={youtube} target="_blank" rel="noreferrer">
<div
className={`meeting-card overflow-hidden p-4 bg-${bg} w-full lg:w-[300px] h-[300px] cursor-pointer hover:bg-dark hover:text-white flex flex-col justify-between`}
>
<div>
<h3 className="text-xl">{name}</h3>
<div>
<Paragraph typeStyle="body-sm" className="my-4" textColor="white">
{purpose}
</Paragraph>
</div>
</div>
<div className="flex items-center justify-between">
<Paragraph typeStyle="body-md" className="my-4">
<strong>Host:</strong>
{hostProfile ? (
<TextLink
href={hostProfile}
target="_blank"
className="hover:text-primary-500"
>
{host}
</TextLink>
) : (
` ${host}.`
)}
</Paragraph>
<div>
<ArrowRightIcon className="w-[20px] ml-3 text-slate-400" />
</div>
</div>
</div>
</a>
);
}
9 changes: 9 additions & 0 deletions components/icons/Calendar copy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions components/icons/Community.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions components/icons/Conference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export default function Conference({ className }) {
return (
<svg className={className} width="20px" height="20px" viewBox="0 0 24 24">
<path
d="M7.5 4.20581L16.5 19.7943"
stroke="#C78017"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M19.7942 7.5L4.20573 16.5"
stroke="#C78017"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M14.3293 3.30664L9.6706 20.6933"
stroke="#C78017"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M20.6934 14.3293L3.30669 9.6706"
stroke="#C78017"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
66 changes: 66 additions & 0 deletions components/icons/Webinar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
export default function Webinar({ className }) {
return (
<svg className={className} width="20px" height="20px" viewBox="0 0 256 256">
<path
d="m40.59 49.24c-1.28 0-33.08 24.32-33.08 76 0 53.23 30.89 81.28 32.64 81.49s16.43-13.58 16.43-14.68-26.95-20.59-26.95-65.28 26.73-61.33 26.73-62.85c0-.92-12.26-14.68-15.77-14.68z"
fill="#47BCEE"
/>
<path
d="m40.29 214.77a9.09 9.09 0 0 1 -1.14-.07c-1.64-.2-4.12-.51-10.79-7.93a101.48 101.48 0 0 1 -12.11-16.87c-7.63-13.17-16.74-35.07-16.74-64.64 0-28.86 9.43-49.51 17.34-61.74a89.8 89.8 0 0 1 12.44-15.39c7-6.88 9.5-6.88 11.3-6.88 3.49 0 7.2 1.57 14.9 9.4 8.87 9 8.87 10.89 8.87 13.28 0 3.72-2.18 5.75-4.29 7.71-5.55 5.17-22.44 20.89-22.44 55.16 0 23.42 7.81 43 23.21 58.11 1.75 1.72 3.74 3.67 3.74 7.18 0 2.89 0 4.81-12.22 15.59-5.72 5.04-8.69 7.09-12.07 7.09zm.84-155.77c-7.46 7.05-25.62 28.17-25.62 66.26 0 39.53 17.7 63 25.27 71.28 1.54-1.33 3.28-2.92 4.85-4.4-15.92-17.6-24-39.56-24-65.35 0-25.52 8.06-46.81 24-63.36-1.48-1.54-3.1-3.16-4.5-4.43z"
fill="#47BCEE"
/>
<path
d="m74.77 78.6c-1.55 0-21.69 12.71-22.13 46.88-.45 35.05 19.72 52.36 21 52.58s14.24-13.36 14.24-14.46-15.48-11.84-14.68-35.49c.88-25.85 14.9-34.61 14.9-35.71s-11.36-13.8-13.33-13.8z"
fill="#47BCEE"
/>
<path
d="m73.73 186.06a8.38 8.38 0 0 1 -1.38-.12c-7.35-1.22-16.66-16.9-16.75-17.05-5.14-8.72-11.22-23.36-11-43.52.26-19.94 6.73-33.19 12.12-40.78 3.43-4.84 11.62-14 18-14 3.75 0 6.73 2 13.27 9 7.33 7.85 8.1 9.92 8.1 12.77 0 3.51-2.09 5.59-3.47 7-3 3-10.82 10.79-11.43 29a36.5 36.5 0 0 0 11.21 28.19c1.56 1.61 3.51 3.61 3.51 7s-1.46 5.38-6.84 11.14a116.63 116.63 0 0 1 -8.33 8.18c-1.34 1.19-3.74 3.19-7.01 3.19zm.68-97.53c-4.83 4.5-13.5 15.57-13.77 37-.28 21.97 8.26 35.61 13.36 41.79 1.12-1.12 2.3-2.35 3.38-3.5a51.81 51.81 0 0 1 -12.14-36c .64-18.82 7.56-30 12.45-35.83-1.06-1.16-2.22-2.39-3.28-3.46z"
fill="#47BCEE"
/>
<path
d="m215.41 49.24c1.28 0 33.08 24.32 33.08 76 0 53.23-30.89 81.28-32.64 81.49s-16.43-13.58-16.43-14.68 26.95-20.59 26.95-65.28-26.73-61.36-26.73-62.87c0-.9 12.26-14.66 15.77-14.66z"
fill="#47BCEE"
/>
<path
d="m215.7 214.77c-3.38 0-6.34-2-12.06-7.1-12.22-10.79-12.22-12.7-12.22-15.59 0-3.5 2-5.45 3.74-7.18 15.4-15.14 23.21-34.69 23.21-58.11 0-34.27-16.89-50-22.44-55.16-2.11-2-4.29-4-4.29-7.71 0-2.39 0-4.27 8.87-13.28 7.71-7.83 11.41-9.4 14.9-9.4 1.79 0 4.25 0 11.3 6.88a89.8 89.8 0 0 1 12.44 15.39c7.91 12.24 17.34 32.88 17.34 61.74 0 29.57-9.1 51.47-16.74 64.64a101.48 101.48 0 0 1 -12.11 16.86c-6.67 7.41-9.15 7.72-10.8 7.93a9 9 0 0 1 -1.14.09zm-5.33-22.62c1.56 1.48 3.31 3.07 4.85 4.4 7.57-8.23 25.27-31.75 25.27-71.28 0-38.09-18.16-59.21-25.62-66.26-1.4 1.27-3 2.89-4.48 4.43 15.91 16.55 24 37.84 24 63.36-.03 25.78-8.09 47.74-24.02 65.34z"
fill="#47BCEE"
/>
<path
d="m181.23 78.6c1.55 0 21.69 12.71 22.13 46.88.45 35.05-19.72 52.36-21 52.58s-14.24-13.36-14.24-14.46 15.48-11.84 14.68-35.49c-.88-25.85-14.9-34.61-14.9-35.71s11.36-13.8 13.33-13.8z"
fill="#47BCEE"
/>
<path
d="m182.27 186.06c-3.3 0-5.66-2-7-3.15a116.63 116.63 0 0 1 -8.33-8.18c-5.38-5.77-6.84-7.8-6.84-11.14s1.95-5.44 3.51-7a36.5 36.5 0 0 0 11.17-28.17c-.62-18.22-8.47-26.06-11.43-29-1.38-1.38-3.47-3.46-3.47-7 0-2.85.77-4.92 8.1-12.77 6.54-7 9.52-9 13.27-9 6.39 0 14.57 9.16 18 14 5.39 7.6 11.86 20.84 12.12 40.78.26 20.16-5.82 34.79-11 43.52-.09.16-9.41 15.83-16.75 17.05a8.38 8.38 0 0 1 -1.35.06zm-3.65-22.25c1.08 1.15 2.26 2.38 3.38 3.5 5.11-6.17 13.64-19.82 13.36-41.74-.27-21.48-8.94-32.54-13.77-37-1.06 1.07-2.22 2.3-3.28 3.47 4.9 5.87 11.81 17 12.45 35.83a51.81 51.81 0 0 1 -12.14 35.95z"
fill="#47BCEE"
/>
<path
d="m151.07 128.11c0 15.17-10.17 28.47-26.79 27.47-14.77-.89-26.79-12.3-26.79-27.47s10.76-27.07 26.79-27.47c15.83-.39 26.79 12.3 26.79 27.47z"
fill="#47BCEE"
/>
<path
d="m126.06 163.63q-1.12 0-2.27-.07c-19.56-1.18-34.31-16.42-34.31-35.45 0-20 14.55-35 34.59-35.47a33.24 33.24 0 0 1 24.35 9.36 36.5 36.5 0 0 1 10.65 26.09c0 10.56-4 20.4-11 27a31.37 31.37 0 0 1 -22.01 8.54zm-1.07-55h-.52c-11.18.28-19 8.29-19 19.47 0 10.44 8.29 18.82 19.27 19.48a15.85 15.85 0 0 0 12.33-4.15c3.8-3.58 6-9.17 6-15.34a20.43 20.43 0 0 0 -5.82-14.64 17.14 17.14 0 0 0 -12.25-4.82z"
fill="#47BCEE"
/>
<path
d="m40.59 49.24c-1.28 0-33.08 24.32-33.08 76 0 53.23 30.89 81.28 32.64 81.49s16.43-13.58 16.43-14.68-26.95-20.59-26.95-65.28 26.73-61.33 26.73-62.85c0-.92-12.26-14.68-15.77-14.68z"
fill="#47BCEE"
/>
<path
d="m74.77 78.6c-1.55 0-21.69 12.71-22.13 46.88-.45 35.05 19.72 52.36 21 52.58s14.24-13.36 14.24-14.46-15.48-11.84-14.68-35.49c.88-25.85 14.9-34.61 14.9-35.71s-11.36-13.8-13.33-13.8z"
fill="#47BCEE"
/>
<path
d="m215.41 49.24c1.28 0 33.08 24.32 33.08 76 0 53.23-30.89 81.28-32.64 81.49s-16.43-13.58-16.43-14.68 26.95-20.59 26.95-65.28-26.73-61.36-26.73-62.87c0-.9 12.26-14.66 15.77-14.66z"
fill="#47BCEE"
/>
<path
d="m181.23 78.6c1.55 0 21.69 12.71 22.13 46.88.45 35.05-19.72 52.36-21 52.58s-14.24-13.36-14.24-14.46 15.48-11.84 14.68-35.49c-.88-25.85-14.9-34.61-14.9-35.71s11.36-13.8 13.33-13.8z"
fill="#47BCEE"
/>
<path
d="m151.07 128.11c0 15.17-10.17 28.47-26.79 27.47-14.77-.89-26.79-12.3-26.79-27.47s10.76-27.07 26.79-27.47c15.83-.39 26.79 12.3 26.79 27.47z"
fill="#e83a2a"
/>
</svg>
);
}
41 changes: 22 additions & 19 deletions components/layout/GenericLayout.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
import Head from '../Head'
import NavBar from '../navigation/NavBar'
import Container from './Container'
import Footer from '../Footer'
import AnnouncementHero from '../campaigns/AnnoucementHero'
import StickyNavbar from '../navigation/StickyNavbar'
import Head from '../Head';
import NavBar from '../navigation/NavBar';
import Container from './Container';
import Footer from '../Footer';
import AnnouncementHero from '../campaigns/AnnoucementHero';
import StickyNavbar from '../navigation/StickyNavbar';

export default function GenericLayout({
title,
description,
image,
children,
wide = true
wide = true,
hideBanner = false,
}) {
if (!title || !description || !image) throw new Error('Props `title`, `description`, and `image` are required at GenericLayout component.')

if (!title || !description || !image)
throw new Error(
'Props `title`, `description`, and `image` are required at GenericLayout component.'
);

return (
<>
<Head
title={title}
description={description}
image={image}
/>
<StickyNavbar>
<NavBar className="max-w-screen-xl block px-4 sm:px-6 lg:px-8 mx-auto" />
</StickyNavbar>
<Head title={title} description={description} image={image} />
<StickyNavbar>
<NavBar className="max-w-screen-xl block px-4 sm:px-6 lg:px-8 mx-auto" />
</StickyNavbar>
<Container wide={wide}>
<AnnouncementHero className="text-center my-4" small={true} />
<AnnouncementHero
className={`text-center m-4 ${hideBanner && 'hidden'}`}
small={true}
/>
{children}
</Container>
</>
)
);
}
42 changes: 22 additions & 20 deletions components/layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,44 +100,46 @@ export default function Layout({ children }) {
if (pathname.startsWith('/docs')) {
const post = getDocBySlug(structuredPosts, pathname)
return (
<DocsLayout post={post} navItems={posts.filter(p => p.slug.startsWith('/docs/'))}>
<DocsLayout
post={post}
navItems={posts.filter((p) => p.slug.startsWith('/docs/'))}
>
{children}
</DocsLayout>
)
);
} else if (pathname.startsWith('/blog/')) {
const post = getPostBySlug(pathname)
return (
<BlogLayout post={post} navItems={posts.filter(p => p.slug.startsWith('/blog/'))}>
<BlogLayout
post={post}
navItems={posts.filter((p) => p.slug.startsWith('/blog/'))}
>
{children}
</BlogLayout>
)
);
} else if (pathname === '/blog') {
return (
<BlogContext.Provider value={{ navItems: posts.filter(p => p.slug.startsWith('/blog/')) }}>
<BlogContext.Provider
value={{ navItems: posts.filter((p) => p.slug.startsWith('/blog/')) }}
>
{children}
</BlogContext.Provider>
)
);
} else if (pathname === '/jobs') {
return (
<JobsContext.Provider value={{ navItems: posts.filter(p => p.slug.startsWith('/jobs/')) }}>
<JobsContext.Provider
value={{ navItems: posts.filter((p) => p.slug.startsWith('/jobs/')) }}
>
{children}
</JobsContext.Provider>
)
);
} else if (pathname.startsWith('/jobs/')) {
const post = getPostBySlug(pathname)
return (
<JobsLayout post={post}>
{children}
</JobsLayout>
)
const post = getPostBySlug(pathname);
return <JobsLayout post={post}>{children}</JobsLayout>;
} else {
const post = getPostBySlug(pathname)
const post = getPostBySlug(pathname);
if (post) {
return (
<GenericPostLayout post={post}>
{children}
</GenericPostLayout>
)
return <GenericPostLayout post={post}>{children}</GenericPostLayout>;
}
}

Expand Down
49 changes: 49 additions & 0 deletions components/navigation/EventFilter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { useEffect, useState } from 'react';
import moment from 'moment';

function EventFilter({ data, setData }) {
const localTime = moment().format('YYYY-MM-DD'); // store localTime
const currentDate = localTime + 'T00:00:00.000Z';
const filterList = ['All', 'Upcoming', 'Recorded'];
const [active, setActive] = useState('All');
useEffect(() => {
switch (active) {
case 'All':
setData(data);
break;
case 'Upcoming':
setData(
data && data.filter((a) => {
return a.date > currentDate;
})
);
break;
case 'Recorded':
setData(
data && data.filter((a) => {
return a.date < currentDate;
})
);
break;
}
}, [active]);
return (
<div className='p-2 bg-secondary-200 rounded-md flex justify-between w-full sm:w-[400px] text-secondary-600'>
{filterList.map((list) => (
<div
key={list}
className={`p-3 w-[100px] cursor-pointer text-center ${
active === list
? 'bg-secondary-600 rounded-md text-white'
: 'hover:text-black'
}`}
onClick={() => setActive(list)}
>
{list}
</div>
))}
</div>
);
}

export default EventFilter;
Loading