forked from use-global-hook/use-global-hook
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
21 changed files
with
5,596 additions
and
806 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,3 +56,7 @@ package-lock.json | |
.eslint* | ||
.tmp | ||
babel.config.js | ||
|
||
docs/website/*.md | ||
docs/api_website | ||
docs/public |
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,2 @@ | ||
*.md | ||
*.mdx |
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,85 @@ | ||
import React from 'react'; | ||
// import { Link } from 'react-router-dom'; | ||
import * as scope from '@compositor/x0/components'; | ||
import { Provider as RebassProvider } from 'rebass'; // Flex, Box, Container | ||
// import sortBy from 'lodash.sortby'; | ||
|
||
import LandingLayout from './_landing'; | ||
import theme from './_theme'; | ||
import Logo from './_logo'; | ||
|
||
const { ScopeProvider, SidebarLayout } = scope; | ||
|
||
// const navOrder = [ | ||
// 'index', | ||
// 'getting-started', | ||
// 'markdown', | ||
// 'react', | ||
// 'MDX', | ||
// 'JSX', | ||
// 'routing', | ||
// 'custom-app', | ||
// 'components', | ||
// 'ScopeProvider', | ||
// 'SidebarLayout', | ||
// 'LivePreview', | ||
// 'LiveEditor', | ||
// 'cli-options', | ||
// 'exporting', | ||
// 'examples', | ||
// ]; | ||
const pageNames = { | ||
index: 'Home', | ||
'cli-options': 'CLI Options', | ||
}; | ||
|
||
const hardRoutes = [ | ||
{ | ||
key: './api.md', | ||
name: 'Api', | ||
href: 'https://localhost:9090', | ||
path: 'https://localhost:9090', | ||
}, | ||
{ | ||
key: './coverage.md', | ||
name: 'Coverage', | ||
href: 'https://coveralls.io/github/nmccready/use-global-hook?branch=master', | ||
path: 'https://coveralls.io/github/nmccready/use-global-hook?branch=master', | ||
}, | ||
]; | ||
|
||
const sortRoutes = (routes) => | ||
routes | ||
.map((route) => { | ||
if (!pageNames[route.name]) return route; | ||
return { | ||
...route, | ||
name: pageNames[route.name], | ||
}; | ||
}) | ||
.concat(hardRoutes); | ||
|
||
const App = (props) => { | ||
const { routes, route } = props; | ||
const { layout } = (route && route.props) || {}; | ||
|
||
const Layout = layout === 'landing' ? LandingLayout : SidebarLayout; | ||
|
||
// ! all routes can be custom sorted again by the doc consumer | ||
// ! they come pre-sorted, see @compositor/x0/src/entry.js | ||
const nav = sortRoutes(routes); | ||
|
||
return ( | ||
<ScopeProvider scope={scope}> | ||
<RebassProvider theme={theme}> | ||
<Layout {...props} title="use-global-hook" routes={nav} logo={<Logo size={24} />} /> | ||
</RebassProvider> | ||
</ScopeProvider> | ||
); | ||
}; | ||
|
||
App.defaultProps = { | ||
title: 'use-global-hook', | ||
}; | ||
|
||
export default App; |
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,38 @@ | ||
import React from 'react'; | ||
import { Flex, Box, Container, Text, BlockLink, Caps } from 'rebass'; | ||
import { Link } from 'react-router-dom'; | ||
import Logo from './_logo'; | ||
|
||
export default ({ children }) => ( | ||
<React.Fragment> | ||
<Flex alignItems="center"> | ||
<BlockLink href="https://github.com/nmccready"> | ||
<Flex px={1} py={2} alignItems="center"> | ||
<Logo width={100} height={100} /> | ||
<Text style={{ position: 'fixed', left: 105 }} fontWeight="bold"> | ||
nmccready | ||
</Text> | ||
</Flex> | ||
</BlockLink> | ||
<Box mx="auto" /> | ||
<BlockLink px={3} is={Link} to="/"> | ||
<Caps fontWeight="bold">use-global-hook</Caps> | ||
</BlockLink> | ||
<BlockLink px={3} href="https://github.com/nmccready/use-global-hook"> | ||
<Caps fontWeight="bold">Github</Caps> | ||
</BlockLink> | ||
</Flex> | ||
{children} | ||
<Container> | ||
<Flex py={4} mt={5} flexWrap="wrap"> | ||
<BlockLink my={2} mr={3} href="https://github.com/nmccready"> | ||
<Caps fontWeight="bold">Github</Caps> | ||
</BlockLink> | ||
<Box mx="auto" /> | ||
<Text my={2} fontSize={0}> | ||
© 2019 Nicholas McCready, Inc. All rights reserved | ||
</Text> | ||
</Flex> | ||
</Container> | ||
</React.Fragment> | ||
); |
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,18 @@ | ||
import React from 'react'; | ||
import Logo from './_logo'; | ||
|
||
export default ({ size = 1024 }) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24 12" | ||
width={size} | ||
height={size / 2} | ||
fill="none" | ||
stroke="currentcolor" | ||
> | ||
<rect width={24} height={12} stroke="none" fill="black" /> | ||
<g transform="translate(8, 2)"> | ||
<Logo size={8} /> | ||
</g> | ||
</svg> | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
import { theme } from 'rebass'; | ||
|
||
export default { | ||
...theme, | ||
radii: [0, 4, 8, 16], | ||
}; |
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,2 @@ | ||
*.md | ||
*.mdx |
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,78 @@ | ||
import React from 'react'; | ||
// import { Link } from 'react-router-dom'; | ||
import * as scope from '@compositor/x0/components'; | ||
import { Provider as RebassProvider } from 'rebass'; // Flex, Box, Container | ||
// import sortBy from 'lodash.sortby'; | ||
|
||
import LandingLayout from './_landing'; | ||
import theme from './_theme'; | ||
|
||
const { ScopeProvider, SidebarLayout } = scope; | ||
|
||
// const navOrder = [ | ||
// 'index', | ||
// 'getting-started', | ||
// 'markdown', | ||
// 'react', | ||
// 'MDX', | ||
// 'JSX', | ||
// 'routing', | ||
// 'custom-app', | ||
// 'components', | ||
// 'ScopeProvider', | ||
// 'SidebarLayout', | ||
// 'LivePreview', | ||
// 'LiveEditor', | ||
// 'cli-options', | ||
// 'exporting', | ||
// 'examples', | ||
// ]; | ||
const pageNames = { | ||
index: 'Home', | ||
'cli-options': 'CLI Options', | ||
}; | ||
|
||
const hardRoutes = [ | ||
// { | ||
// key: './coverage.md', | ||
// name: 'Coverage', | ||
// href: 'https://nmccready.github.io/js-common/coverage/lcov-report/', | ||
// path: 'https://nmccready.github.io/js-common/coverage/lcov-report/', | ||
// }, | ||
]; | ||
|
||
const sortRoutes = (routes) => | ||
routes | ||
.map((route) => { | ||
if (!pageNames[route.name]) return route; | ||
return { | ||
...route, | ||
name: pageNames[route.name], | ||
}; | ||
}) | ||
.concat(hardRoutes); | ||
|
||
const App = (props) => { | ||
const { routes, route } = props; | ||
const { layout } = (route && route.props) || {}; | ||
|
||
const Layout = layout === 'landing' ? LandingLayout : SidebarLayout; | ||
|
||
// ! all routes can be custom sorted again by the doc consumer | ||
// ! they come pre-sorted, see @compositor/x0/src/entry.js | ||
const nav = sortRoutes(routes); | ||
|
||
return ( | ||
<ScopeProvider scope={scope}> | ||
<RebassProvider theme={theme}> | ||
<Layout {...props} title="js-common" routes={nav} /> | ||
</RebassProvider> | ||
</ScopeProvider> | ||
); | ||
}; | ||
|
||
App.defaultProps = { | ||
title: 'js-common', | ||
}; | ||
|
||
export default App; |
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,36 @@ | ||
import React from 'react'; | ||
import { Flex, Box, Container, Text, BlockLink, Caps } from 'rebass'; | ||
import { Link } from 'react-router-dom'; | ||
import Logo from './_logo'; | ||
|
||
export default ({ children }) => ( | ||
<React.Fragment> | ||
<Flex alignItems="center"> | ||
<BlockLink href="https://github.com/nmccready"> | ||
<Flex px={1} py={2} alignItems="center"> | ||
{/* <Logo width={100} height={100} /> */} | ||
<Text fontWeight="bold">nmccready</Text> | ||
</Flex> | ||
</BlockLink> | ||
<Box mx="auto" /> | ||
<BlockLink px={3} is={Link} to="/"> | ||
<Caps fontWeight="bold">js-common</Caps> | ||
</BlockLink> | ||
<BlockLink px={3} href="https://github.com/nmccready/js-common"> | ||
<Caps fontWeight="bold">Github</Caps> | ||
</BlockLink> | ||
</Flex> | ||
{children} | ||
<Container> | ||
<Flex py={4} mt={5} flexWrap="wrap"> | ||
<BlockLink my={2} mr={3} href="https://github.com/nmccready"> | ||
<Caps fontWeight="bold">Github</Caps> | ||
</BlockLink> | ||
<Box mx="auto" /> | ||
<Text my={2} fontSize={0}> | ||
© 2019 Nicholas McCready, Inc. All rights reserved | ||
</Text> | ||
</Flex> | ||
</Container> | ||
</React.Fragment> | ||
); |
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,18 @@ | ||
import React from 'react'; | ||
import Logo from './_logo'; | ||
|
||
export default ({ size = 1024 }) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 24 12" | ||
width={size} | ||
height={size / 2} | ||
fill="none" | ||
stroke="currentcolor" | ||
> | ||
<rect width={24} height={12} stroke="none" fill="black" /> | ||
<g transform="translate(8, 2)"> | ||
<Logo size={8} /> | ||
</g> | ||
</svg> | ||
); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
import { theme } from 'rebass'; | ||
|
||
export default { | ||
...theme, | ||
radii: [0, 4, 8, 16], | ||
}; |
Binary file not shown.
Oops, something went wrong.