Skip to content

Commit 8a2fb4b

Browse files
committed
12/17 remote config 제거,
1 parent 53d603c commit 8a2fb4b

File tree

3 files changed

+59
-110
lines changed

3 files changed

+59
-110
lines changed

src/app/(main)/chat/room/page.tsx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ export default function ChatRoom() {
7272

7373
if (type === 'TALK' && data) {
7474
const socketData = data as SocketChatContent
75-
const isMine = socketData.senderId === user?.profile?.sub
75+
// const isMine = socketData.senderId === user?.profile?.sub
7676

77-
if (!isMine && isOtherUserLeft) {
78-
setIsOtherUserLeft(false)
79-
setIsBlocked(false)
80-
}
77+
// if (!isMine && isOtherUserLeft) {
78+
// setIsOtherUserLeft(false)
79+
// setIsBlocked(false)
80+
// }
8181

8282
mutate((currentData) => {
8383
if (!currentData) return []
@@ -89,7 +89,7 @@ export default function ChatRoom() {
8989

9090
const newChatEntry: ChatContent = {
9191
...socketData,
92-
mine: isMine,
92+
mine: socketData.senderId === user?.profile?.sub,
9393
}
9494

9595
newData[0] = {
@@ -99,14 +99,16 @@ export default function ChatRoom() {
9999
return newData
100100
}, false)
101101
}
102+
102103
if (message === null) return
103-
if (type === 'SYSTEM_LEAVE' || type === 'SYSTEM_BANNED') {
104-
if (type === 'SYSTEM_LEAVE') setIsOtherUserLeft(true)
105-
if (type === 'SYSTEM_BANNED') setIsBlocked(true)
104+
105+
if (type === 'SYSTEM_LEAVE') {
106+
setIsOtherUserLeft(true)
106107

107108
mutate((currentData) => {
108109
if (!currentData) return []
109110
const newData = [...currentData]
111+
110112
const systemEntry: ChatContent = {
111113
chatId: Date.now(),
112114
chatContent: message,
@@ -118,12 +120,16 @@ export default function ChatRoom() {
118120
senderProfileUrl: '',
119121
senderThumbnailUrl: '',
120122
}
121-
newData[0] = {
122-
...newData[0],
123-
content: [...newData[0].content, systemEntry],
124-
}
123+
124+
newData[0] = { ...newData[0], content: [...newData[0].content, systemEntry] }
125125
return newData
126126
}, false)
127+
return
128+
}
129+
130+
if (type === 'SYSTEM_BANNED') {
131+
setIsBlocked(true)
132+
return
127133
}
128134

129135
if (type === 'ERROR') {
@@ -140,6 +146,12 @@ export default function ChatRoom() {
140146

141147
const handleSendMessage = (message: string) => {
142148
if (!message.trim() || !user?.profile) return
149+
sendMessageBySocket(message)
150+
logAnalyticsEvent('chat_sent', {
151+
screen_name: 'chat_room',
152+
event_category: 'engagement',
153+
event_label: 'chat_message',
154+
})
143155

144156
// 추후 응답속도가 느려 낙관적 업데이트가 필요할 시 재사용
145157
// const tempMessage: ChatContent = {
@@ -162,14 +174,6 @@ export default function ChatRoom() {
162174
// }
163175
// return newData
164176
// }, false)
165-
166-
sendMessageBySocket(message)
167-
168-
logAnalyticsEvent('chat_sent', {
169-
screen_name: 'chat_room',
170-
event_category: 'engagement',
171-
event_label: 'chat_message',
172-
})
173177
}
174178

175179
// 채팅방 나가기 핸들러

src/app/(main)/match/profile/page.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ import PreferExerciseItem from '../../mypage/_components/preferExerciseItem'
2323
import KebabModal from './_components/kebabModal'
2424
import styles from './profile.module.css'
2525

26-
import { useRemoteConfig } from '@/hooks/useRemoteConfig' //12월 17일 제거
27-
2826
export default function Profile() {
29-
const { config, isLoading: remoteConfigIsLoading } = useRemoteConfig() //12월17일 제거
30-
3127
const router = useRouter()
3228
const [memberId] = useQueryState('memberId')
3329
const [locationId] = useQueryState('locationId', parseAsInteger)
@@ -82,7 +78,7 @@ export default function Profile() {
8278
}
8379
}
8480

85-
if (profileLoading || !profileData || remoteConfigIsLoading) return null //12월17일 remoteConfigIsLoading 제거
81+
if (profileLoading || !profileData) return null
8682

8783
return (
8884
<>
@@ -172,8 +168,7 @@ export default function Profile() {
172168
</section>
173169

174170
{/* 선호운동 영역 */}
175-
{/* 12월 17일 플래그 제거 */}
176-
{config.new_feautre_flag && profileData.preferredExercises.length > 0 && (
171+
{profileData.preferredExercises.length > 0 && (
177172
<section className={styles['prefer-exercise-section']}>
178173
<div className={styles['prefer-exercise-title']}>
179174
<Typography as="p" variant="content-large" weight="bold">

src/app/(main)/mypage/page.tsx

Lines changed: 32 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ import SITE_MAP from '@/constants/siteMap.constant'
1616
import PreferExerciseItem from './_components/preferExerciseItem'
1717
import styles from './mypage.module.css'
1818

19-
import { useRemoteConfig } from '@/hooks/useRemoteConfig' //12월 17일 제거
20-
2119
export default function Mypage() {
2220
const todayString = format(new Date(), 'yyyy-MM-dd')
23-
const { data: profileData, isLoading: profileLoading } =
24-
useReadUserFullProfile()
25-
const { config, isLoading: remoteConfigIsLoading } = useRemoteConfig() //12월17일 제거
21+
const { data: profileData, isLoading: profileLoading } = useReadUserFullProfile()
2622

27-
if (profileLoading || !profileData || remoteConfigIsLoading) return null //12월17일 remoteConfigIsLoading 제거
23+
if (profileLoading || !profileData) return
2824

2925
return (
3026
<>
@@ -41,77 +37,42 @@ export default function Mypage() {
4137
{/* 프로필 영역 */}
4238
<section className={styles['profile-section']}>
4339
{profileData.profileImageUrl === null ? (
44-
<ProfileImg
45-
profileThumbnailUrl={profileData.profileThumbnailUrl}
46-
profileImageUrl={profileData.profileImageUrl}
47-
mode="view"
48-
/>
40+
<ProfileImg profileThumbnailUrl={profileData.profileThumbnailUrl} profileImageUrl={profileData.profileImageUrl} mode="view" />
4941
) : (
5042
<Link href={SITE_MAP.MYPAGE_PICTURES}>
51-
<ProfileImg
52-
profileThumbnailUrl={profileData.profileThumbnailUrl}
53-
profileImageUrl={profileData.profileImageUrl}
54-
mode="view"
55-
/>
43+
<ProfileImg profileThumbnailUrl={profileData.profileThumbnailUrl} profileImageUrl={profileData.profileImageUrl} mode="view" />
5644
</Link>
5745
)}
5846

59-
<Typography
60-
className={styles['nickname']}
61-
as="span"
62-
variant="title-medium"
63-
weight="bold"
64-
>
47+
<Typography className={styles['nickname']} as="span" variant="title-medium" weight="bold">
6548
{profileData.nickname}
6649
</Typography>
67-
<Typography
68-
className={styles['birth']}
69-
as="span"
70-
variant="content-medium"
71-
>
72-
{formatGenderToKR(profileData.gender)} |{' '}
73-
{formatDateToKR(profileData.birthDate)}
50+
<Typography className={styles['birth']} as="span" variant="content-medium">
51+
{formatGenderToKR(profileData.gender)} | {formatDateToKR(profileData.birthDate)}
7452
</Typography>
7553
<div className={styles['user-info']}>
7654
<div className={styles['info-item']}>
7755
<Typography as="span" variant="title-medium" weight="bold">
7856
{profileData.exerciseCountInLast30Days}
7957
</Typography>
80-
<Typography
81-
as="span"
82-
variant="content-small"
83-
className={styles['info-label']}
84-
>
58+
<Typography as="span" variant="content-small" className={styles['info-label']}>
8559
최근 30일 운동 횟수
8660
</Typography>
8761
</div>
8862
<div className={styles['info-item']}>
89-
<Typography
90-
as="span"
91-
variant="title-medium"
92-
weight="bold"
93-
className={styles['info-value-container']}
94-
>
63+
<Typography as="span" variant="title-medium" weight="bold" className={styles['info-value-container']}>
9564
{profileData.yearlyExerciseDays}
9665
<span className={styles['info-value-suffix']}>/ 365</span>
9766
</Typography>
98-
<Typography
99-
as="span"
100-
variant="content-small"
101-
className={styles['info-label']}
102-
>
67+
<Typography as="span" variant="content-small" className={styles['info-label']}>
10368
올해 운동 일수
10469
</Typography>
10570
</div>
10671
<div className={styles['info-item']}>
10772
<Typography as="span" variant="title-medium" weight="bold">
10873
{profileData.exerciseScore}
10974
</Typography>
110-
<Typography
111-
as="span"
112-
variant="content-small"
113-
className={styles['info-label']}
114-
>
75+
<Typography as="span" variant="content-small" className={styles['info-label']}>
11576
운동 점수
11677
</Typography>
11778
</div>
@@ -124,40 +85,29 @@ export default function Mypage() {
12485
</section>
12586

12687
{/* 선호운동 영역 */}
127-
{/* 12월 17일 플래그 제거 */}
128-
{config.new_feautre_flag && (
129-
<section className={styles['prefer-exercise-section']}>
130-
<div className={styles['prefer-exercise-title']}>
88+
<section className={styles['prefer-exercise-section']}>
89+
<div className={styles['prefer-exercise-title']}>
90+
<Typography as="p" variant="content-large" weight="bold">
91+
선호 운동
92+
</Typography>
93+
<Link href={`${SITE_MAP.MYPAGE_PREFER_SELECT}?nickName=${profileData.nickname}`}>
94+
<EditIcon className={styles['prefer-exercise-edit-icon']} />
95+
</Link>
96+
</div>
97+
{profileData.preferredExercises.length > 0 ? (
98+
<div className={styles['prefer-exercise-list']}>
99+
{profileData.preferredExercises.map((data) => (
100+
<PreferExerciseItem key={`prefer-${data.preferredExerciseId}`} data={data} />
101+
))}
102+
</div>
103+
) : (
104+
<Link href={`${SITE_MAP.MYPAGE_PREFER_SELECT}?nickName=${profileData.nickname}`} className={styles['prefer-exercise-create']}>
131105
<Typography as="p" variant="content-large" weight="bold">
132-
선호 운동
106+
선호운동을 선택해주세요 +
133107
</Typography>
134-
<Link
135-
href={`${SITE_MAP.MYPAGE_PREFER_SELECT}?nickName=${profileData.nickname}`}
136-
>
137-
<EditIcon className={styles['prefer-exercise-edit-icon']} />
138-
</Link>
139-
</div>
140-
{profileData.preferredExercises.length > 0 ? (
141-
<div className={styles['prefer-exercise-list']}>
142-
{profileData.preferredExercises.map((data) => (
143-
<PreferExerciseItem
144-
key={`prefer-${data.preferredExerciseId}`}
145-
data={data}
146-
/>
147-
))}
148-
</div>
149-
) : (
150-
<Link
151-
href={`${SITE_MAP.MYPAGE_PREFER_SELECT}?nickName=${profileData.nickname}`}
152-
className={styles['prefer-exercise-create']}
153-
>
154-
<Typography as="p" variant="content-large" weight="bold">
155-
선호운동을 선택해주세요 +
156-
</Typography>
157-
</Link>
158-
)}
159-
</section>
160-
)}
108+
</Link>
109+
)}
110+
</section>
161111

162112
{/* 달력 영역 */}
163113
<section className={styles['calender-section']}>

0 commit comments

Comments
 (0)