Skip to content

Commit

Permalink
feat: Add Modal Icon to Modal Component (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Fabris committed Mar 22, 2021
1 parent 96bb6ae commit c6a8b3e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/fuselage/src/components/Modal/Modal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,20 @@ export const _Modal = () => (
</Modal.Footer>
</Modal>
);

export const WithIcon = () => (
<Modal>
<Modal.Header>
<Modal.Icon name='info' />
<Modal.Title>Modal Header</Modal.Title>
<Modal.Close />
</Modal.Header>
<Modal.Content>Modal Body</Modal.Content>
<Modal.Footer>
<ButtonGroup align='end'>
<Button>Cancel</Button>
<Button primary>Submit</Button>
</ButtonGroup>
</Modal.Footer>
</Modal>
);
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/Modal/ModalIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

import { Icon } from '../Icon';

export const ModalIcon = ({ size = 'x24', ...props }) => (
<Icon {...props} size={size} />
);
3 changes: 3 additions & 0 deletions packages/fuselage/src/components/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ModalClose } from './ModalClose';
import { ModalContent } from './ModalContent';
import { ModalFooter } from './ModalFooter';
import { ModalHeader } from './ModalHeader';
import { ModalIcon } from './ModalIcon';
import { ModalThumb } from './ModalThumb';
import { ModalTitle } from './ModalTitle';

Expand All @@ -14,6 +15,7 @@ Modal.Footer = ModalFooter;
Modal.Header = ModalHeader;
Modal.Thumb = ModalThumb;
Modal.Title = ModalTitle;
Modal.Icon = ModalIcon;

export {
Modal,
Expand All @@ -24,4 +26,5 @@ export {
ModalHeader,
ModalThumb,
ModalTitle,
ModalIcon,
};

0 comments on commit c6a8b3e

Please sign in to comment.