1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
2020-12-29 02:05:28 -07:00

20 lines
567 B
TypeScript

import { Heading } from '@chakra-ui/react';
import { useConfig } from '~/context';
import { useBooleanValue } from '~/hooks';
import { useHeaderCtx } from './context';
import { useTitleSize } from './useTitleSize';
export const TitleOnly = () => {
const { showSubtitle } = useHeaderCtx();
const { web } = useConfig();
const margin = useBooleanValue(showSubtitle, 2, 0);
const sizeSm = useTitleSize(web.text.title, '2xl', []);
return (
<Heading as="h1" mb={margin} fontSize={{ base: sizeSm, lg: '5xl' }}>
{web.text.title}
</Heading>
);
};