From cc320913aaf4e110082980aae8e06166ca5d62b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Wed, 3 Jul 2024 14:56:35 -0300 Subject: [PATCH 1/7] add community page --- pages/community.tsx | 125 +++++++++++++++++++++++++++++++++++ src/data/getSiteSettings.tsx | 16 ++--- 2 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 pages/community.tsx diff --git a/pages/community.tsx b/pages/community.tsx new file mode 100644 index 00000000..8330010f --- /dev/null +++ b/pages/community.tsx @@ -0,0 +1,125 @@ +import { + ArrowRightIcon, + Button, + DocumentIcon, + GitHubLogoIcon, + IconFrame, +} from '@pluralsh/design-system' +import { type GetStaticProps, type InferGetStaticPropsType } from 'next' + +import { useTheme } from 'styled-components' + +import { FooterVariant } from '@src/components/FooterFull' +import { GradientBG } from '@src/components/layout/GradientBG' +import { HeaderPad } from '@src/components/layout/HeaderPad' +import { StandardPageWidth } from '@src/components/layout/LayoutHelpers' +import { BasicPageHero } from '@src/components/PageHeros' +import { ResponsiveText } from '@src/components/Typography' +import { cn as classNames } from '@src/utils/cn' +import { propsWithGlobalSettings } from '@src/utils/getGlobalProps' + +export default function Community( + props: InferGetStaticPropsType +) { + console.log('props:', props) + + return ( + <> + + + + {/* resources */} + + + Community Resources + +
+ {kinds.map((key) => ( + + ))} +
+
+ + ) +} + +const resources = { + gitHub: { + url: 'https://github.com/pluralsh/plural', + title: 'GitHub', + icon: , + }, + youtube: { + url: 'https://www.youtube.com/channel/UCt8xwvJH4f4c6g8J1Y6ZmJQ', + title: 'YouTube', + icon: , + }, + docs: { + url: 'https://docs.plural.sh', + title: 'Docs', + icon: , + }, +} as const + +const kinds = Object.keys(resources) as Array + +function ResourceLink({ kind }: { kind: keyof typeof resources }) { + const theme = useTheme() + + return ( + + ) +} + +export type CommunityPageProps = any + +export const getStaticProps: GetStaticProps = async ( + _context +) => + propsWithGlobalSettings({ + metaTitle: 'Community', + metaDescription: 'Flexible plans for every stage of your business', + footerVariant: FooterVariant.kitchenSink, + // errors: combineErrors([communityError, faqError]), + }) diff --git a/src/data/getSiteSettings.tsx b/src/data/getSiteSettings.tsx index 485d6d8c..09d31c4e 100644 --- a/src/data/getSiteSettings.tsx +++ b/src/data/getSiteSettings.tsx @@ -173,14 +173,14 @@ export const getSiteSettings = (solutions?: Solution[]) => ({ url: '/contact', }, }, - // { - // id: '6-5', - // link: { - // id: '6-5', - // title: 'Community', - // url: '/community', - // }, - // }, + { + id: '6-5', + link: { + id: '6-5', + title: 'Community', + url: '/community', + }, + }, ], }, ], From 9f102201188394cd2821231ceb63df11735688fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Boaventura?= Date: Wed, 3 Jul 2024 16:30:55 -0300 Subject: [PATCH 2/7] add event section --- pages/community.tsx | 136 ++++++++++++++++-- .../page-sections/EventsSection.tsx | 16 ++- 2 files changed, 136 insertions(+), 16 deletions(-) diff --git a/pages/community.tsx b/pages/community.tsx index 8330010f..41864740 100644 --- a/pages/community.tsx +++ b/pages/community.tsx @@ -1,11 +1,15 @@ import { ArrowRightIcon, Button, + Card, + Chip, + ColorModeProvider, DocumentIcon, GitHubLogoIcon, IconFrame, } from '@pluralsh/design-system' import { type GetStaticProps, type InferGetStaticPropsType } from 'next' +import { useRouter } from 'next/router' import { useTheme } from 'styled-components' @@ -13,16 +17,17 @@ import { FooterVariant } from '@src/components/FooterFull' import { GradientBG } from '@src/components/layout/GradientBG' import { HeaderPad } from '@src/components/layout/HeaderPad' import { StandardPageWidth } from '@src/components/layout/LayoutHelpers' +import { formatDateTime } from '@src/components/page-sections/EventsSection' import { BasicPageHero } from '@src/components/PageHeros' import { ResponsiveText } from '@src/components/Typography' +import { type PluralEvent, getEvents } from '@src/data/getEvents' import { cn as classNames } from '@src/utils/cn' +import { combineErrors } from '@src/utils/combineErrors' import { propsWithGlobalSettings } from '@src/utils/getGlobalProps' -export default function Community( - props: InferGetStaticPropsType -) { - console.log('props:', props) - +export default function Community({ + events, +}: InferGetStaticPropsType) { return ( <> + {/* events */} + +
+ + + Plural Events + + {events.length ? ( + + ) : ( + + + No planned events at this time + + + )} + +
+
) } @@ -92,6 +138,7 @@ function ResourceLink({ kind }: { kind: keyof typeof resources }) { return (