Skip to content

Commit

Permalink
πŸ’„ design: νŽΈμ§€ μž‘μ„± λͺ¨λ‹¬ μŠ€ν† λ¦¬μ— 빈 μ˜μ—­ ν΄λ¦­μ‹œ λ‹«νžˆλ„λ‘ μž‘μ—…
Browse files Browse the repository at this point in the history
  • Loading branch information
bbearcookie committed Jan 26, 2024
1 parent 18dbae1 commit aba4f52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/Modal/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment } from 'react';
import { Fragment, useRef } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { css } from '@emotion/react';
import useModal from '@/hooks/useModal';
Expand Down Expand Up @@ -100,6 +100,7 @@ export const νŽΈμ§€_μž‘μ„±_λͺ¨λ‹¬: Story = {
render: () => {
const ModalTestPage = () => {
const modal = useModal();
const backgroundRef = useRef<HTMLDivElement>(null);
const { open, close } = modal;

return (
Expand All @@ -117,7 +118,11 @@ export const νŽΈμ§€_μž‘μ„±_λͺ¨λ‹¬: Story = {
<Siren />
</IconButton>
</div>
<section css={styles.mainSection}>
<section
css={styles.mainSection}
ref={backgroundRef}
onClick={(e) => e.target === backgroundRef.current && close()}
>
<div css={styles.card}>
<h2>
<span css={styles.from}>From.</span>
Expand Down

0 comments on commit aba4f52

Please sign in to comment.