email 자동 셋팅
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
|
||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { motion } from 'framer-motion';
|
||||
import { ChangeEvent, useState } from 'react';
|
||||
|
||||
@@ -18,12 +19,9 @@ export const EmailBottomSheet = ({
|
||||
sendEmail,
|
||||
sendRequest
|
||||
}: EmailBottomSheetProps) => {
|
||||
const emailList = [
|
||||
{name: 'test1@nicepay.co.kr', value: 'test1@nicepay.co.kr'},
|
||||
{name: 'test2@nicepay.co.kr', value: 'test2@nicepay.co.kr'},
|
||||
{name: 'test3@nicepay.co.kr', value: 'test3@nicepay.co.kr'},
|
||||
];
|
||||
const [userEmail, setUserEmail] = useState<string>(emailList[0]?.value || '');
|
||||
const optionsEmails = useStore.getState().UserStore.selectOptionsEmails;
|
||||
const email = useStore.getState().UserStore.email;
|
||||
const [userEmail, setUserEmail] = useState<string>(email);
|
||||
const onClickToClose = () => {
|
||||
setBottomSheetOn(false);
|
||||
};
|
||||
@@ -94,7 +92,7 @@ export const EmailBottomSheet = ({
|
||||
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setUserEmail(e.target.value) }
|
||||
>
|
||||
{
|
||||
emailList.map((value, index) => (
|
||||
optionsEmails.map((value, index) => (
|
||||
<option value={ value.value }>{ value.value }</option>
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user