Skip to content

Commit 784331b

Browse files
committed
Wire in next, begin building out components
1 parent 8dde6ce commit 784331b

20 files changed

+1753
-3920
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
.next
23
dist
34
.DS_STORE
45
*.swp
File renamed without changes.

components/Container.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
3+
export default ({
4+
className = '',
5+
...props
6+
}) =>
7+
<div
8+
className={`mw9 center ${className}`}
9+
{...props}
10+
/>
File renamed without changes.

components/Flex.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react'
2+
import classNames from 'classnames'
3+
4+
export default ({
5+
is = 'div',
6+
wrap = false,
7+
auto = false,
8+
self,
9+
justify,
10+
alignItems,
11+
children,
12+
...props
13+
}) => {
14+
const className = classNames(props.className || '', 'flex', {
15+
'flex-auto': auto,
16+
'flex-wrap': wrap,
17+
'items-center': alignItems === 'center',
18+
'justify-between': justify === 'between'
19+
})
20+
21+
const newProps = Object.assign({}, props, { className })
22+
23+
return React.createElement(is, newProps, children)
24+
}

src/Footer.js renamed to components/Footer.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react'
2-
import { Link } from 'react-router-dom'
2+
import Link from 'next/link'
3+
4+
import Container from './Container'
35

46
export default () =>
57
<footer className='bg-white black-70 ph3 ph5-ns pv5 pv6-ns bt b--black-10'>
6-
<div className='mw9 center'>
8+
<Container>
79
<div className='mb5 lh-copy'>
810
<Link className='black-70 link hover-blue b dib mr3 mb3' to='/' title='Home'>
911
Home
@@ -74,5 +76,5 @@ export default () =>
7476
The word comes from the Greek:
7577
ταχύς or tachys, meaning 'swift, quick, fast, rapid'
7678
</small>
77-
</div>
79+
</Container>
7880
</footer>
File renamed without changes.

components/Header.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react'
2+
3+
import Container from './Container'
4+
import Flex from './Flex'
5+
import {
6+
NavLink,
7+
TitleLink
8+
} from './ui'
9+
10+
export default ({ version }) =>
11+
<header className='w-100 pa3 ph5-ns bg-white'>
12+
<Container>
13+
<Flex
14+
justify='between'
15+
alignItems='center'
16+
>
17+
<TitleLink
18+
href='/'
19+
title='Home'
20+
text='Tachyons'
21+
subtext={`v${version}`}
22+
/>
23+
24+
<Flex is='nav'>
25+
<NavLink title='Documentation' href='/docs/'>
26+
Docs
27+
</NavLink>
28+
<NavLink title='Components' href='/components/'>
29+
Components
30+
</NavLink>
31+
<NavLink title='Gallery of sites built with Tachyons' to='/gallery/'>
32+
Gallery
33+
</NavLink>
34+
<NavLink title='Resources' href='/resources/'>
35+
Resources
36+
</NavLink>
37+
<NavLink title='Tachyons on GitHub' href='http://github.com/tachyons-css/tachyons/'>
38+
GitHub
39+
</NavLink>
40+
</Flex>
41+
</Flex>
42+
</Container>
43+
</header>
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react'
22

3+
import { version } from '../package.json'
34
import Header from './Header'
45
import Footer from './Footer'
56

67
export default ({
78
title = 'TACHYONS - Css Toolkit',
8-
version,
99
children
1010
}) =>
1111
<div className='w-100 sans-serif'>
@@ -16,6 +16,5 @@ export default ({
1616
/>
1717

1818
<Header version={version} />
19-
<div>{children}</div>
20-
<Footer />
19+
<main>{children}</main>
2120
</div>

components/Link.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import Link from 'next/link'
3+
4+
export default ({
5+
href = '#!',
6+
...props
7+
}) =>
8+
<Link href={href}>
9+
<a {...props} />
10+
</Link>
File renamed without changes.

components/ui.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react'
2+
import Link from 'next/link'
3+
4+
export const NavLink = ({ href = '#!', ...props }) =>
5+
<Link href={href}>
6+
<a
7+
className='f6 fw6 hover-blue link black-70 mr2 mr3-m mr4-l dib'
8+
{...props}
9+
/>
10+
</Link>
11+
12+
export const TitleLink = ({
13+
href = '#!',
14+
subtext,
15+
text,
16+
...props
17+
}) =>
18+
<Link href={href}>
19+
<a
20+
className='dib f5 f4-ns fw6 mt0 mb1 link black-70'
21+
{...props}
22+
>
23+
{text}
24+
25+
{subtext && (
26+
<div className='dib pl1'>
27+
<small className='nowrap f6 mt2 mt3-ns pr2 black-70 fw2'>{subtext}</small>
28+
</div>
29+
)}
30+
</a>
31+
</Link>
File renamed without changes.

next.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
webpack: config => {
3+
config.module.rules.push({
4+
test: /\.md$/,
5+
use: [
6+
'babel-loader',
7+
'@compositor/markdown-loader'
8+
]
9+
})
10+
11+
return config
12+
}
13+
}

0 commit comments

Comments
 (0)