-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First section * Add table * Add FAQ * Mobile table * Fix desktop table * Add secondary buttons * Last touches * Copy * Add og image * Add monthly * Addressed comments * Update SEO metadata * Monthly -> Month * 5000 -> 2000 * Remove tw logo * Latest changes
- Loading branch information
1 parent
ffbafd3
commit 4589391
Showing
7 changed files
with
796 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { | ||
Accordion, | ||
AccordionItem, | ||
AccordionButton, | ||
AccordionIcon, | ||
AccordionPanel, | ||
Flex, | ||
Box, | ||
} from "@chakra-ui/react"; | ||
import { useTrack } from "hooks/analytics/useTrack"; | ||
import { Heading, Text } from "tw-components"; | ||
|
||
interface LandingFAQProps { | ||
TRACKING_CATEGORY: string; | ||
title: string; | ||
faqs: { | ||
title: string; | ||
description: React.ReactNode; | ||
}[]; | ||
} | ||
|
||
export const LandingFAQ: React.FC<LandingFAQProps> = ({ | ||
TRACKING_CATEGORY, | ||
title = "FAQ", | ||
faqs, | ||
}) => { | ||
const trackEvent = useTrack(); | ||
const trackToggleFAQ = (faqTitle: string) => { | ||
trackEvent({ | ||
category: TRACKING_CATEGORY, | ||
action: "toggle", | ||
label: "faq", | ||
faqTitle, | ||
}); | ||
}; | ||
|
||
return ( | ||
<Flex | ||
mt={12} | ||
flexDirection="column" | ||
w="full" | ||
maxW={{ | ||
base: "100%", | ||
lg: "container.md", | ||
}} | ||
> | ||
<Heading size="title.md" alignSelf="center"> | ||
{title} | ||
</Heading> | ||
<Accordion mt={8} allowMultiple rounded="xl"> | ||
{faqs.map((faq) => ( | ||
<AccordionItem key={faq.title}> | ||
<Text fontSize="1rem"> | ||
<AccordionButton p={6} onClick={() => trackToggleFAQ(faq.title)}> | ||
<Box as="span" flex="1" textAlign="left"> | ||
{faq.title} | ||
</Box> | ||
<AccordionIcon /> | ||
</AccordionButton> | ||
</Text> | ||
<AccordionPanel pb={4}> | ||
<Flex direction="column" gap={4}> | ||
{faq.description} | ||
</Flex> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
))} | ||
</Accordion> | ||
</Flex> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.