Skip to content

Commit

Permalink
feat: (#713) 이미지 모달 초기 셋팅
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilpop8663 committed Oct 5, 2023
1 parent 4d0e843 commit 823bf6f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/src/components/common/Image/Image.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Meta, StoryObj } from '@storybook/react';

import Image from '.';

const meta: Meta<typeof Image> = {
component: Image,
};

export default meta;
type Story = StoryObj<typeof Image>;

export const Category: Story = {
render: () => (
<Image src="https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FE2Q2S%2FbtswcHwhtdY%2FCKuiznZAZeKA72CyK0c8Y0%2Fimg.png" />
),
};
17 changes: 17 additions & 0 deletions frontend/src/components/common/Image/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Modal from '../Modal';

import * as S from './style';

interface ImageModalProps {
src: string;
}

export default function Image({ src }: ImageModalProps) {
return (
<Modal size="lg" onModalClose={() => {}}>
<div>
<S.Image src={src}></S.Image>;
</div>
</Modal>
);
}
6 changes: 6 additions & 0 deletions frontend/src/components/common/Image/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { styled } from 'styled-components';

export const Image = styled.img`
width: 100%;
height: 100%;
`;

0 comments on commit 823bf6f

Please sign in to comment.