import { Button, Flex, VStack } from '@chakra-ui/react'; import { motion } from 'framer-motion'; import { isSafari } from 'react-device-detect'; import { Case, Switch } from 'react-if'; import { useConfig } from '~/context'; import { useFormInteractive, useFormState, useMobile } from '~/hooks'; import { Logo } from './logo'; import { SubtitleOnly } from './subtitle-only'; import { TitleOnly } from './title-only'; import type { FlexProps, StackProps } from '@chakra-ui/react'; import type { MotionProps } from 'framer-motion'; type DWrapperProps = Omit & MotionProps; type MWrapperProps = Omit & MotionProps; type WrapperProps = Partial>; const AnimatedVStack = motion(VStack); const AnimatedFlex = motion(Flex); /** * Title wrapper for mobile devices, breakpoints sm & md. */ const MWrapper = (props: MWrapperProps): JSX.Element => { const formInteractive = useFormInteractive(); return ( ); }; /** * Title wrapper for desktop devices, breakpoints lg & xl. */ const DWrapper = (props: DWrapperProps): JSX.Element => { const formInteractive = useFormInteractive(); return ( ); }; /** * Universal wrapper for title sub-components, which will be different depending on the * `title_mode` configuration variable. */ const TitleWrapper = (props: DWrapperProps | MWrapperProps): JSX.Element => { const isMobile = useMobile(); return ( <> {isMobile ? ( ) : ( )} ); }; /** * Title sub-component if `title_mode` is set to `text_only`. */ const TextOnly = (props: WrapperProps): JSX.Element => { return ( ); }; /** * Title sub-component if `title_mode` is set to `logo_only`. Renders only the logo. */ const LogoOnly = (props: WrapperProps): JSX.Element => ( ); /** * Title sub-component if `title_mode` is set to `logo_subtitle`. Renders the logo with the * subtitle underneath. */ const LogoSubtitle = (props: WrapperProps): JSX.Element => ( ); /** * Title sub-component if `title_mode` is set to `all`. Renders the logo, title, and subtitle. */ const All = (props: WrapperProps): JSX.Element => ( ); /** * Title component which renders sub-components based on the `title_mode` configuration variable. */ export const Title = (props: FlexProps): JSX.Element => { const { fontSize, ...rest } = props; const { web } = useConfig(); const { titleMode } = web.text; const reset = useFormState(s => s.reset); const formInteractive = useFormInteractive(); return ( ); };