File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import Loader , { LoaderContainer } from '@/components/common/Loader' ;
44import OauthButton from '@/components/signup/OauthButton' ;
55import { OAUTH } from '@/constants/oauth' ;
6+ import { sendLetterState } from '@/recoil/letterStore' ;
67import { theme } from '@/styles/theme' ;
78import { OAuthType } from '@/types/login' ;
89import { useRouter } from 'next/navigation' ;
9- import { Suspense } from 'react' ;
10+ import { Suspense , useEffect } from 'react' ;
11+ import { useRecoilState } from 'recoil' ;
1012import styled from 'styled-components' ;
1113
1214export default function Login ( ) {
1315 const router = useRouter ( ) ;
16+ const [ , setSendState ] = useRecoilState ( sendLetterState ) ;
17+
18+ /* 로그인 페이지에서 편지 쓰기 store 초기화 */
19+ useEffect ( ( ) => {
20+ setSendState ( {
21+ draftId : null ,
22+ receiverName : '' ,
23+ content : '' ,
24+ images : [ ] as string [ ] ,
25+ previewImages : [ ] as string [ ] ,
26+ templateType : 0 ,
27+ letterId : null
28+ } ) ;
29+ } , [ ] ) ;
1430
1531 const handleGuestLetterStart = ( ) => {
1632 router . push ( '/send/receiver?guest=true' ) ;
You can’t perform that action at this time.
0 commit comments