Skip to content

Commit 646e1eb

Browse files
authored
Merge pull request #97 from WithTime12/feature/#92
[Feature] 2차 피드백 반영
2 parents 3e13ea9 + 949c8c8 commit 646e1eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+604
-399
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default [
3434
{
3535
rules: {
3636
'prettier/prettier': 'warn',
37+
'no-console': ['error', { allow: ['warn', 'error'] }],
3738
},
3839
},
3940
tsConfig,

src/App.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
import './App.css';
1+
import '@/App.css';
22

3+
import { useMemo } from 'react';
34
import { RouterProvider } from 'react-router-dom';
45

6+
import { DeviceTokenProvider } from '@/providers/deviceTokenProvider';
7+
import { alarmKeys } from '@/queryKey/queryKey';
58
import router from '@/routes/routes';
69

710
function App() {
8-
return <RouterProvider router={router} />;
11+
const refetchKeys = useMemo(() => [alarmKeys._def], []);
12+
return (
13+
<DeviceTokenProvider refetchKeys={refetchKeys}>
14+
<RouterProvider router={router} />
15+
</DeviceTokenProvider>
16+
);
917
}
1018

1119
export default App;

src/api/axiosInstance.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,26 @@ axiosInstance.interceptors.response.use(
3434
const refreshResponse = await refresh();
3535

3636
if (refreshResponse.code === '200') {
37-
console.log('refreshToken이 재발급 되었습니다');
3837
isRedirecting = false;
3938

4039
return axiosInstance(error.config);
4140
}
4241
} catch (errors) {
4342
if (axios.isAxiosError(errors)) {
44-
const refreshError = error as AxiosError<IRefreshResponse>;
43+
const refreshError = errors as AxiosError<IRefreshResponse>;
4544
if (refreshError.response?.data.message === 'The token is null.') {
46-
console.log('refreshToken이 없습니다. 로그인 페이지로 이동합니다.');
45+
console.error('refreshToken이 없습니다. 로그인 페이지로 이동합니다.');
46+
void logout();
4747
} else if (refreshError.response?.data.message === 'The token is invalid.') {
48-
console.log('refreshToken이 만료되었습니다. 로그인 페이지로 이동합니다.');
49-
logout();
48+
console.error('refreshToken이 만료되었습니다. 로그인 페이지로 이동합니다.');
49+
void logout();
5050
} else {
51-
if (refreshError.response?.data.message === 'Incorrect password.') {
52-
alert('Your email or password is incorrect.');
53-
} else {
54-
console.log('알 수 없는 오류가 발생했습니다', errors);
55-
logout();
56-
}
51+
console.error('알 수 없는 오류가 발생했습니다', errors);
52+
void logout();
5753
}
5854
} else {
59-
console.log('알 수 없는 오류가 발생했습니다', errors);
60-
logout();
55+
console.error('알 수 없는 오류가 발생했습니다', errors);
56+
void logout();
6157
}
6258

6359
return Promise.reject(errors);

src/components/auth/commonAuthInput.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { InputHTMLAttributes } from 'react';
22
import React from 'react';
33

4-
import formatInputNumber from '@/utils/formatPhoneNumber';
5-
64
import Button from '@/components/common/Button';
75

86
import AlertCircle from '@/assets/icons/alert-circle_Fill.svg?react';
@@ -58,21 +56,6 @@ const CommonAuthInput = React.forwardRef<HTMLInputElement, TCommonAuthInputProps
5856
className={`flex-1 relative flex bg-default-gray-100 rounded-[4px] max-h-[56px] min-w-0 h-[8vh] pl-[16px] text-default-gray-800 focus:outline-none focus:ring-0
5957
${error ? 'border-[2px] border-warning caret-warning' : `${validation ? 'border-primary-500 border-[2px] ' : 'border-default-gray-700 border-[1px]'}`}
6058
`}
61-
onChange={(e) => {
62-
const rawValue = e.target.value;
63-
const formatted = type === 'phoneNum' ? formatInputNumber(rawValue) : rawValue;
64-
65-
// 외부에서 넘긴 onChange 핸들러에 적용된 값 전달
66-
if (rest.onChange) {
67-
rest.onChange({
68-
...e,
69-
target: {
70-
...e.target,
71-
value: formatted,
72-
},
73-
});
74-
}
75-
}}
7659
{...rest}
7760
/>
7861
{short && <div className="flex px-[16px] py-[8px] text-default-gray-100 w-[80px]" />}
@@ -96,7 +79,7 @@ const CommonAuthInput = React.forwardRef<HTMLInputElement, TCommonAuthInputProps
9679
className={`hover:!cursor-default ${validation ? 'hover:!bg-primary-500 hover:!text-[#ffffff]' : 'hover:!bg-default-gray-400'}`}
9780
/>
9881
)}
99-
{error && <div className="absolute top-[62px] font-caption text-warning left-[16px] select-none">{errorMessage}</div>}
82+
{error && <div className="absolute top-[58px] font-caption text-warning left-[16px] select-none">{errorMessage}</div>}
10083
{error && <AlertCircle fill="#ff517c" className={`absolute ${button || short || validationState ? 'right-30' : ' right-3'}`} />}
10184
</div>
10285
);

src/components/common/PasswordEdit.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState } from 'react';
2+
import type { AxiosError } from 'axios';
23
import { z } from 'zod';
34

45
import { useAccount } from '@/hooks/auth/useAccount';
@@ -28,16 +29,7 @@ export default function PasswordEditSection() {
2829
setIsEditing(false);
2930
};
3031

31-
const { mutate: changePw, isPending } = useChangePassword({
32-
onSuccess: () => {
33-
alert('비밀번호가 변경되었습니다.');
34-
handleCancel();
35-
},
36-
onError: (err) => {
37-
const msg = (err as any)?.response?.data?.message ?? '비밀번호 변경에 실패했습니다.';
38-
alert(msg);
39-
},
40-
});
32+
const { mutate: changePw, isPending } = useChangePassword();
4133

4234
// 제출
4335
const handleSubmit = () => {
@@ -58,10 +50,22 @@ export default function PasswordEditSection() {
5850
if (Object.keys(nextErrors).length > 0) return;
5951

6052
// 제출
61-
changePw({
62-
currentPassword: currentPw,
63-
newPassword: newPw,
64-
});
53+
changePw(
54+
{
55+
currentPassword: currentPw,
56+
newPassword: newPw,
57+
},
58+
{
59+
onSuccess: () => {
60+
alert('비밀번호가 변경되었습니다.');
61+
handleCancel();
62+
},
63+
onError: (err: AxiosError) => {
64+
const msg = (err as any)?.response?.data?.message ?? '비밀번호 변경에 실패했습니다.';
65+
alert(msg);
66+
},
67+
},
68+
);
6569
};
6670

6771
// 공통 인풋 스타일

src/components/common/modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function Modal({ isOpen = true, title, children, onClose, positio
3333
<div className="font-heading2 text-default-gray-800">{title}</div>
3434
<GraySvgButton type="cancle" onClick={onClose} />
3535
</div>
36-
<div className="flex">{children}</div>
36+
<div className="flex px-[12px]">{children}</div>
3737
</div>
3838
</div>
3939
</div>

src/components/dateCourse/dateCourse.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function DateCourse({ defaultOpen = false }: { defaultOpen?: boolean }) {
2020
} else {
2121
setIsBookmarked(!isBookmarked);
2222
}
23-
// console.log('북마크 해제');
2423
};
2524

2625
useEffect(() => {

src/components/dateCourse/dateCourseSearchFilterOption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default function DateCourseSearchFilterOption({ options, type, value, onC
8888
mode="search"
8989
onSearchClick={handleSearch}
9090
placeholder="ex: 서울시 강남구"
91-
className="w-full"
91+
className="!w-full min-w-full"
9292
value={inputValue}
9393
onChange={handleInputChange}
9494
/>

src/components/home/dateRecommend.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function DateRecommend() {
9999
<div className="flex flex-col sm:px-[40px] px-[20px] py-[40px] justify-center h-full gap-[30px] sm:gap-[20px] w-full">
100100
{/* 상단 텍스트 */}
101101
<div className="flex items-center justify-between sm:flex-row flex-col">
102-
<div className="text-2xl font-bold whitespace-nowrap">이번 주 {forecastData?.result?.region?.regionName ?? '지역'} 데이트 추천</div>
102+
<div className="text-2xl font-bold break-keep text-center">이번 주 {forecastData?.result?.region?.regionName ?? '지역'} 데이트 추천</div>
103103
<button
104104
type="button"
105105
className="sm:mt-1 mt-4 text-sm text-black underline sm:self-center self-end"

src/components/modal/SettingModal.tsx

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import InfoSetting from '@/components/settingTab/InfoSetting';
88
import MembershipSetting from '@/components/settingTab/MembershipSetting';
99

1010
import Modal from '../common/modal';
11+
import MobileSettingTab from '../settingTab/mobileSettingTab';
1112

1213
import LogoutSvg from '@/assets/icons/Logout_Blank.svg?react';
1314

@@ -38,35 +39,36 @@ export default function SettingsModal({ onClose, defaultTab = '알람' }: ISetti
3839

3940
return (
4041
<Modal onClose={onClose} position="main" title="설정">
41-
{/* 좌측 탭 메뉴 */}
42-
<div className="w-[130px] sm:w-[170px] flex flex-col justify-between pr-4 sm:pr-6">
43-
<div className="flex flex-col space-y-3">
44-
{['알람', '멤버십', '정보'].map((tab) => (
45-
<button
46-
key={tab}
47-
onClick={() => setActiveTab(tab as '알람' | '멤버십' | '정보')}
48-
className={`w-full h-[35px] px-4 rounding-16 font-body1 text-left transition
42+
<div className="sm:flex-row flex-col flex min-w-[300px]">
43+
<div className="w-[130px] sm:w-[170px] hidden sm:flex flex-col justify-between pr-4 sm:pr-6">
44+
<div className="flex flex-col space-y-3">
45+
{['알람', '멤버십', '정보'].map((tab) => (
46+
<button
47+
key={tab}
48+
onClick={() => setActiveTab(tab as '알람' | '멤버십' | '정보')}
49+
className={`w-full h-[35px] px-4 rounding-16 font-body1 text-left transition
4950
${activeTab === tab ? 'bg-primary-500 text-white' : 'bg-default-gray-400 text-default-gray-700'}`}
50-
>
51-
{tab} 설정
52-
</button>
53-
))}
54-
</div>
55-
56-
<button
57-
onClick={handleLogout}
58-
disabled={logoutPending}
59-
className="font-body2 text-default-gray-800 cursor-pointer flex items-center space-x-2 mt-6 disabled:opacity-60"
60-
>
61-
<LogoutSvg className="w-4 h-4" fill="none" stroke="CurrentColor" />
62-
<span>{logoutPending ? '로그아웃 중...' : '로그아웃'}</span>
63-
</button>
64-
</div>
51+
>
52+
{tab} 설정
53+
</button>
54+
))}
55+
</div>
6556

66-
<div className="flex-1 pl-6 overflow-y-auto">
67-
{activeTab === '알람' && <AlarmSetting />}
68-
{activeTab === '멤버십' && <MembershipSetting />}
69-
{activeTab === '정보' && <InfoSetting />}
57+
<button
58+
onClick={handleLogout}
59+
disabled={logoutPending}
60+
className="font-body2 text-default-gray-800 cursor-pointer flex items-center space-x-2 mt-6 disabled:opacity-60"
61+
>
62+
<LogoutSvg className="w-4 h-4" fill="none" stroke="CurrentColor" />
63+
<span>{logoutPending ? '로그아웃 중...' : '로그아웃'}</span>
64+
</button>
65+
</div>
66+
<MobileSettingTab setActiveTab={setActiveTab} activeTab={activeTab} handleLogout={handleLogout} logoutPending={logoutPending} />
67+
<div className="flex-1 sm:pl-6 overflow-y-auto min-w-[300px]">
68+
{activeTab === '알람' && <AlarmSetting />}
69+
{activeTab === '멤버십' && <MembershipSetting />}
70+
{activeTab === '정보' && <InfoSetting />}
71+
</div>
7072
</div>
7173
</Modal>
7274
);

0 commit comments

Comments
 (0)