forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ethereum/header-desktop-layout
feat: homepage desktop layout & header component
- Loading branch information
Showing
32 changed files
with
863 additions
and
619 deletions.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,95 +1,68 @@ | ||
import { | ||
Table, | ||
Thead, | ||
Tr, | ||
Th, | ||
TableContainer, | ||
Text, | ||
Tbody, | ||
Td, | ||
} from '@chakra-ui/react'; | ||
import { Table, Thead, Tr, Th, TableContainer, Text, Tbody, Td } from '@chakra-ui/react'; | ||
import { FC } from 'react'; | ||
|
||
interface Props { | ||
columnHeaders: string[] | ||
data: any | ||
columnHeaders: string[]; | ||
data: any; | ||
} | ||
|
||
export const DataTable: FC<Props> = ({ | ||
columnHeaders, | ||
data, | ||
}) => { | ||
export const DataTable: FC<Props> = ({ columnHeaders, data }) => { | ||
return ( | ||
<TableContainer | ||
// Note: This wont work on firefox, we are ok with this. | ||
css={{ | ||
"&::-webkit-scrollbar": { | ||
'&::-webkit-scrollbar': { | ||
borderTop: '2px solid #11866f', | ||
height: 18 | ||
}, | ||
"&::-webkit-scrollbar-thumb": { | ||
background: "#11866f", | ||
}, | ||
'&::-webkit-scrollbar-thumb': { | ||
background: '#11866f' | ||
} | ||
}} | ||
pt={4} | ||
pb={4} | ||
> | ||
<Table variant='unstyled'> | ||
<Thead> | ||
<Tr> | ||
{ | ||
columnHeaders.map((columnHeader, idx) => { | ||
return ( | ||
<Th | ||
key={idx} | ||
textTransform='none' | ||
minW={'130.5px'} | ||
px={4} | ||
{columnHeaders.map((columnHeader, idx) => { | ||
return ( | ||
<Th key={idx} textTransform='none' minW={'130.5px'} px={4}> | ||
<Text | ||
fontFamily='"JetBrains Mono", monospace' | ||
fontWeight={700} | ||
fontSize='md' | ||
color='#868b87' | ||
> | ||
<Text | ||
fontFamily='"JetBrains Mono", monospace' | ||
fontWeight={700} | ||
fontSize='md' | ||
color='#868b87' | ||
> | ||
{columnHeader} | ||
</Text> | ||
</Th> | ||
) | ||
}) | ||
} | ||
{columnHeader} | ||
</Text> | ||
</Th> | ||
); | ||
})} | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
{ | ||
data.map((item: any, idx: number) => { | ||
return ( | ||
<Tr | ||
key={idx} | ||
// TODO: Get new background color from nuno for hover | ||
transition={'all 0.5s'} | ||
_hover={{background: 'green.50', transition: 'all 0.5s'}} | ||
> | ||
{ | ||
columnHeaders.map((columnHeader, idx) => { | ||
// TODO: Make the font size smaller (refer to design system) | ||
return ( | ||
<Td | ||
key={idx} | ||
px={4} | ||
fontSize='13px' | ||
> | ||
{item[columnHeader.toLowerCase()]} | ||
</Td> | ||
) | ||
}) | ||
} | ||
</Tr> | ||
) | ||
}) | ||
} | ||
{data.map((item: any, idx: number) => { | ||
return ( | ||
<Tr | ||
key={idx} | ||
// TODO: Get new background color from nuno for hover | ||
transition={'all 0.5s'} | ||
_hover={{ background: 'green.50', transition: 'all 0.5s' }} | ||
> | ||
{columnHeaders.map((columnHeader, idx) => { | ||
// TODO: Make the font size smaller (refer to design system) | ||
return ( | ||
<Td key={idx} px={4} fontSize='13px'> | ||
{item[columnHeader.toLowerCase()]} | ||
</Td> | ||
); | ||
})} | ||
</Tr> | ||
); | ||
})} | ||
</Tbody> | ||
</Table> | ||
</TableContainer> | ||
) | ||
} | ||
); | ||
}; |
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,113 @@ | ||
import { Box, Flex, Input, InputGroup, Link, Stack, Text } from '@chakra-ui/react'; | ||
import { FC } from 'react'; | ||
import NextLink from 'next/link'; | ||
|
||
import { HamburguerIcon, LensIcon, MoonIcon } from '../UI/icons'; | ||
import { DOCS_PAGE, DOWNLOADS_PAGE } from '../../constants'; | ||
|
||
export const Header: FC = () => { | ||
return ( | ||
<Flex | ||
mb={4} | ||
border='2px solid' | ||
borderColor='brand.light.primary' | ||
justifyContent='space-between' | ||
> | ||
<Stack | ||
p={4} | ||
justifyContent='center' | ||
alignItems='flex-start' | ||
borderRight={{ base: 'none', sm: '2px solid' }} | ||
borderColor='brand.light.primary' | ||
flexGrow={2} | ||
> | ||
<Text textStyle='header-font'> | ||
go-ethereum | ||
</Text> | ||
</Stack> | ||
|
||
<Flex> | ||
{/* DOWNLOADS */} | ||
<Stack | ||
p={4} | ||
justifyContent='center' | ||
borderRight='2px solid' | ||
borderColor='brand.light.primary' | ||
display={{ base: 'none', md: 'block' }} | ||
color='brand.light.primary' | ||
_hover={{ | ||
textDecoration: 'none', | ||
bg: 'brand.light.primary', | ||
color: 'yellow.50 !important' | ||
}} | ||
> | ||
<NextLink href={DOWNLOADS_PAGE} passHref> | ||
<Link _hover={{ textDecoration: 'none' }}> | ||
<Text textStyle='header-font' textTransform='uppercase'> | ||
downloads | ||
</Text> | ||
</Link> | ||
</NextLink> | ||
</Stack> | ||
|
||
{/* DOCUMENTATION */} | ||
<Stack | ||
p={4} | ||
justifyContent='center' | ||
borderRight={{ base: 'none', md: '2px solid' }} | ||
borderColor='brand.light.primary' | ||
display={{ base: 'none', md: 'block' }} | ||
color='brand.light.primary' | ||
_hover={{ | ||
textDecoration: 'none', | ||
bg: 'brand.light.primary', | ||
color: 'yellow.50 !important' | ||
}} | ||
> | ||
<NextLink href={DOCS_PAGE} passHref> | ||
<Link _hover={{ textDecoration: 'none' }}> | ||
<Text textStyle='header-font' textTransform='uppercase'> | ||
documentation | ||
</Text> | ||
</Link> | ||
</NextLink> | ||
</Stack> | ||
|
||
{/* SEARCH */} | ||
<Stack | ||
p={4} | ||
display={{ base: 'none', md: 'block' }} | ||
borderRight={{ base: 'none', md: '2px solid' }} | ||
borderColor='brand.light.primary' | ||
> | ||
<InputGroup> | ||
<Input | ||
variant='unstyled' | ||
placeholder='search' | ||
size='md' | ||
_placeholder={{ color: 'brand.light.primary', fontStyle: 'italic' }} | ||
/> | ||
|
||
<Stack pl={4} justifyContent='center' alignItems='center'> | ||
<LensIcon /> | ||
</Stack> | ||
</InputGroup> | ||
</Stack> | ||
|
||
{/* DARK MODE SWITCH */} | ||
<Box | ||
p={4} | ||
borderRight={{ base: '2px solid', lg: 'none' }} | ||
borderColor='brand.light.primary' | ||
> | ||
<MoonIcon /> | ||
</Box> | ||
|
||
{/* HAMBURGUER MENU */} | ||
<Box p={4} display={{ base: 'block', md: 'none' }}> | ||
<HamburguerIcon /> | ||
</Box> | ||
</Flex> | ||
</Flex> | ||
); | ||
}; |
Oops, something went wrong.