diff --git a/.eslintrc.json b/.eslintrc.json index 0469b97..8eb2b86 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -43,6 +43,7 @@ "linebreak-style": "off", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-unused-vars": "warn", "import/prefer-default-export": "off", "jsx-a11y/label-has-associated-control": [ 2, diff --git a/app/(route)/indicators/_components/result/result.module.css b/app/(route)/indicators/_components/result/result.module.css index 446697a..0ef7b72 100644 --- a/app/(route)/indicators/_components/result/result.module.css +++ b/app/(route)/indicators/_components/result/result.module.css @@ -44,6 +44,8 @@ color: #424242; font-size: 11px; font-weight: 300; + line-height: normal; + } .title { diff --git a/app/(route)/list/_components/nav/LIstCompo.tsx b/app/(route)/list/_components/nav/LIstCompo.tsx new file mode 100644 index 0000000..6d1ee50 --- /dev/null +++ b/app/(route)/list/_components/nav/LIstCompo.tsx @@ -0,0 +1,39 @@ +'use client' + +import S from '../../list.module.css' +import axios, { AxiosResponse } from 'axios' +import { useQuery } from '@tanstack/react-query' +import { Root, Tool } from '@/app/_constants/toolcard' +import ToolCard from '@/app/_components/card/toolCard' + +function ListCompo() { + const { data } = useQuery>({ + queryKey: ['getToolList'], + queryFn: () => axios.get('http://222.121.148.192/api/toolDetails'), + }) + + const resData = data?.data.data.tool + + return ( +
+
+ {resData?.map((data: Tool, index) => { + return ( + + ) + })} + 데이터를 모두 불러왔습니다. +
+
+ ) +} + +export default ListCompo diff --git a/app/(route)/list/page.tsx b/app/(route)/list/page.tsx index c4db493..8ea00f2 100644 --- a/app/(route)/list/page.tsx +++ b/app/(route)/list/page.tsx @@ -1,21 +1,13 @@ import Nav from './_components/nav' -import S from './list.module.css' +import ListCompo from './_components/nav/LIstCompo' //TODO: 주석처리 사항들에 데이터 가져오기 function List() { return ( - <> +
) } diff --git a/app/(route)/main/page.module.css b/app/(route)/main/page.module.css index e6c799d..2ecb47b 100644 --- a/app/(route)/main/page.module.css +++ b/app/(route)/main/page.module.css @@ -48,3 +48,6 @@ width: 100%; padding-bottom: 300px; } +.slide { + width: 390px; +} diff --git a/app/(route)/main/page.tsx b/app/(route)/main/page.tsx index ffc9c58..6c4b5ae 100644 --- a/app/(route)/main/page.tsx +++ b/app/(route)/main/page.tsx @@ -1,13 +1,31 @@ 'use client' +import ToolCard from '@/app/_components/card/toolCard' +import KeyWordTool from '@/app/_components/card/toolCard/keyWordToolCard' +import { useQuery } from '@tanstack/react-query' +import axios, { AxiosResponse } from 'axios' import Link from 'next/link' +import 'swiper/css' +import { Swiper, SwiperSlide } from 'swiper/react' import Nav from '../../_common/nav/index' import Title from '../../_common/text/title' import Search from '../../_components/search' +import { Root, Tool } from '../../_constants/toolcard' import S from './page.module.css' //TODO: 주석처리 사항들에 데이터 가져오기 function Main() { + const { data, isFetching } = useQuery>({ + queryKey: ['getTools'], + queryFn: () => axios.get('http://222.121.148.192/api/toolDetails'), + }) + + if (isFetching) { + return
...loading
+ } + + const resData = data?.data.data.tool + return (