mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
improve header layout [skip ci]
This commit is contained in:
19
hyperglass/ui/components/header/titleOnly.tsx
Normal file
19
hyperglass/ui/components/header/titleOnly.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user