Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/features/ticket/ui/TicketOptionFormSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useTicketOptionForm } from '../hooks/useTicketOptionForm';
import DefaultTextField from '../../../../design-system/ui/textFields/DefaultTextField';
import ToggleButton from '../../../../design-system/ui/buttons/ToggleButton';
import ChoiceChip from '../../../../design-system/ui/ChoiceChip';
import { TicketOptionType } from '../../../shared/types/ticketType';

export const TicketOptionFormSection = ({ form }: { form: ReturnType<typeof useTicketOptionForm> }) => {
const { state, dispatch, handleAnswerToggled } = form;
Expand Down Expand Up @@ -31,7 +32,7 @@ export const TicketOptionFormSection = ({ form }: { form: ReturnType<typeof useT
detail="질문에 대한 부가 설명이 있다면 여기 적으면 돼요."
className="h-12 mb-5"
detailClassName="px-0"
value={state.question.description?? ''}
value={state.question.description ?? ''}
onChange={e => dispatch({ type: 'SET_DESCRIPTION', payload: e.target.value })}
/>
</div>
Expand All @@ -44,12 +45,12 @@ export const TicketOptionFormSection = ({ form }: { form: ReturnType<typeof useT
<ChoiceChip
value={state.question.responseFormat} // 객관식
options={[
{ label: '객관식', value: 'SINGLE' },
{ label: '여러개 선택', value: 'MULTIPLE' },
{ label: '자유로운 텍스트', value: 'TEXT' },
{ label: '객관식', value: TicketOptionType.SINGLE },
{ label: '여러개 선택', value: TicketOptionType.MULTIPLE },
{ label: '자유로운 텍스트', value: TicketOptionType.TEXT },
]}
onSelect={selected => {
dispatch({ type: 'SET_RESPONSE_TOGGLE', payload: selected });
dispatch({ type: 'SET_RESPONSE_TOGGLE', payload: selected as TicketOptionType });
dispatch({ type: 'SET_WARNING', payload: { field: 'optionWarning', value: '' } });
dispatch({ type: 'SET_FOCUSED_INDEX', payload: null });
}}
Expand Down
23 changes: 9 additions & 14 deletions src/pages/dashboard/ui/mail/EmailEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@ import SelectTicketModal from '../../../../widgets/dashboard/ui/email/SelectTick
import { useParticipants } from '../../../../features/dashboard/hook/useParticipants';
import { useEmailStore } from '../../../../features/dashboard/model/store/EmailStore';
import { useEditEmail } from '../../../../features/dashboard/hook/useEmailHook';
import { EmailRequest } from '../../../../features/dashboard/model/emailInformation';
import { EmailRequest } from '../../../../features/dashboard/model/email';

const EmailEditPage = () => {
const [ticketModalOpen, setTicketModalOpen] = useState(false);
const { participants } = useParticipants();
const { id } = useParams();
const { mutate: editEmail } = useEditEmail();

const {
reservationEmailId,
title,
content,
recipients,
reservationDate,
setReservationDate,
ticketId,
targetType
} = useEmailStore();
const { reservationEmailId, title, content, recipients, reservationDate, setReservationDate, ticketId, targetType } =
useEmailStore();

const handleEdit = () => {
const eventId = id ? parseInt(id) : 0;
Expand All @@ -34,12 +27,12 @@ const EmailEditPage = () => {
content,
recipients,
reservationDate,
targetType
targetType,
};
if (targetType === 'TICKET') {
emailData.ticketId = ticketId;
}
editEmail({ reservationEmailId: reservationEmailId, data: emailData,});
editEmail({ reservationEmailId: reservationEmailId, data: emailData });
};

return (
Expand All @@ -53,7 +46,9 @@ const EmailEditPage = () => {
/>
{/*시간 선택 컴포넌트*/}
<TimePicker
onChange={(isoString) => { setReservationDate(isoString); }}
onChange={isoString => {
setReservationDate(isoString);
}}
/>
<Button label="보내기" onClick={handleEdit} className="w-full h-12 rounded-full" />
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/payment/ui/PaymentPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Header from '../../../../design-system/ui/Header';
import ticket from '../../../../public/assets/dashboard/ticket/Ticket(horizon).svg';
import PaymentCard from '../../../widgets/payment/ui/PaymentCard';
import PaymentLayout from '../../../shared/ui/backgrounds/PaymentLayout';

Expand Down
203 changes: 9 additions & 194 deletions src/shared/types/responseType.ts
Original file line number Diff line number Diff line change
@@ -1,199 +1,14 @@
export interface Option {
optionName: string;
choices: string[];
optionName: string;
choices: string[];
}
export const options: Option[] = [
{
optionName: '티셔츠 사이즈',
choices: ['XS', 'S', 'M', 'L', 'XL'],
},
];

export interface responsesData {
id: string;
name: string;
email: string;
phone: string;
grade: string;
num: string;
selectedOptions: { [key: string]: string };
id: string;
name: string;
email: string;
phone: string;
grade: string;
num: string;
selectedOptions: { [key: string]: string };
}

export const responsesInfo: responsesData[] = [
{
id: '1',
name: '고에진',
email: 'qwe@naver.com',
phone: '000-1234-5678',
grade: '1',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "S",
},
},
{
id: '2',
name: '조히은',
email: 'asd@naver.com',
phone: '000-1212-3232',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "M",
},
},
{
id: '3',
name: '한승철',
email: 'qaz@naver.com',
phone: '000-3456-1234',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '4',
name: '민정준',
email: 'poi@naver.com',
phone: '000-1345-2346',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '5',
name: '고에진',
email: 'ghj@naver.com',
phone: '000-1234-5678',
grade: '4',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '6',
name: '조히은',
email: 'jhe@naver.com',
phone: '000-1212-3232',
grade: '3',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '7',
name: '한승철',
email: 'hsc@naver.com',
phone: '000-3456-1234',
grade: '1',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '8',
name: '민정준',
email: 'mjj@naver.com',
phone: '000-1345-2346',
grade: '3',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '1',
name: '고에진',
email: 'qwe@naver.com',
phone: '000-1234-5678',
grade: '1',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "S",
},
},
{
id: '2',
name: '조히은',
email: 'asd@naver.com',
phone: '000-1212-3232',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "M",
},
},
{
id: '3',
name: '한승철',
email: 'qaz@naver.com',
phone: '000-3456-1234',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '4',
name: '민정준',
email: 'poi@naver.com',
phone: '000-1345-2346',
grade: '2',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '5',
name: '고에진',
email: 'ghj@naver.com',
phone: '000-1234-5678',
grade: '4',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '6',
name: '조히은',
email: 'jhe@naver.com',
phone: '000-1212-3232',
grade: '3',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '7',
name: '한승철',
email: 'hsc@naver.com',
phone: '000-3456-1234',
grade: '1',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
{
id: '8',
name: '민정준',
email: 'mjj@naver.com',
phone: '000-1345-2346',
grade: '3',
num: '20211234',
selectedOptions: {
"티셔츠 사이즈": "L",
},
},
];
5 changes: 5 additions & 0 deletions src/shared/types/ticketType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum TicketOptionType {
SINGLE = 'SINGLE',
MULTIPLE = 'MULTIPLE',
TEXT = 'TEXT',
}
2 changes: 1 addition & 1 deletion src/widgets/dashboard/ui/ticket/TicketItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TicketItem = ({ ticket }: { ticket: ReadTicketResponse }) => {
drag="x"
dragConstraints={{ left: -80, right: 0 }}
onDragStart={() => setIsDragging(true)}
onDragEnd={(event, info) => {
onDragEnd={(_, info) => {
if (info.offset.x < -50) {
setIsDragging(true);
} else {
Expand Down