Skip to content

Commit

Permalink
🪟 🧹 Clean up modal and onboarding video components (#16466)
Browse files Browse the repository at this point in the history
* remove unneeded closeOnBackground property

* rename variable for clarity

* here too
  • Loading branch information
teallarson authored Sep 13, 2022
1 parent faa0640 commit ff29da4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions airbyte-webapp/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import styles from "./Modal.module.scss";
export interface ModalProps {
title?: string | React.ReactNode;
onClose?: () => void;
clear?: boolean;
closeOnBackground?: boolean;
cardless?: boolean;
size?: "sm" | "md" | "lg" | "xl";
testId?: string;
}
Expand All @@ -22,7 +21,7 @@ const cardStyleBySize = {
xl: styles.xl,
};

const Modal: React.FC<ModalProps> = ({ children, title, size, onClose, clear, testId }) => {
const Modal: React.FC<ModalProps> = ({ children, title, size, onClose, cardless, testId }) => {
const [isOpen, setIsOpen] = useState(true);

const onModalClose = () => {
Expand All @@ -35,7 +34,7 @@ const Modal: React.FC<ModalProps> = ({ children, title, size, onClose, clear, te
<div className={styles.backdrop} />
<div className={styles.modalContainer}>
<Dialog.Panel className={styles.modalPanel}>
{clear ? (
{cardless ? (
children
) : (
<ContentCard title={title} className={classNames(styles.card, size ? cardStyleBySize[size] : undefined)}>
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/components/Modal/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
} as ComponentMeta<typeof Modal>;

const Template: ComponentStory<typeof Modal> = (args) => {
if (args.clear) {
if (args.cardless) {
return <Modal {...args} />;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CloseButton = styled(Button)`

const ShowVideo: React.FC<ShowVideoProps> = ({ videoId, onClose }) => {
return (
<Modal onClose={onClose} clear closeOnBackground>
<Modal onClose={onClose} cardless>
<CloseButton onClick={onClose} iconOnly>
<FontAwesomeIcon icon={faTimes} />
</CloseButton>
Expand Down

0 comments on commit ff29da4

Please sign in to comment.