go-ethereum/src/components/UI/Header.tsx
Nicolás Quiroz 91dd04faa2
feat: All releases downloads (#46)
* chore: update constants

* feat: add releases data utils

* chore: add fast-xml-parser

* chore: update types

* feat: fetch & parse all releases data

* chore: update utils

* wip: use real data on DataTable

* chore: update yarn.lock

* fix: getReleaseCommitHash

* feat: filter data per downloads tab

* chore: update DownloadsTable

* chore: update DownloadsTable Props

* fix: getReleaseArch.ts

* feat: add fetchXMLData util

* feat: add fetchLatestReleaseCommit util

* feat: add getSortedReleases util

* chore: comment wip primary release feature

* fix: fetchXMLData

* chore: add netlify.toml

* fix: total number of releases count

* fix: center showing latest releases text and use smaller font

* chore: prettier

* chore: update textStyles

* fix: merge conflicts
2022-11-29 15:29:52 -03:00

68 lines
1.7 KiB
TypeScript

import { FC } from 'react';
import { Box, Flex, Link, Stack, Text, useColorMode } from '@chakra-ui/react';
import NextLink from 'next/link';
import { MoonIcon, SunIcon } from '../UI/icons';
import { Search } from './search';
import { HeaderButtons } from './';
import { MobileMenu } from '../layouts';
export const Header: FC = () => {
const { colorMode, toggleColorMode } = useColorMode();
const isDark = colorMode === 'dark';
return (
<Flex
mb={4}
border='2px'
borderColor='primary'
justifyContent='space-between'
position='relative'
>
<Stack
p={4}
justifyContent='center'
alignItems='flex-start'
borderRight='2px'
borderColor='primary'
flexGrow={2}
>
<NextLink href={'/'} passHref>
<Link _hover={{ textDecoration: 'none' }}>
<Text textStyle='header-font'>go-ethereum</Text>
</Link>
</NextLink>
</Stack>
<Flex>
{/* HEADER BUTTONS */}
<Stack display={{ base: 'none', md: 'block' }}>
<HeaderButtons />
</Stack>
{/* SEARCH */}
<Stack display={{ base: 'none', md: 'block' }}>
<Search />
</Stack>
{/* DARK MODE SWITCH */}
<Box
as='button'
p={4}
borderRight={{ base: '2px', md: 'none' }}
borderColor='primary'
onClick={toggleColorMode}
_hover={{
bg: 'primary',
svg: { color: 'bg' }
}}
>
{isDark ? <SunIcon color='primary' /> : <MoonIcon color='primary' />}
</Box>
</Flex>
{/* MOBILE MENU */}
<MobileMenu />
</Flex>
);
};