forked from Giveth/ethereum-signal-aggregator
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added jsx-a11y lint support and initial docz setup
- Loading branch information
Showing
10 changed files
with
143 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
yarn.lock | ||
privateKey.json | ||
package-lock.json | ||
.docz |
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,28 @@ | ||
import styled from 'styled-components' | ||
import { | ||
height, | ||
width, | ||
space, | ||
color, | ||
flex, | ||
flexDirection, | ||
flexWrap, | ||
display, | ||
alignSelf, | ||
alignItems, | ||
justifyContent, | ||
} from 'styled-system' | ||
|
||
export default styled.div` | ||
${height} | ||
${width} | ||
${space} | ||
${color} | ||
${flex} | ||
${flexDirection} | ||
${flexWrap} | ||
${display} | ||
${alignSelf} | ||
${alignItems} | ||
${justifyContent} | ||
` |
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,16 @@ | ||
import styled from 'styled-components' | ||
import Box from './Box' | ||
|
||
const onHover = ` | ||
&:hover { | ||
transform: translateY(-4px); | ||
cursor: pointer; | ||
} | ||
` | ||
|
||
export default styled(Box)` | ||
box-shadow: 0px -2px 18px 0px rgba(72, 89, 102, 0.25); | ||
border-radius: 4px; | ||
transition: all 0.15s ease; | ||
${({ onClick }) => onClick && onHover}; | ||
` |
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,45 @@ | ||
--- | ||
name: Card | ||
--- | ||
|
||
import { Playground, PropsTable } from 'docz' | ||
import Card from "../components/Card" | ||
import Text from "../components/Text" | ||
|
||
# Card | ||
<PropsTable of={Card} /> | ||
|
||
## Default | ||
<Playground> | ||
<Card p={3}> | ||
<Text textAlign="center" fontWeight="500">Hello world!</Text> | ||
</Card> | ||
</Playground> | ||
|
||
## Fixed | ||
<Playground> | ||
<Card | ||
width={200} | ||
height={200} | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
> | ||
<Text fontWeight="500">Hello world!</Text> | ||
</Card> | ||
</Playground> | ||
|
||
## Click action | ||
<Playground> | ||
<Card | ||
width={200} | ||
height={100} | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
onClick={() => alert('Action!')} | ||
> | ||
<Text fontWeight="500">Click me</Text> | ||
</Card> | ||
</Playground> | ||
|
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,7 @@ | ||
import styled from 'styled-components' | ||
import Box from './Box' | ||
|
||
export default styled(Box)` | ||
max-width: 64em; | ||
margin: 0 auto; | ||
` |
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,12 @@ | ||
import styled from 'styled-components' | ||
import { space, color, fontSize, fontWeight, textAlign } from 'styled-system' | ||
|
||
export default styled.p` | ||
${color} | ||
${space} | ||
${fontSize} | ||
${fontWeight} | ||
${textAlign} | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",Helvetica, Arial, sans-serif,"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | ||
` |
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 |
---|---|---|
@@ -1,17 +1,34 @@ | ||
import React, { Component } from 'react' | ||
|
||
import { Spring } from 'react-spring' | ||
import Layout from '../components/Layout' | ||
import Card from '../components/Card' | ||
import Text from '../components/Text' | ||
|
||
export default class App extends Component { | ||
static async getInitialProps({ query }) { | ||
return query | ||
} | ||
|
||
state = { | ||
hello: 'world', | ||
world: 'world', | ||
} | ||
|
||
render() { | ||
const { hello } = this.state | ||
const { world } = this.state | ||
|
||
return <div>{hello}</div> | ||
return ( | ||
<Layout p={3}> | ||
<Spring from={{ opacity: 0 }} to={{ opacity: 1 }}> | ||
{styles => ( | ||
<Card p={3} style={styles}> | ||
<Text textAlign="center" fontWeight="500"> | ||
Hello {world}! | ||
</Text> | ||
</Card> | ||
)} | ||
</Spring> | ||
</Layout> | ||
) | ||
} | ||
} |