Skip to content

Commit

Permalink
feat: 리뷰 사항 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
miro-ring committed Jan 18, 2024
1 parent 6bb8727 commit 222b1f0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
16 changes: 12 additions & 4 deletions src/components/Dialog/Dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export const MediumFolder: Story = {
<Dialog.Button onClick={() => {}}>폴더 이름1</Dialog.Button>
<Dialog.Button onClick={() => {}}>폴더 이름2</Dialog.Button>
<Dialog.Button onClick={() => {}}>
<Icon className={styles.addIcon} icon="add" />
<div className={styles.icon}>
<Icon icon="add" width={20} height={20} />
</div>
<span className={styles.iconMediumText}>새 폴더 만들기</span>
</Dialog.Button>
</Dialog>
Expand All @@ -50,16 +52,22 @@ export const MediumProfile: Story = {
<>
<Dialog type="medium">
<Dialog.Title>
<Icon className={styles.profileIcon} icon="profileDialog" />
<div className={styles.profileIcon}>
<Icon icon="profileDialog" />
</div>
<div className={styles.circle} />
<span className={styles.iconTitleText}>바로가나다라마바님</span>
</Dialog.Title>
<Dialog.Button onClick={() => {}}>
<Icon className={styles.addIcon} icon="setting" />
<div className={styles.icon}>
<Icon icon="setting" width={20} height={20} />
</div>
<span className={styles.iconRegularText}>계정 설정</span>
</Dialog.Button>
<Dialog.Button onClick={() => {}}>
<Icon className={styles.addIcon} icon="logout" />
<div className={styles.icon}>
<Icon icon="logout" width={20} height={20} />
</div>
<span className={styles.iconRegularText}>로그아웃</span>
</Dialog.Button>
</Dialog>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { createContext, type PropsWithChildren } from 'react';
import { type RecipeVariants } from '@vanilla-extract/recipes';

import DialogButton from '@components/Dialog/components/DialogButton';
import DialogTitle from '@components/Dialog/components/DialogTitle';
import * as styles from '@components/Dialog/style.css';

interface DialogContextProps {
type?: 'small' | 'medium';
type: 'small' | 'medium';
}

type DialogRootProps = RecipeVariants<typeof styles.dialogRoot> &
PropsWithChildren<unknown>;
interface DialogRootProps extends PropsWithChildren {
type: 'small' | 'medium';
}

export const DialogContext = createContext<DialogContextProps | null>(null);

Expand Down
3 changes: 2 additions & 1 deletion src/components/Dialog/style.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ export const iconRegularText = style([
},
]);

export const addIcon = style({
export const icon = style({
position: 'absolute',
marginTop: '2px',
});

export const circle = style({
Expand Down
18 changes: 2 additions & 16 deletions src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@ import { iconFactory, type Icons } from '../../constants/icon';

interface IconProps {
icon: Icons;
className?: string;
color?: string;
width?: number;
height?: number;
}

const Icon = ({
icon,
className,
color,
width = 24,
height = 24,
}: IconProps) => {
const Icon = ({ icon, color, width = 24, height = 24 }: IconProps) => {
const SvgIcon = iconFactory[icon];

return (
<SvgIcon
className={className}
color={color}
width={width}
height={height}
/>
);
return <SvgIcon color={color} width={width} height={height} />;
};

export default Icon;

0 comments on commit 222b1f0

Please sign in to comment.