@daeryun/dr_components 0.6.56 → 0.6.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/PageTitleBox/PageTitleBox.jsx +1 -1
- package/dist/components/PageTitleBox/PageTitleBox.tsx +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/page/Login/LoginComp/SignContainer.jsx +26 -42
- package/dist/components/page/Login/LoginComp/SignContainer.tsx +26 -44
- package/dist/components/page/Login/Personal.jsx +32 -33
- package/dist/components/page/Login/Personal.tsx +28 -30
- package/dist/components/page/Login/_api/optionalTermAgree.d.ts +0 -1
- package/dist/components/page/Login/_api/optionalTermAgree.js +1 -1
- package/dist/components/page/Login/_api/optionalTermAgree.ts +2 -6
- package/dist/styles/globals.css +282 -278
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ import ConfirmModal from './LoginComp/Modal/ConfirmModal';
|
|
|
30
30
|
import MyPageOptionalCheckBox from './LoginComp/Update/MyPageOptionalCheckBox';
|
|
31
31
|
import { optionalTermAgree } from './_api/optionalTermAgree';
|
|
32
32
|
const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] max-lg:py-[112px] max-sm:mt-[28px] max-sm:py-[100px] `, resetUser, setUser }) => {
|
|
33
|
-
var _a
|
|
33
|
+
var _a;
|
|
34
34
|
const SESSION_KEY = process.env.NEXT_PUBLIC_USER_SESSION_STORAGE_KEY || 'loginUser';
|
|
35
35
|
const router = useRouter();
|
|
36
36
|
const imagePath = process.env.NEXT_PUBLIC_S3_URL + '';
|
|
@@ -73,21 +73,21 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
|
|
|
73
73
|
key: ''
|
|
74
74
|
});
|
|
75
75
|
const [optionalTermItems, setOptionalTermItems] = useState([
|
|
76
|
+
// {
|
|
77
|
+
// title: '사건관련 알림 수신 동의 (선택)',
|
|
78
|
+
// checked: false,
|
|
79
|
+
// isContent: true,
|
|
80
|
+
// cautionTitle: '*사건관련 알림을 수신할 채널을 선택해 주세요.',
|
|
81
|
+
// name: 'optionalMain',
|
|
82
|
+
// alarmTypeList: [
|
|
83
|
+
// { title: '푸시알림', name: 'optionalSelect', checked: false, value: 1 },
|
|
84
|
+
// { title: '카카오알림톡', name: 'optionalSelect', checked: false, value: 2 },
|
|
85
|
+
// { title: 'SMS', name: 'optionalSelect', checked: false, value: 4 },
|
|
86
|
+
// { title: '이메일', name: 'optionalSelect', checked: false, value: 8 }
|
|
87
|
+
// ]
|
|
88
|
+
// },
|
|
76
89
|
{
|
|
77
|
-
title: '
|
|
78
|
-
checked: false,
|
|
79
|
-
isContent: true,
|
|
80
|
-
cautionTitle: '*사건관련 알림을 수신할 채널을 선택해 주세요.',
|
|
81
|
-
name: 'optionalMain',
|
|
82
|
-
alarmTypeList: [
|
|
83
|
-
{ title: '푸시알림', name: 'optionalSelect', checked: false, value: 1 },
|
|
84
|
-
{ title: '카카오알림톡', name: 'optionalSelect', checked: false, value: 2 },
|
|
85
|
-
{ title: 'SMS', name: 'optionalSelect', checked: false, value: 4 },
|
|
86
|
-
{ title: '이메일', name: 'optionalSelect', checked: false, value: 8 }
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
title: '마케팅 정보 수신 동의 (선택)',
|
|
90
|
+
title: '광고성 정보 및 마케팅 정보 수신 동의 (선택)',
|
|
91
91
|
checked: false,
|
|
92
92
|
isContent: true,
|
|
93
93
|
cautionTitle: '*마케팅 정보를 수신할 채널을 선택해 주세요.',
|
|
@@ -161,12 +161,12 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
|
|
|
161
161
|
// 이름이 바꼈거나 , 휴대전화 인증을 다시 완료했거나 , 약관 총합 값이 바꼈거나
|
|
162
162
|
const isAll = ((userData === null || userData === void 0 ? void 0 : userData.data.name) !== (userObj === null || userObj === void 0 ? void 0 : userObj.name) && (userValidObj === null || userValidObj === void 0 ? void 0 : userValidObj.nameValid)) ||
|
|
163
163
|
userValidObj.codeValid ||
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
((
|
|
169
|
-
optionalTermItems[
|
|
164
|
+
// userAgree?.data?.alert_agree !==
|
|
165
|
+
// optionalTermItems[0].alarmTypeList
|
|
166
|
+
// .filter(item => item.checked)
|
|
167
|
+
// .reduce((sum, item) => sum + item.value, 0) ||
|
|
168
|
+
((_a = userAgree === null || userAgree === void 0 ? void 0 : userAgree.data) === null || _a === void 0 ? void 0 : _a.marketing_agree) !==
|
|
169
|
+
optionalTermItems[0].alarmTypeList.filter(item => item.checked).reduce((sum, item) => sum + item.value, 0);
|
|
170
170
|
const updateOptionalTermItems = (alertAgree, marketingAgree) => {
|
|
171
171
|
setOptionalTermItems(prevItems => prevItems.map((item, index) => {
|
|
172
172
|
// alertAgree는 첫 번째 항목, marketingAgree는 두 번째 항목을 업데이트
|
|
@@ -343,14 +343,13 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
|
|
|
343
343
|
}
|
|
344
344
|
const nameCheck = userData.data.name !== userObj.name && userValidObj.nameValid;
|
|
345
345
|
const phoneCheck = userValidObj.codeValid;
|
|
346
|
-
const termCheck =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
.reduce((sum, item) => sum + item.value, 0);
|
|
346
|
+
const termCheck =
|
|
347
|
+
// userAgree.data.alert_agree !==
|
|
348
|
+
// optionalTermItems[0].alarmTypeList
|
|
349
|
+
// .filter(item => item.checked)
|
|
350
|
+
// .reduce((sum, item) => sum + item.value, 0) ||
|
|
351
|
+
userAgree.data.marketing_agree !==
|
|
352
|
+
optionalTermItems[0].alarmTypeList.filter(item => item.checked).reduce((sum, item) => sum + item.value, 0);
|
|
354
353
|
let result = true;
|
|
355
354
|
if (nameCheck || phoneCheck) {
|
|
356
355
|
result = yield updateUserInfo({
|
|
@@ -361,10 +360,10 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
|
|
|
361
360
|
if (termCheck) {
|
|
362
361
|
result = yield optionalTermAgree({
|
|
363
362
|
bodyData: {
|
|
364
|
-
alert_agree: optionalTermItems[0].alarmTypeList
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
marketing_agree: optionalTermItems[
|
|
363
|
+
// alert_agree: optionalTermItems[0].alarmTypeList
|
|
364
|
+
// .filter(item => item.checked)
|
|
365
|
+
// .reduce((sum, item) => sum + item.value, 0), // checked된 항목들의 value 합산
|
|
366
|
+
marketing_agree: optionalTermItems[0].alarmTypeList
|
|
368
367
|
.filter(item => item.checked)
|
|
369
368
|
.reduce((sum, item) => sum + item.value, 0) // 마케팅 관련 동의 값 합산
|
|
370
369
|
}
|
|
@@ -112,21 +112,21 @@ const Personal = ({
|
|
|
112
112
|
key: ''
|
|
113
113
|
});
|
|
114
114
|
const [optionalTermItems, setOptionalTermItems] = useState<IOptionalCheckItem[]>([
|
|
115
|
+
// {
|
|
116
|
+
// title: '사건관련 알림 수신 동의 (선택)',
|
|
117
|
+
// checked: false,
|
|
118
|
+
// isContent: true,
|
|
119
|
+
// cautionTitle: '*사건관련 알림을 수신할 채널을 선택해 주세요.',
|
|
120
|
+
// name: 'optionalMain',
|
|
121
|
+
// alarmTypeList: [
|
|
122
|
+
// { title: '푸시알림', name: 'optionalSelect', checked: false, value: 1 },
|
|
123
|
+
// { title: '카카오알림톡', name: 'optionalSelect', checked: false, value: 2 },
|
|
124
|
+
// { title: 'SMS', name: 'optionalSelect', checked: false, value: 4 },
|
|
125
|
+
// { title: '이메일', name: 'optionalSelect', checked: false, value: 8 }
|
|
126
|
+
// ]
|
|
127
|
+
// },
|
|
115
128
|
{
|
|
116
|
-
title: '
|
|
117
|
-
checked: false,
|
|
118
|
-
isContent: true,
|
|
119
|
-
cautionTitle: '*사건관련 알림을 수신할 채널을 선택해 주세요.',
|
|
120
|
-
name: 'optionalMain',
|
|
121
|
-
alarmTypeList: [
|
|
122
|
-
{ title: '푸시알림', name: 'optionalSelect', checked: false, value: 1 },
|
|
123
|
-
{ title: '카카오알림톡', name: 'optionalSelect', checked: false, value: 2 },
|
|
124
|
-
{ title: 'SMS', name: 'optionalSelect', checked: false, value: 4 },
|
|
125
|
-
{ title: '이메일', name: 'optionalSelect', checked: false, value: 8 }
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title: '마케팅 정보 수신 동의 (선택)',
|
|
129
|
+
title: '광고성 정보 및 마케팅 정보 수신 동의 (선택)',
|
|
130
130
|
checked: false,
|
|
131
131
|
isContent: true,
|
|
132
132
|
cautionTitle: '*마케팅 정보를 수신할 채널을 선택해 주세요.',
|
|
@@ -213,12 +213,12 @@ const Personal = ({
|
|
|
213
213
|
const isAll =
|
|
214
214
|
(userData?.data.name !== userObj?.name && userValidObj?.nameValid) ||
|
|
215
215
|
userValidObj.codeValid ||
|
|
216
|
-
userAgree?.data?.alert_agree !==
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
// userAgree?.data?.alert_agree !==
|
|
217
|
+
// optionalTermItems[0].alarmTypeList
|
|
218
|
+
// .filter(item => item.checked)
|
|
219
|
+
// .reduce((sum, item) => sum + item.value, 0) ||
|
|
220
220
|
userAgree?.data?.marketing_agree !==
|
|
221
|
-
optionalTermItems[
|
|
221
|
+
optionalTermItems[0].alarmTypeList.filter(item => item.checked).reduce((sum, item) => sum + item.value, 0);
|
|
222
222
|
const updateOptionalTermItems = (alertAgree: number, marketingAgree: number) => {
|
|
223
223
|
setOptionalTermItems(prevItems =>
|
|
224
224
|
prevItems.map((item, index) => {
|
|
@@ -432,14 +432,12 @@ const Personal = ({
|
|
|
432
432
|
const nameCheck = userData.data.name !== userObj.name && userValidObj.nameValid;
|
|
433
433
|
const phoneCheck = userValidObj.codeValid;
|
|
434
434
|
const termCheck =
|
|
435
|
-
userAgree.data.alert_agree !==
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
435
|
+
// userAgree.data.alert_agree !==
|
|
436
|
+
// optionalTermItems[0].alarmTypeList
|
|
437
|
+
// .filter(item => item.checked)
|
|
438
|
+
// .reduce((sum, item) => sum + item.value, 0) ||
|
|
439
439
|
userAgree.data.marketing_agree !==
|
|
440
|
-
|
|
441
|
-
.filter(item => item.checked)
|
|
442
|
-
.reduce((sum, item) => sum + item.value, 0);
|
|
440
|
+
optionalTermItems[0].alarmTypeList.filter(item => item.checked).reduce((sum, item) => sum + item.value, 0);
|
|
443
441
|
|
|
444
442
|
let result = true;
|
|
445
443
|
if (nameCheck || phoneCheck) {
|
|
@@ -453,11 +451,11 @@ const Personal = ({
|
|
|
453
451
|
if (termCheck) {
|
|
454
452
|
result = await optionalTermAgree({
|
|
455
453
|
bodyData: {
|
|
456
|
-
alert_agree: optionalTermItems[0].alarmTypeList
|
|
457
|
-
|
|
458
|
-
|
|
454
|
+
// alert_agree: optionalTermItems[0].alarmTypeList
|
|
455
|
+
// .filter(item => item.checked)
|
|
456
|
+
// .reduce((sum, item) => sum + item.value, 0), // checked된 항목들의 value 합산
|
|
459
457
|
|
|
460
|
-
marketing_agree: optionalTermItems[
|
|
458
|
+
marketing_agree: optionalTermItems[0].alarmTypeList
|
|
461
459
|
.filter(item => item.checked)
|
|
462
460
|
.reduce((sum, item) => sum + item.value, 0) // 마케팅 관련 동의 값 합산
|
|
463
461
|
}
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import Fetch from '../_fetch/fetch';
|
|
11
11
|
export const optionalTermAgree = (_a) => __awaiter(void 0, [_a], void 0, function* ({ bodyData }) {
|
|
12
12
|
const VALID_VALUES = Array.from({ length: 16 }, (_, i) => i);
|
|
13
|
-
if (!VALID_VALUES.includes(bodyData.
|
|
13
|
+
if (!VALID_VALUES.includes(bodyData.marketing_agree)) {
|
|
14
14
|
return { result: false };
|
|
15
15
|
}
|
|
16
16
|
try {
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import Fetch from '../_fetch/fetch';
|
|
2
2
|
|
|
3
|
-
export const optionalTermAgree = async ({
|
|
4
|
-
bodyData
|
|
5
|
-
}: {
|
|
6
|
-
bodyData: { alert_agree: number; marketing_agree: number };
|
|
7
|
-
}) => {
|
|
3
|
+
export const optionalTermAgree = async ({ bodyData }: { bodyData: { marketing_agree: number } }) => {
|
|
8
4
|
const VALID_VALUES = Array.from({ length: 16 }, (_, i) => i);
|
|
9
|
-
if (!VALID_VALUES.includes(bodyData.
|
|
5
|
+
if (!VALID_VALUES.includes(bodyData.marketing_agree)) {
|
|
10
6
|
return { result: false };
|
|
11
7
|
}
|
|
12
8
|
|