Skip to content

Commit

Permalink
Merge pull request #746 from amitamrutiya/export-modal
Browse files Browse the repository at this point in the history
Export modal style header and modal close button
  • Loading branch information
leecalcote authored Oct 3, 2024
2 parents 252ed53 + b2774ff commit d2b3808
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/custom/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface UseModalReturnI extends ModalProps {
isOpen: boolean;
}

const CloseBtn = styled(IconButton)`
export const CloseBtn = styled(IconButton)`
&& {
& svg {
fill: #fff;
Expand All @@ -54,7 +54,7 @@ const StyledDialog = styled(Dialog)`
}
`;

const StyledHeader = styled('div')(() => ({
export const ModalStyledHeader = styled('div')(() => ({
background: 'linear-gradient(90deg, #3B687B 0%, #507D90 100%)',
color: '#eee',
display: 'flex',
Expand Down Expand Up @@ -141,15 +141,15 @@ export const Modal: React.FC<ModalProps> = ({
{...props}
>
{title && (
<StyledHeader>
<ModalStyledHeader>
{headerIcon && headerIcon}
<Typography component={'div'} variant="h6">
{title}
</Typography>
<CloseBtn onClick={closeModal}>
<CloseIcon {...iconLarge} fill="#fff"></CloseIcon>
</CloseBtn>
</StyledHeader>
</ModalStyledHeader>
)}

{reactNode && reactNode}
Expand Down
2 changes: 2 additions & 0 deletions src/custom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ export {

//Custom Modal
export {
CloseBtn,
Modal,
ModalBody,
ModalButtonDanger,
ModalButtonPrimary,
ModalButtonSecondary,
ModalButtonTertiary,
ModalFooter,
ModalStyledHeader,
PrimaryActionButtons,
useModal
} from './Modal';
Expand Down

0 comments on commit d2b3808

Please sign in to comment.