Skip to content

Commit c38ddbe

Browse files
Merge pull request #95 from SOPT-36-NINEDOT/feat/#87/aiFailModal
[Feat]: AI 추천 실패 모달 구현
2 parents eaf99ef + 0f59fc7 commit c38ddbe

File tree

7 files changed

+111
-11
lines changed

7 files changed

+111
-11
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { style } from '@vanilla-extract/css';
2+
3+
import { colors } from '@/style/token/color.css';
4+
import { fonts } from '@/style/token/typography.css';
5+
6+
export const modalContainer = style({
7+
display: 'inline-flex',
8+
padding: '4rem',
9+
flexDirection: 'column',
10+
alignItems: 'center',
11+
borderRadius: '16px',
12+
background: colors.grey3,
13+
});
14+
15+
export const contentWrapper = style({
16+
width: '55.6rem',
17+
display: 'flex',
18+
flexDirection: 'column',
19+
});
20+
21+
export const iconWrapper = style({
22+
marginLeft: 'auto',
23+
});
24+
25+
export const closeIcon = style({
26+
width: '3.2rem',
27+
height: '3.2rem',
28+
cursor: 'pointer',
29+
});
30+
31+
export const textWrapper = style({
32+
display: 'flex',
33+
flexDirection: 'column',
34+
alignItems: 'center',
35+
gap: '1.6rem',
36+
});
37+
38+
export const title = style({
39+
color: colors.grey11,
40+
textAlign: 'center',
41+
...fonts.display02,
42+
});
43+
44+
export const description = style({
45+
color: colors.grey7,
46+
textAlign: 'center',
47+
...fonts.subtitle06,
48+
});
49+
50+
export const buttonWrapper = style({
51+
display: 'flex',
52+
justifyContent: 'center',
53+
alignItems: 'center',
54+
marginTop: '5rem',
55+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Meta, StoryObj } from '@storybook/react-vite';
2+
3+
import AiFailModal from './AiFailModal';
4+
5+
const meta: Meta<typeof AiFailModal> = {
6+
title: 'Common/AiFailModal',
7+
component: AiFailModal,
8+
tags: ['autodocs'],
9+
};
10+
11+
export default meta;
12+
type Story = StoryObj<typeof AiFailModal>;
13+
14+
export const Default: Story = {};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as styles from './AiFailModal.css';
2+
3+
import MandalButton from '@/common/component/Button/Button';
4+
import { IcModalDelete } from '@/assets/svg';
5+
6+
interface AiFailModalProps {
7+
onClose: () => void;
8+
}
9+
10+
const AiFailModal = ({ onClose }: AiFailModalProps) => {
11+
return (
12+
<div className={styles.modalContainer}>
13+
<div className={styles.contentWrapper}>
14+
<button type="button" className={styles.iconWrapper} onClick={onClose}>
15+
<IcModalDelete className={styles.closeIcon} />
16+
</button>
17+
<div className={styles.textWrapper}>
18+
<h2 className={styles.title}>AI 추천 실패</h2>
19+
<p className={styles.description}>다시 한 번 시도해주세요.</p>
20+
</div>
21+
<div className={styles.buttonWrapper}>
22+
<MandalButton text="다시 시도" />
23+
</div>
24+
</div>
25+
</div>
26+
);
27+
};
28+
29+
export default AiFailModal;

src/common/component/AiRecommendModal/AiRecommendModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react';
22

33
import * as styles from './AiRecommendModal.css';
4-
import MandalButton from '../MandalButton/MandalButton';
4+
import MandalButton from '../Button/Button';
55

66
import { IcModalDelete, IcCheckboxDefault, IcCheckboxChecked } from '@/assets/svg';
77

@@ -72,7 +72,7 @@ const AiRecommendModal = ({ onClose }: AiRecommendModalProps) => {
7272
})}
7373
</div>
7474
<div className={styles.buttonWrapper}>
75-
<MandalButton />
75+
<MandalButton text="내 만다라트에 넣기" />
7676
</div>
7777
</div>
7878
</div>
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as styles from './Button.css';
2+
3+
type MandalButtonProps = {
4+
text: string;
5+
};
6+
7+
const MandalButton = ({ text }: MandalButtonProps) => {
8+
return <button className={styles.buttonContainer}>{text}</button>;
9+
};
10+
11+
export default MandalButton;

src/common/component/MandalButton/MandalButton.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)