Skip to content

Commit

Permalink
feat(Fab): add cssOnly support
Browse files Browse the repository at this point in the history
  • Loading branch information
James Friedman committed Dec 18, 2017
1 parent 71a82b2 commit 951391e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Base/withRipple.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const withRipple = (
static displayName = `withRipple(${Component.displayName || 'Unknown'})`;
render() {
const { ripple, ...rest } = this.props;
if (ripple) {
if (ripple && !rest.cssOnly) {
return (
<Ripple>
<Component {...rest} />
Expand Down
24 changes: 15 additions & 9 deletions src/Fab/fab.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import { Fab } from './';

// storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);

storiesOf('Buttons', module).add('Fab', () => (
<Fab
mini={boolean('mini', false)}
ripple={boolean('ripple', true)}
onClick={action('clicked')}
>
favorite
</Fab>
));
storiesOf('Buttons', module)
.add('Fab', () => (
<Fab
mini={boolean('mini', false)}
ripple={boolean('ripple', true)}
onClick={action('clicked')}
>
favorite
</Fab>
))
.add('cssOnly Fab', () => (
<Fab cssOnly mini={boolean('mini', false)} onClick={action('clicked')}>
favorite
</Fab>
));
7 changes: 5 additions & 2 deletions src/Fab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import type { RMWCProviderOptionsT } from '../Provider';

export type FabRootPropsT = {
/** Make the Fab smaller. */
mini?: boolean
mini?: boolean,
/** cssOnly Fab. */
cssOnly?: boolean
} & SimpleTagPropsT &
WithRipplePropsT;

Expand All @@ -26,9 +28,10 @@ export const FabRoot = withRipple(
}
],
defaultProps: {
cssOnly: false,
mini: false
},
consumeProps: ['mini']
consumeProps: ['mini', 'cssOnly']
})
);

Expand Down

0 comments on commit 951391e

Please sign in to comment.