Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Added our new Toast component to the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
driesd committed Jun 13, 2017
1 parent 0b7fe52 commit 8675cfa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Dialog from './components/dialog';
import PopoverVertical from './components/popoverVertical';
import PopoverHorizontal from './components/popoverHorizontal';
import LoadingMolecule from './components/loadingMolecule';
import Toast from './components/toast';

const Root = () => (
<div>
Expand All @@ -15,6 +16,7 @@ const Root = () => (
<PopoverHorizontal />
<Menu />
<Dialog />
<Toast />
<LoadingMolecule />
</div>
);
Expand Down
39 changes: 39 additions & 0 deletions spec/components/toast.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import Button from '../../components/button';
import Toast from '../../components/toast';

class ToastTest extends React.Component {
handleSnackbarClick = () => {
this.setState({ active: false });
};

handleSnackbarTimeout = () => {
this.setState({ active: false });
};

handleClick = () => {
this.setState({ active: true });
};

state = {
active: false,
};

render () {
return (
<section>
<h2>Toast</h2>
<Button label="Make a toast" primary onClick={this.handleClick} />
<Toast
active={this.state.active}
label="Toast is ready!"
timeout={3000}
onClick={this.handleSnackbarClick}
onTimeout={this.handleSnackbarTimeout}
/>
</section>
);
}
}

export default ToastTest;

0 comments on commit 8675cfa

Please sign in to comment.