-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84d5f64
commit 195b01b
Showing
44 changed files
with
1,384 additions
and
223 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
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
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
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
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
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
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
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
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 @@ | ||
dist |
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
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
79 changes: 0 additions & 79 deletions
79
integrations/gatsby-theme-stories/src/components/ColorMode.tsx
This file was deleted.
Oops, something went wrong.
50 changes: 26 additions & 24 deletions
50
integrations/gatsby-theme-stories/src/components/Header.tsx
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,41 +1,43 @@ | ||
/** @jsx jsx */ | ||
import { FC } from 'react'; | ||
import { jsx, useColorMode, Heading } from 'theme-ui'; | ||
import { FC, useContext } from 'react'; | ||
import { jsx, Heading } from 'theme-ui'; | ||
import { Flex } from '@theme-ui/components'; | ||
import { ColorMode } from './ColorMode'; | ||
import { ColorMode, SidebarContext } from '@component-controls/app-components'; | ||
|
||
interface HeaderProps { | ||
title?: string; | ||
} | ||
export const Header: FC<HeaderProps> = ({ title }) => { | ||
const [colorMode, setColorMode] = useColorMode(); | ||
const isDark = colorMode === `dark`; | ||
const toggleColorMode = (e: any) => { | ||
e.preventDefault(); | ||
setColorMode(isDark ? `light` : `dark`); | ||
}; | ||
const { SidebarToggle } = useContext(SidebarContext); | ||
|
||
return ( | ||
<header sx={{ px: 3, py: 1 }}> | ||
<Flex sx={{ alignItems: `center`, justifyContent: `space-between` }}> | ||
<Heading>{title}</Heading> | ||
<ColorMode isDark={isDark} toggle={toggleColorMode} /> | ||
</Flex> | ||
<div | ||
<header sx={{ px: 3 }}> | ||
<Flex | ||
sx={{ | ||
boxSizing: `border-box`, | ||
display: `flex`, | ||
variant: `dividers.bottom`, | ||
py: 3, | ||
flexDirection: 'row', | ||
alignItems: `center`, | ||
justifyContent: `space-between`, | ||
mt: 3, | ||
color: `secondary`, | ||
a: { color: `secondary`, ':hover': { color: `heading` } }, | ||
flexFlow: `wrap`, | ||
}} | ||
> | ||
links | ||
</div> | ||
<Flex sx={{ flexDirection: 'row', alignItems: 'center' }}> | ||
<SidebarToggle /> | ||
<Heading sx={{ pl: 2 }}>{title}</Heading> | ||
</Flex> | ||
<Flex | ||
sx={{ | ||
boxSizing: `border-box`, | ||
variant: `dividers.bottom`, | ||
justifyContent: `space-between`, | ||
color: `secondary`, | ||
a: { color: `secondary`, ':hover': { color: `accent` } }, | ||
flexFlow: `wrap`, | ||
}} | ||
> | ||
<a>links</a> | ||
</Flex> | ||
<ColorMode /> | ||
</Flex> | ||
</header> | ||
); | ||
}; |
Oops, something went wrong.