1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-fela/pages/index.js
Robin Frischmann 6f0914c788 FIX #3757 update Fela example for Next 5 (#3949)
* #3757 update Fela for Next 5

closes #3757

* add missing props passdown
2018-03-06 14:27:47 +01:00

35 lines
696 B
JavaScript
Executable file

import { createComponent } from 'react-fela'
import FelaProvider from '../FelaProvider'
const Container = createComponent(() => ({
maxWidth: 700,
marginLeft: 'auto',
marginRight: 'auto',
lineHeight: 1.5
}))
const Text = createComponent(({ size = 16 }) => ({
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
fontSize: size,
color: '#333'
}))
const Title = createComponent(
({ size = 24 }) => ({
fontSize: size,
color: '#555'
}),
Text
)
export default () => (
<FelaProvider>
<Container>
<Title size={50}>My Title</Title>
<Text>Hi, I am Fela.</Text>
</Container>
</FelaProvider>
)