Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Modal Icon to Modal Component #410

Merged
merged 2 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};