This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
108dc4c
commit d07667b
Showing
4 changed files
with
54 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,35 @@ | ||
/** | ||
* @playgrodd | ||
* @name: Alert | ||
*/ | ||
import React, { Fragment } from 'react' | ||
import { doc } from 'playgrodd' | ||
import styled from 'react-emotion' | ||
import t from 'prop-types' | ||
|
||
import React from 'react' | ||
const kinds = { | ||
info: '#5352ED', | ||
positive: '#2ED573', | ||
negative: '#FF4757', | ||
warning: '#FFA502', | ||
} | ||
|
||
export const doc = () => <div>hello</div> | ||
const Alert = styled('div')` | ||
padding: 5px 7px; | ||
background: white; | ||
border-radius: 3px; | ||
color: white; | ||
background: ${({ kind = 'info' }) => kinds[kind]}; | ||
` | ||
|
||
Alert.propTypes = { | ||
color: t.oneOf(['info', 'positive', 'negative', 'warning']), | ||
} | ||
|
||
doc('Alert') | ||
.description('This component is used to show alerts') | ||
.section('Basic usage', () => <Alert>Some message</Alert>) | ||
.section('Using different kinds', () => ( | ||
<Fragment> | ||
<Alert>Some message</Alert> | ||
<Alert kind="positive">Some message</Alert> | ||
<Alert kind="negative">Some message</Alert> | ||
<Alert kind="warning">Some message</Alert> | ||
</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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
/** | ||
* @playgrodd | ||
* @name: Button | ||
*/ | ||
|
||
import React from 'react' | ||
import { doc } from 'playgrodd' | ||
|
||
const Button = ({ children }) => <button>{children}</button> | ||
|
||
export const doc = () => <button>click me</button> | ||
doc('Button').section(() => <Button>Click me</Button>) |