Skip to content

Commit 736eeeb

Browse files
committed
remove icon from Snackbar
1 parent ccb396f commit 736eeeb

File tree

6 files changed

+1
-24
lines changed

6 files changed

+1
-24
lines changed

components/snackbar/Snackbar.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import classnames from 'classnames';
33
import { themr } from 'react-css-themr';
44
import { SNACKBAR } from '../identifiers.js';
55
import ActivableRenderer from '../hoc/ActivableRenderer.js';
6-
import FontIcon from '../font_icon/FontIcon.js';
76
import InjectOverlay from '../overlay/Overlay.js';
87
import InjectButton from '../button/Button.js';
98

@@ -14,10 +13,6 @@ const factory = (Overlay, Button) => {
1413
active: PropTypes.bool,
1514
children: PropTypes.node,
1615
className: PropTypes.string,
17-
icon: PropTypes.oneOfType([
18-
PropTypes.string,
19-
PropTypes.element
20-
]),
2116
label: PropTypes.oneOfType([
2217
PropTypes.string,
2318
PropTypes.element
@@ -53,15 +48,14 @@ const factory = (Overlay, Button) => {
5348
}
5449

5550
render () {
56-
const {action, active, children, icon, label, onClick, theme, type } = this.props;
51+
const {action, active, children, label, onClick, theme, type } = this.props;
5752
const className = classnames([theme.snackbar, theme[type]], {
5853
[theme.active]: active
5954
}, this.props.className);
6055

6156
return (
6257
<Overlay invisible>
6358
<div data-react-toolbox='snackbar' className={className}>
64-
{icon ? <FontIcon value={icon} className={theme.icon} /> : null}
6559
<span className={theme.label}>
6660
{label}
6761
{children}

components/snackbar/index.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export interface SnackbarTheme {
1818
* Added to the root element in case it's cancel type.
1919
*/
2020
cancel?: string;
21-
/**
22-
* Used for the icon element.
23-
*/
24-
icon?: string;
2521
/**
2622
* Used for the label element.
2723
*/
@@ -46,10 +42,6 @@ interface SnackbarProps extends ReactToolbox.Props {
4642
* @default true
4743
*/
4844
active?: boolean;
49-
/**
50-
* String key for an icon or Element which will be displayed in left side of the snackbar.
51-
*/
52-
icon?: React.ReactNode | string;
5345
/**
5446
* Text to display in the content. Required.
5547
*/

components/snackbar/readme.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class SnackbarTest extends React.Component {
2121
<Button label='Show Snackbar' raised onClick={this.handleClick} />
2222
<Snackbar
2323
action='Nice'
24-
icon='question_answer'
2524
label='A new developer started using React Toolbox'
2625
onClick={this.handleSnackbarClick}
2726
ref='snackbar'
@@ -43,7 +42,6 @@ This component can be styled by context providing a theme with the key `RTSnackb
4342
| `active` | `Boolean` | `false` | If true, the snackbar will be active.|
4443
| `children` | `String or Element` | `false` | Text or node to be displayed in the content as alternative to `label`.|
4544
| `className` | `String` | `''` | Additional class name to provide custom styling.|
46-
| `icon` | `String` or `Element` | | String key for an icon or Element which will be displayed in left side of the snackbar.|
4745
| `label` | `String or Element` | | Text to display in the content.|
4846
| `onClick` | `Function` | | Callback function that will be called when the button action is clicked.|
4947
| `onTimeout` | `Function` | | Callback function when finish the set timeout.|
@@ -58,7 +56,6 @@ This component can be styled by context providing a theme with the key `RTSnackb
5856
| `active` | Added to the root element when its active.|
5957
| `button` | Used for the button inside the component.|
6058
| `cancel` | Added to the root element in case it's cancel type.|
61-
| `icon` | Used for the icon element.|
6259
| `label` | Used for the label element.|
6360
| `snackbar` | Used as the className for the root element of the component.|
6461
| `warning` | Added to the root element in case it's warning type.|

components/snackbar/theme.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
}
3636
}
3737

38-
.icon {
39-
margin-right: $snackbar-vertical-offset;
40-
}
41-
4238
.label {
4339
flex-grow: 1;
4440
font-size: $font-size-small;

docs/app/components/layout/main/modules/examples/snackbar_example_1.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class SnackbarTest extends React.Component {
2424
<Snackbar
2525
action='Dismiss'
2626
active={this.state.active}
27-
icon='question_answer'
2827
label='Snackbar action cancel'
2928
timeout={2000}
3029
onClick={this.handleSnackbarClick}

spec/components/snackbar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class SnackbarTest extends React.Component {
2828
<Snackbar
2929
action='Hide'
3030
active={this.state.active}
31-
icon='question_answer'
3231
timeout={2000}
3332
onClick={this.handleSnackbarClick}
3433
onTimeout={this.handleSnackbarTimeout}

0 commit comments

Comments
 (0)