File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ export const TEMPERATURE_RANGE = [
2+ { min : 0 , max : 10 , description : '따뜻함이 필요한 따숨님' } ,
3+ { min : 10 , max : 25 , description : '살짝 포근한 따숨님' } ,
4+ { min : 25 , max : 40 , description : '따스한 온기를 가진 따숨님' } ,
5+ { min : 40 , max : 55 , description : '마음이 따뜻한 따숨님' } ,
6+ { min : 55 , max : 70 , description : '훈훈한 따숨님' } ,
7+ { min : 70 , max : 80 , description : '정말 따뜻한 따숨님' } ,
8+ { min : 85 , max : 100 , description : '사랑이 넘치는 따숨님' } ,
9+ ] ;
Original file line number Diff line number Diff line change @@ -3,18 +3,27 @@ import { useState } from 'react';
33import { AlarmIcon , ArrowLeftIcon , PersonIcon } from '@/assets/icons' ;
44import ConfirmModal from '@/components/ConfirmModal' ;
55
6+ import { TEMPERATURE_RANGE } from './constants' ;
7+
68const DUMMY_TEMP = 48.5 ;
79const DUMMY_ZIP_CODE = '235EA' ;
810
911const MyPage = ( ) => {
1012 const [ isOpenModal , setIsOpenModal ] = useState ( false ) ;
1113
14+ const getDescriptionByTemperature = ( temp : number ) => {
15+ const range = TEMPERATURE_RANGE . find ( ( range ) => temp >= range . min && temp < range . max ) ;
16+ return range ?. description ;
17+ } ;
18+
19+ const description = getDescriptionByTemperature ( DUMMY_TEMP ) ;
20+
1221 return (
1322 < >
1423 { isOpenModal && (
1524 < ConfirmModal
1625 title = "정말 탈퇴하시겠어요?"
17- description = "탈퇴하시면, 지금까지 나눈 따듯한 마음들이 사라져요"
26+ description = "탈퇴하시면, 지금까지 나눈 따뜻한 마음들이 사라져요"
1827 cancelText = "되돌아가기"
1928 confirmText = "탈퇴하기"
2029 onCancel = { ( ) => setIsOpenModal ( false ) }
@@ -41,7 +50,7 @@ const MyPage = () => {
4150 </ section >
4251 < section >
4352 < div className = "mb-2 flex justify-between" >
44- < p className = "body-sb text-gray-60" > 따듯한 따숨님 </ p >
53+ < p className = "body-sb text-gray-60" > { description } </ p >
4554 < p className = "body-sb text-accent-1" > { DUMMY_TEMP } 도</ p >
4655 </ div >
4756 < div className = "h-4 w-full rounded-full bg-white" >
You can’t perform that action at this time.
0 commit comments