Skip to content

Commit

Permalink
feat: 알림페이지
Browse files Browse the repository at this point in the history
  • Loading branch information
jiohjung98 committed Oct 16, 2024
1 parent 35c1990 commit e2370b3
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/app/mypage/alarm/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'use client';

import React, { useState } from 'react';
import { useRouter } from 'next/navigation';

const AlarmPage = () => {
const router = useRouter();
const [isInterestedProductAlarmOn, setIsInterestedProductAlarmOn] = useState(true);
const [isMoaguideAlarmOn, setIsMoaguideAlarmOn] = useState(true);

const toggleInterestedProductAlarm = () => {
setIsInterestedProductAlarmOn(!isInterestedProductAlarmOn);
};

const toggleMoaguideAlarm = () => {
setIsMoaguideAlarmOn(!isMoaguideAlarmOn);
};

return (
<div className="min-h-[calc(100dvh-134.5px)] flex flex-col sm:min-h-[calc(100vh-60px)] sm:mb-0 w-[90%] mx-auto sm:max-w-[640px]">
<div onClick={() => router.back()} className="py-[14px]">
<img src="/images/mypage/left.svg" alt="뒤로가기" className="cursor-pointer" />
</div>
<div className="text-heading3 mt-3">알림 설정</div>
<section className="mt-10">
<div className="flex justify-between items-center py-4">
<span className="text-body3">관심 상품 업데이트 알림</span>
<div
className={`relative w-12 h-6 rounded-full cursor-pointer transition-colors ${
isInterestedProductAlarmOn ? 'bg-gradient2' : 'bg-gray-300'
}`}
onClick={toggleInterestedProductAlarm}
>
<div
className={`absolute w-5 h-5 bg-white rounded-full top-0.5 left-0.5 transition-transform ${
isInterestedProductAlarmOn ? 'translate-x-6' : ''
}`}
></div>
</div>
</div>

<div className="flex justify-between items-center py-4">
<span className="text-body3">모아가이드 제공 알림</span>
<div
className={`relative w-12 h-6 rounded-full cursor-pointer transition-colors ${
isMoaguideAlarmOn ? 'bg-gradient2' : 'bg-gray-300'
}`}
onClick={toggleMoaguideAlarm}
>
<div
className={`absolute w-5 h-5 bg-white rounded-full top-0.5 left-0.5 transition-transform ${
isMoaguideAlarmOn ? 'translate-x-6' : ''
}`}
></div>
</div>
</div>
</section>
</div>
);
};

export default AlarmPage;
5 changes: 5 additions & 0 deletions src/components/mypage/MypageMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';
import EventGuide from './EventGuide';
import { useRouter } from 'next/navigation';

const MypageMenu = () => {

const router = useRouter();

return (
<div className="mt-5 flex flex-col">
{/* 공지사항 */}
Expand Down Expand Up @@ -33,6 +37,7 @@ const MypageMenu = () => {
src="/images/mypage/right_menu.svg"
alt="알림"
className="cursor-pointer"
onClick={() => router.push('/mypage/alarm')}
/>
</div>
</div>
Expand Down

0 comments on commit e2370b3

Please sign in to comment.