diff --git a/src/app/(pages)/4q-create/(modals)/tagSelectModal.tsx b/src/app/(pages)/4q-create/(modals)/tagSelectModal.tsx index 9b5c777..8141fb8 100644 --- a/src/app/(pages)/4q-create/(modals)/tagSelectModal.tsx +++ b/src/app/(pages)/4q-create/(modals)/tagSelectModal.tsx @@ -4,11 +4,6 @@ import styles from "./tagSelectModal.module.css"; import hot_mark from "../../../../../public/images/hot_tag.png"; import tagTranslationMap from "@/lib/tagTranslationKrEn"; -interface TagSelectorProps { - selectedTags: string[]; - onSelect: (selectedTags: string[]) => void; -} - export default function TagSelector({ selectedTags, onSelect, diff --git a/src/app/(pages)/4q-create/_components/first.tsx b/src/app/(pages)/4q-create/_components/first.tsx index 8a3ab9a..d399acb 100644 --- a/src/app/(pages)/4q-create/_components/first.tsx +++ b/src/app/(pages)/4q-create/_components/first.tsx @@ -10,10 +10,6 @@ const { Option } = Select; const STORAGE_KEY = "form_data"; -interface FirstProps { - formRef: React.RefObject; - onSubmit: () => void; -} export default function First({ formRef, onSubmit }: FirstProps) { const [isModalOpen, setIsModalOpen] = useState(false); diff --git a/src/app/(pages)/4q-create/_components/second.tsx b/src/app/(pages)/4q-create/_components/second.tsx index 225c052..91768b9 100644 --- a/src/app/(pages)/4q-create/_components/second.tsx +++ b/src/app/(pages)/4q-create/_components/second.tsx @@ -13,16 +13,6 @@ message.config({ maxCount: 3, }); -interface FormData { - url: string; - shortenUrl: string; - title: string; - backgroundImageUrl: string; - backgroundImagId: number; - shortenUrlId: number; - tags: string[]; - category: string; -} export default function Second() { const [emblaRef, emblaApi] = useEmblaCarousel({ diff --git a/src/app/(pages)/4q-create/_components/third.tsx b/src/app/(pages)/4q-create/_components/third.tsx index 1b36b48..dd9a4eb 100644 --- a/src/app/(pages)/4q-create/_components/third.tsx +++ b/src/app/(pages)/4q-create/_components/third.tsx @@ -6,29 +6,19 @@ import styles from "./third.module.css"; import Konva from "konva"; import { PiTextTBold } from "react-icons/pi"; import { HiTrash } from "react-icons/hi"; -import { generateTicket } from '@/service/photo_api'; -import Lottie from 'react-lottie-player'; -import loadingLottie from '../../../../../public/rotties/image-loading.json'; -import type { Stage as StageType } from 'konva/lib/Stage'; - -interface TextNode { - id: number; - text: string; - x: number; - y: number; - fontSize: number; - isEditing: boolean; - color: string; -} +import { generateTicket } from "@/service/photo_api"; +import Lottie from "react-lottie-player"; +import loadingLottie from "../../../../../public/rotties/image-loading.json"; +import type { Stage as StageType } from "konva/lib/Stage"; interface FormData { url: string; shortenUrl: string; title: string; backgroundImageUrl: string; - backgroundImageId: number; + backgroundImageId: number; shortenUrlId: number; - tags: string; + tags: string[]; category: string; } @@ -45,7 +35,7 @@ export default function Third() { backgroundImageUrl: "", backgroundImageId: 0, shortenUrlId: 0, - tags: "", + tags: [], category: "", }); const [shortenUrl, setShortenUrl] = useState(""); @@ -56,8 +46,8 @@ export default function Third() { const [isLoading, setLoading] = useState(false); useEffect(() => { - if (typeof window !== 'undefined') { - const storedFormDataString = sessionStorage.getItem('form_data'); + if (typeof window !== "undefined") { + const storedFormDataString = sessionStorage.getItem("form_data"); if (storedFormDataString) { const parsedFormData = JSON.parse(storedFormDataString); setStoredFormData(parsedFormData); @@ -83,9 +73,11 @@ export default function Third() { } }; - const [backgroundImage] = useImage(storedFormData.backgroundImageUrl, 'anonymous'); - const [qrImage] = useImage(qrImageUrl, 'anonymous'); - + const [backgroundImage] = useImage( + storedFormData.backgroundImageUrl, + "anonymous" + ); + const [qrImage] = useImage(qrImageUrl, "anonymous"); const handleDragEnd = (e: Konva.KonvaEventObject) => { setQrPosition({ @@ -148,26 +140,27 @@ export default function Third() { } }, [qrImage, isSelected]); - const handleSubmit = async () => { setLoading(true); try { if (stageRef.current) { const dataURL = stageRef.current.toDataURL({ pixelRatio: 3 }); const ticketImage = await fetch(dataURL) - .then(res => res.blob()) - .then(blob => new File([blob], "ticket.png", { type: "image/png" })); + .then((res) => res.blob()) + .then( + (blob) => new File([blob], "ticket.png", { type: "image/png" }) + ); const responseMessage = await generateTicket( ticketImage, storedFormData.backgroundImageId, storedFormData.shortenUrlId, - storedFormData.title, + storedFormData.title ); if (responseMessage?.ticketId) { setTimeout(() => { setLoading(false); - }, 4000); + }, 4000); window.location.href = `/4q-create/download/${responseMessage.ticketId}`; } else { alert("티켓 생성에 실패했습니다."); @@ -178,7 +171,7 @@ export default function Third() { } finally { setTimeout(() => { setLoading(false); - }, 8000); + }, 8000); } }; @@ -301,17 +294,17 @@ export default function Third() {
- -
+ +
)}
- +
- {item.userName ? item.userName : '비로그인 회원'} + {item.userName ? item.userName : "비로그인 회원"}
@@ -123,7 +103,7 @@ export default function ItemCard({ item }: ItemCardProps) { onClose={onClose} open={open} height="97%" - getContainer={document.body} + getContainer={document.body} className={styles.drawerContainer} >
diff --git a/src/app/(pages)/4q-gallery/_components/item-container.tsx b/src/app/(pages)/4q-gallery/_components/item-container.tsx index 79db496..2423596 100644 --- a/src/app/(pages)/4q-gallery/_components/item-container.tsx +++ b/src/app/(pages)/4q-gallery/_components/item-container.tsx @@ -5,17 +5,6 @@ import { getGalleryData } from "@/service/photo_api"; import { Button } from "antd"; import { BounceDot } from "basic-loading"; -type Item = { - createdAt: string; - imageId: number; - likeCount: number; - userName: string; - categoryName: string; - url: string; - tags: string[]; - liked: boolean; -}; - type ContainerProps = { category: string; tag: string; diff --git a/src/app/(pages)/4q-gallery/_components/second.tsx b/src/app/(pages)/4q-gallery/_components/second.tsx index 370ed53..4fafe16 100644 --- a/src/app/(pages)/4q-gallery/_components/second.tsx +++ b/src/app/(pages)/4q-gallery/_components/second.tsx @@ -12,16 +12,6 @@ import loadingLottie from "../../../../../public/rotties/image-loading.json"; import type { Stage as StageType } from "konva/lib/Stage"; import { isMobile } from "react-device-detect"; -interface TextNode { - id: number; - text: string; - x: number; - y: number; - fontSize: number; - isEditing: boolean; - color: string; -} - interface FormData { url: string; shortenUrl: string; diff --git a/src/app/(pages)/mypage/my-4q/page.tsx b/src/app/(pages)/mypage/my-4q/page.tsx index 702635e..32df971 100644 --- a/src/app/(pages)/mypage/my-4q/page.tsx +++ b/src/app/(pages)/mypage/my-4q/page.tsx @@ -6,18 +6,8 @@ import { List } from "antd"; import ItemList from "./_components/item-list"; import { getMyTicket } from "../../../../service/photo_api"; - -interface Ticket { - id: string; - title: string; - ticketUrl: string; - categoryName: string; - formattedDate: string; -} - - export default function Page() { - const [tickets, setTickets] = useState([]) + const [tickets, setTickets] = useState([]); useEffect(() => { const fetchTickets = async () => { @@ -33,7 +23,9 @@ export default function Page() { }, []); const handleDelete = (id) => { - setTickets((prevTickets) => prevTickets.filter((ticket) => ticket.id !== id)); + setTickets((prevTickets) => + prevTickets.filter((ticket) => ticket.id !== id) + ); }; return ( diff --git a/src/service/useGalleryQuery.ts b/src/service/useGalleryQuery.ts index 84de1be..dcc6c7c 100644 --- a/src/service/useGalleryQuery.ts +++ b/src/service/useGalleryQuery.ts @@ -1,28 +1,5 @@ import { useInfiniteQuery } from 'react-query'; -export interface Item { - id: string - createdAt: string; - imageId: number; - likeCount: number; - userName: string; - categoryName: string; - url: string; - tags: string[]; - liked: boolean; -} - -interface GalleryResponse { - content: Item[]; - last: boolean; -} - -interface UseGalleryQueryParams { - category: string; - tag: string; - sort: string; -} - const BASE_URL = process.env.NEXT_PUBLIC_API_URL; // API 호출 함수