Skip to content

Commit

Permalink
fix: add type declations
Browse files Browse the repository at this point in the history
  • Loading branch information
moolmin committed Oct 9, 2024
1 parent 848d001 commit d0a46e6
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/app/(pages)/4q-create/_components/second.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ 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({
Expand Down
11 changes: 11 additions & 0 deletions src/app/(pages)/4q-create/_components/third.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ 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;
}


interface FormData {
url: string;
shortenUrl: string;
Expand Down
15 changes: 15 additions & 0 deletions src/app/(pages)/4q-gallery/_components/item-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ import Lottie from "react-lottie-player";
import heartLottie from "../../../../../public/rotties/heart-lottie.json";
import Image from "next/image";

type Item = {
imageId: number;
userName: string;
url: string;
likeCount: number;
tags: string[];
categoryName: string;
createdAt: string;
liked: boolean;
};

type ItemCardProps = {
item: Item;
};

export default function ItemCard({ item }: ItemCardProps) {
const { token } = theme.useToken();
const [open, setOpen] = useState(false);
Expand Down
11 changes: 11 additions & 0 deletions src/app/(pages)/4q-gallery/_components/item-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ 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;
Expand Down
10 changes: 10 additions & 0 deletions src/app/(pages)/4q-gallery/_components/second.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ 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;
Expand Down
4 changes: 4 additions & 0 deletions src/app/(pages)/mypage/my-4q/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { List } from "antd";
import ItemList from "./_components/item-list";
import { getMyTicket } from "../../../../service/photo_api";

interface Ticket {
id: number;
}

export default function Page() {
const [tickets, setTickets] = useState<Ticket[]>([]);

Expand Down
24 changes: 23 additions & 1 deletion src/service/useGalleryQuery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
import { useInfiniteQuery } from 'react-query';

const BASE_URL = process.env.NEXT_PUBLIC_API_URL;
const BASE_URL = process.env.NEXT_PUBLIC_API_URL;

export interface Item {
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;
}

// API 호출 함수
const fetchGalleryData = async ({
Expand Down

0 comments on commit d0a46e6

Please sign in to comment.