Skip to content

Commit 25a664f

Browse files
authored
Merge pull request #153 from codeit-sprint-part3-6team/#140_할-일-생성-모달-이슈-수정
#140 할 일 생성 모달 이슈 수정
2 parents c842588 + a718b47 commit 25a664f

File tree

23 files changed

+136
-30
lines changed

23 files changed

+136
-30
lines changed

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"react-dom": "^18.3.1",
2828
"react-redux": "^9.2.0",
2929
"react-router-dom": "^7.0.2",
30+
"react-toastify": "^11.0.2",
3031
"redux": "^5.0.1"
3132
},
3233
"devDependencies": {

src/components/common/input/info-input/DeadlineInput.module.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,26 @@
77
font-size: 18px;
88
line-height: 26px;
99
color: var(--black-medium);
10-
margin-bottom: 8px;
1110

1211
@media screen and (max-width: 743px) {
1312
font-size: 16px;
1413
line-height: 24px;
1514
}
1615
}
16+
17+
.topic-box {
18+
display: flex;
19+
align-items: center;
20+
gap: 2px;
21+
margin-bottom: 8px;
22+
}
23+
24+
.require {
25+
font-weight: 500;
26+
font-size: 16px;
27+
color: var(--violet);
28+
29+
@media screen and (max-width: 743px) {
30+
font-size: 14px;
31+
}
32+
}

src/components/common/input/info-input/DeadlineInput.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export default function DeadlineInput({
7878
initialDate,
7979
}: DeadlineInputProps): JSX.Element {
8080
const [selectedDate, setSelectedDate] = useState<Date | null>(null);
81+
const [open, setOpen] = useState(false);
8182

8283
useEffect(() => {
8384
if (initialDate) {
@@ -94,16 +95,25 @@ export default function DeadlineInput({
9495
return (
9596
<ThemeProvider theme={globalTheme}>
9697
<section className={styles.container}>
97-
<p className={styles.title}>마감일</p>
98+
<div className={styles['topic-box']}>
99+
<p className={styles.title}>마감일</p>
100+
<p className={styles.require}>*</p>
101+
</div>
98102
<LocalizationProvider dateAdapter={AdapterDateFns} adapterLocale={ko}>
99103
<DateTimePicker
104+
open={open}
105+
onOpen={() => setOpen(true)}
106+
onClose={() => setOpen(false)}
100107
value={selectedDate}
101108
onChange={handleChange}
102-
slots={{ textField: StyledTextField }}
109+
slots={{
110+
textField: StyledTextField,
111+
}}
103112
slotProps={{
104113
textField: {
105114
fullWidth: true,
106115
placeholder: '날짜를 입력해 주세요',
116+
onClick: () => setOpen((prev) => !prev),
107117
},
108118
}}
109119
/>

src/components/common/modal/detail-cards/DetailCardModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import deleteCard from '@/lib/dashboard/deleteCard';
1313
import AuthorSection from './AuthorSection';
1414
import ChipSection from './ChipSection';
1515
import CommentSection from './CommentSection';
16+
import { toast } from 'react-toastify';
1617

1718
interface DetailCardModalProps {
1819
title: string;
@@ -41,7 +42,7 @@ function DetailCardModal({
4142
const handleCardDelete = async () => {
4243
try {
4344
await deleteCard(cardId);
44-
alert('카드가 삭제되었습니다.');
45+
toast.success('카드가 삭제되었습니다.');
4546
setColumnData((prev) => ({
4647
...prev,
4748
cards: prev.cards.filter((columnCard) => columnCard.id !== cardId), // 삭제된 카드 제외
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import styles from './OverlayContainer.module.css';
22

3-
function OverlayContainer({ children }) {
4-
return <div className={styles['overlay-container']}>{children}</div>;
3+
interface OverlayContainerProps {
4+
children: React.ReactNode;
5+
onClose?: () => void;
6+
}
7+
8+
function OverlayContainer({ children, onClose }: OverlayContainerProps) {
9+
return (
10+
<div className={styles['overlay-container']} onClick={onClose}>
11+
{children}
12+
</div>
13+
);
514
}
615

716
export default OverlayContainer;

src/components/common/navbar/Navbar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Dropdown from '../dropdown/Dropdown';
1111
import { getDashboard, getMember } from '@/lib/navbar/getNavbar';
1212
import postInvite from '@/lib/invite/postInvite';
1313
import AuthModal from '../modal/auth/AuthModal';
14+
import { toast } from 'react-toastify';
1415

1516
const INITIAL_VALUES = {
1617
email: '',
@@ -59,7 +60,7 @@ function Navbar() {
5960
// 초대 요청을 보내고 alert
6061
useEffect(() => {
6162
if (!isModalOpen && alertMessage) {
62-
alert(alertMessage);
63+
toast.success(alertMessage);
6364
setAlertMessage(null);
6465
}
6566
}, [isModalOpen, alertMessage]);

src/components/common/sidebar/Sidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import PlusBtn from 'public/ic/ic_plus.svg';
1212
import CrownIcon from 'public/ic/ic_crown.svg';
1313
import OverlayContainer from '@/components/common/modal/overlay-container/OverlayContainer';
1414
import postDashboards from '@/lib/mydashboard/postDashboard';
15+
import { toast } from 'react-toastify';
1516
import CDSButton from '../button/CDSButton';
1617

1718
export default function Sidebar() {
@@ -53,7 +54,7 @@ export default function Sidebar() {
5354

5455
const handleNewDashboard = async () => {
5556
if (!newDashboardName.trim()) {
56-
alert('대시보드 이름을 입력해주세요.');
57+
toast.error('대시보드 이름을 입력해주세요.');
5758
return;
5859
}
5960

src/components/dashboard/column/Column.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import CreateCard from '@/components/product/dashboard/create-card/CreateCard';
1515
import { useDispatch, useSelector } from 'react-redux';
1616
import { toggleState } from '@/redux/renderSlice';
1717
import { RootState } from '@/redux/store';
18+
import { toast } from 'react-toastify';
1819
import SkeletonCard from '@/components/dashboard/card/SkeletonCard';
1920

2021
interface ColumnProp {
@@ -71,7 +72,7 @@ function Column({
7172
closeEditModal();
7273
setEditedTitle(columnTitle);
7374
} catch (error) {
74-
alert(`컬럼 삭제 에러: ${error}`);
75+
toast.error(`컬럼 삭제 중 오류가 발생했습니다: ${error}`);
7576
}
7677
};
7778

@@ -90,7 +91,7 @@ function Column({
9091

9192
closeEditModal();
9293
} catch (error) {
93-
alert(error.message || '컬럼 제목 수정 중 오류가 발생했습니다.');
94+
toast.error(error.message || '컬럼 제목 수정 중 오류가 발생했습니다.');
9495
}
9596
};
9697

src/components/product/auth/SignupForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
nicknameValidation,
1818
passwordCheckValidation,
1919
} from '@/utils/authValidation';
20+
import { toast } from 'react-toastify';
2021

2122
const INITIAL_VALUES = {
2223
email: '',
@@ -84,7 +85,7 @@ function SignupForm() {
8485
user: response.user,
8586
}),
8687
);
87-
alert(`${values.nickname}님 가입이 완료되었습니다.`);
88+
toast.success(`${values.nickname}님 가입이 완료되었습니다.`);
8889
router.push('/mydashboard');
8990
} catch (error) {
9091
setResponseMessage(error.message);

0 commit comments

Comments
 (0)