Skip to content

Commit

Permalink
Updates to CancelButton docs and story
Browse files Browse the repository at this point in the history
  • Loading branch information
cblissg committed Sep 27, 2023
1 parent f65a414 commit 349bb63
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
Binary file added packages/.DS_Store
Binary file not shown.
6 changes: 5 additions & 1 deletion packages/semantic-ui/src/components/CancelButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import i18n from '../i18n/i18n';

type Props = {
disabled: boolean,
onClick: () => void
onClick: () => void,
};

/**
* A simple Cancel button component that accepts an onClick method.
*/

const CancelButton = (props: Props) => (
<Button
basic
Expand Down
26 changes: 26 additions & 0 deletions packages/storybook/src/semantic-ui/CancelButton.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// @flow

import React from 'react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean } from '@storybook/addon-knobs';
import CancelButton from '../../../semantic-ui/src/components/CancelButton';

export default {
title: 'Components/Semantic UI/CancelButton',
decorators: [withKnobs],
component: CancelButton,
};

export const Default = () => (
<CancelButton
disabled={boolean('Disabled', false)}
onClick={action('click')}
/>
);

export const Disabled = () => (
<CancelButton
disabled={boolean('Disabled', true)}
onClick={action('click')}
/>
);

0 comments on commit 349bb63

Please sign in to comment.