Skip to content

Commit

Permalink
remove icon from Snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmoya committed Nov 2, 2016
1 parent ccb396f commit 736eeeb
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 24 deletions.
8 changes: 1 addition & 7 deletions components/snackbar/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import classnames from 'classnames';
import { themr } from 'react-css-themr';
import { SNACKBAR } from '../identifiers.js';
import ActivableRenderer from '../hoc/ActivableRenderer.js';
import FontIcon from '../font_icon/FontIcon.js';
import InjectOverlay from '../overlay/Overlay.js';
import InjectButton from '../button/Button.js';

Expand All @@ -14,10 +13,6 @@ const factory = (Overlay, Button) => {
active: PropTypes.bool,
children: PropTypes.node,
className: PropTypes.string,
icon: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element
]),
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element
Expand Down Expand Up @@ -53,15 +48,14 @@ const factory = (Overlay, Button) => {
}

render () {
const {action, active, children, icon, label, onClick, theme, type } = this.props;
const {action, active, children, label, onClick, theme, type } = this.props;
const className = classnames([theme.snackbar, theme[type]], {
[theme.active]: active
}, this.props.className);

return (
<Overlay invisible>
<div data-react-toolbox='snackbar' className={className}>
{icon ? <FontIcon value={icon} className={theme.icon} /> : null}
<span className={theme.label}>
{label}
{children}
Expand Down
8 changes: 0 additions & 8 deletions components/snackbar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ export interface SnackbarTheme {
* Added to the root element in case it's cancel type.
*/
cancel?: string;
/**
* Used for the icon element.
*/
icon?: string;
/**
* Used for the label element.
*/
Expand All @@ -46,10 +42,6 @@ interface SnackbarProps extends ReactToolbox.Props {
* @default true
*/
active?: boolean;
/**
* String key for an icon or Element which will be displayed in left side of the snackbar.
*/
icon?: React.ReactNode | string;
/**
* Text to display in the content. Required.
*/
Expand Down
3 changes: 0 additions & 3 deletions components/snackbar/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class SnackbarTest extends React.Component {
<Button label='Show Snackbar' raised onClick={this.handleClick} />
<Snackbar
action='Nice'
icon='question_answer'
label='A new developer started using React Toolbox'
onClick={this.handleSnackbarClick}
ref='snackbar'
Expand All @@ -43,7 +42,6 @@ This component can be styled by context providing a theme with the key `RTSnackb
| `active` | `Boolean` | `false` | If true, the snackbar will be active.|
| `children` | `String or Element` | `false` | Text or node to be displayed in the content as alternative to `label`.|
| `className` | `String` | `''` | Additional class name to provide custom styling.|
| `icon` | `String` or `Element` | | String key for an icon or Element which will be displayed in left side of the snackbar.|
| `label` | `String or Element` | | Text to display in the content.|
| `onClick` | `Function` | | Callback function that will be called when the button action is clicked.|
| `onTimeout` | `Function` | | Callback function when finish the set timeout.|
Expand All @@ -58,7 +56,6 @@ This component can be styled by context providing a theme with the key `RTSnackb
| `active` | Added to the root element when its active.|
| `button` | Used for the button inside the component.|
| `cancel` | Added to the root element in case it's cancel type.|
| `icon` | Used for the icon element.|
| `label` | Used for the label element.|
| `snackbar` | Used as the className for the root element of the component.|
| `warning` | Added to the root element in case it's warning type.|
4 changes: 0 additions & 4 deletions components/snackbar/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
}
}

.icon {
margin-right: $snackbar-vertical-offset;
}

.label {
flex-grow: 1;
font-size: $font-size-small;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class SnackbarTest extends React.Component {
<Snackbar
action='Dismiss'
active={this.state.active}
icon='question_answer'
label='Snackbar action cancel'
timeout={2000}
onClick={this.handleSnackbarClick}
Expand Down
1 change: 0 additions & 1 deletion spec/components/snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SnackbarTest extends React.Component {
<Snackbar
action='Hide'
active={this.state.active}
icon='question_answer'
timeout={2000}
onClick={this.handleSnackbarClick}
onTimeout={this.handleSnackbarTimeout}
Expand Down

0 comments on commit 736eeeb

Please sign in to comment.