Skip to content

Commit f74b097

Browse files
mtm-git1018ahk0413
andauthored
[chore]next.config파일 수정r#15 (#93)
* [chore]next.config변경 * [chore] useCloseOut 훅 폴더이동 * [fix]변경파일 경로수정 * [fix] 이미지파일 수정 * [chore]포매팅 * [chore] 포매팅 * [chore] 포매팅 따옴표오류 --------- Co-authored-by: ahk0413 <[email protected]>
1 parent f22406c commit f74b097

File tree

18 files changed

+41
-82
lines changed

18 files changed

+41
-82
lines changed

next.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
44

5+
images: {
6+
domains: ['www.thecocktaildb.com']
7+
},
8+
env: {
9+
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL
10+
},
511
// webpack 설정
612
webpack: (config) => {
713

8-
env: {
9-
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL;
10-
}
11-
1214
// @ts-expect-error 타입 에러 무시
1315
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));
1416

src/app/design-system/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import TextButton from '@/shared/components/button/TextButton';
55
import Input from '@/shared/components/Input-box/Input';
66
import { useState } from 'react';
77
import ModalLayout from '@/shared/components/modal-pop/ModalLayout';
8-
import SelectBox from '@/domains/shared/components/select-box/SelectBox';
98

109
import Spinner from '@/shared/components/spinner/Spinner';
1110
import LikeBtn from '@/domains/community/components/like/LikeBtn';
1211
import Share from '@/domains/shared/components/share/Share';
1312
import Keep from '@/domains/shared/components/keep/Keep';
1413
import ConfirmModal from '@/shared/components/modal-pop/ConfirmModal';
1514
import { useToast } from '@/shared/hook/useToast';
15+
import SelectBox from '@/shared/components/select-box/SelectBox';
1616

1717
function Page() {
1818
const [isModalOpen, setModalOpen] = useState(false);

src/app/mypage/mybar/page.tsx

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import CocktailCard from '@/domains/recipe/CocktailCard';
2-
import Img from '@/shared/assets/images/dummy/exampleCocktail.png';
32
import { Metadata } from 'next';
43

54
export const metadata: Metadata = {
@@ -14,35 +13,7 @@ function Page() {
1413
"
1514
>
1615
<CocktailCard
17-
src={Img}
18-
textSize1="text-xl"
19-
name="Old Pashioned"
20-
nameKo="올드 패션드"
21-
keep={false}
22-
></CocktailCard>
23-
<CocktailCard
24-
src={Img}
25-
textSize1="text-xl"
26-
name="Old Pashioned"
27-
nameKo="올드 패션드"
28-
keep={false}
29-
></CocktailCard>
30-
<CocktailCard
31-
src={Img}
32-
textSize1="text-xl"
33-
name="Old Pashioned"
34-
nameKo="올드 패션드"
35-
keep={false}
36-
></CocktailCard>
37-
<CocktailCard
38-
src={Img}
39-
textSize1="text-xl"
40-
name="Old Pashioned"
41-
nameKo="올드 패션드"
42-
keep={false}
43-
></CocktailCard>
44-
<CocktailCard
45-
src={Img}
16+
src=""
4617
textSize1="text-xl"
4718
name="Old Pashioned"
4819
nameKo="올드 패션드"

src/app/recipe/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Metadata } from 'next';
2-
import SelectBox from '@/domains/shared/components/select-box/SelectBox';
2+
33
import Input from '@/shared/components/Input-box/Input';
44

55
import Accordion from '../../domains/recipe/components/main/Accordion';
66
import CocktailList from '@/domains/recipe/CocktailList';
77
import PageHeader from '@/domains/shared/components/page-header/PageHeader';
88
import { Suspense } from 'react';
99
import SkeletonRecipe from '@/domains/recipe/skeleton/SkeletonRecipe';
10+
import SelectBox from '@/shared/components/select-box/SelectBox';
1011

1112
export const metadata: Metadata = {
1213
title: 'SSOUL | 칵테일레시피',

src/domains/community/main/CommunityFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import SelectBox from '@/domains/shared/components/select-box/SelectBox';
3+
import SelectBox from '@/shared/components/select-box/SelectBox';
44

55
function CommunityFilter() {
66
return (

src/domains/community/write/Category.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import SelectBox from '@/domains/shared/components/select-box/SelectBox';
1+
import SelectBox from '@/shared/components/select-box/SelectBox';
22

33
function Category() {
44
return (

src/domains/community/write/cocktail-tag/TagModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ function TagModal({ isOpen, setIsOpen }: Props) {
3434
{Array.from({ length: 16 }, (_, index) => (
3535
<div key={index} className="relative">
3636
<CocktailCard
37+
src=""
38+
name=""
3739
keep={false}
3840
className="w-full md:h-[100px] h-[120px]"
3941
textSize1="md:text-sm text-[10px] font-normal truncate md:w-24 w-18"

src/domains/community/write/image-upload/UploadedImage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import CocktailImg from '@/shared/assets/images/exampleCocktail.png';
43
import Image from 'next/image';
54
import { useState } from 'react';
65
import DeleteIcon from '@/shared/assets/icons/close_20.svg';
@@ -15,7 +14,7 @@ function UploadedImage() {
1514
onMouseLeave={() => setHovered(false)}
1615
>
1716
<Image
18-
src={CocktailImg}
17+
src={''}
1918
alt="칵테일 이미지 예시"
2019
className="rounded-xl w-full h-full object-cover pointer-events-none"
2120
/>

src/domains/recipe/CocktailCard.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import { StaticImageData } from 'next/image';
21
import Image from 'next/image';
3-
import Img from '@/shared/assets/images/dummy/exampleCocktail.png';
42
import Label from '../shared/components/label/Label';
53
import Keep from '../shared/components/keep/Keep';
64
import tw from '@/shared/utills/tw';
75

86
interface Props {
9-
src?: StaticImageData;
10-
name?: string;
7+
src: string;
8+
name: string;
119
nameKo?: string;
1210
keep?: boolean;
1311
className?: string;
@@ -25,7 +23,7 @@ function CocktailCard({ src, name, nameKo, keep = true, className, textSize1, te
2523
)}
2624
>
2725
{/* <Image src={src} alt={name} fill /> */}
28-
<Image src={Img} alt="" fill className="object-cover " />
26+
<Image src={src} alt={name} fill className="object-cover " />
2927
{keep && (
3028
<div className="flex w-full pl-4 px-3 py-2 items-center justify-between absolute left-0 top-0">
3129
<div>
@@ -36,7 +34,7 @@ function CocktailCard({ src, name, nameKo, keep = true, className, textSize1, te
3634
)}
3735
</div>
3836
<div className="flex flex-col gap-1 font-bold font-serif">
39-
<h3 className={tw(`${!textSize1 && 'text-2xl'}`, textSize1)}>Old Fassioned</h3>
37+
<h3 className={tw(`${!textSize1 && 'text-2xl'}`, textSize1)}>{name}</h3>
4038
<p className={tw(`${!textSize2 && 'text-base'}`, textSize2)}>올드 패션드</p>
4139
</div>
4240
</div>

src/domains/recipe/CocktailList.tsx

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
'use client';
2+
import { useEffect, useState } from 'react';
23
import CocktailCard from './CocktailCard';
4+
import { getApi } from '@/app/api/config/appConfig';
35

46
function CocktailList() {
5-
// const [data,setData] = useState([])
6-
// useEffect(() => {
7-
// fetch('http://localhost:8080/api/cocktails')
8-
// .then((res) => res.json())
9-
// .then((data) => {
10-
// console.log(data.data)
11-
// setData(data.data)
12-
// });
13-
// }, []);
7+
const [data, setData] = useState([]);
8+
useEffect(() => {
9+
fetch(`${getApi}/cocktails`)
10+
.then((res) => res.json())
11+
.then((data) => {
12+
console.log(data.data);
13+
setData(data.data);
14+
});
15+
}, []);
1416

1517
return (
1618
<ul
@@ -22,25 +24,11 @@ function CocktailList() {
2224
2325
"
2426
>
25-
{/* {
26-
data.map(({ cocktailImgUrl, cocktailId, cocktailName }) => (
27-
<li key={cocktailId}>
28-
<CocktailCard src={cocktailImgUrl} name={cocktailName} nameKo={cocktailName} />
29-
</li>
30-
))
31-
} */}
32-
<li className="w-full min-w-0 max-w-[320px] sm:max-w-none mx-auto sm:mx-0">
33-
<CocktailCard />
34-
</li>
35-
<li className="w-full min-w-0 max-w-[320px] sm:max-w-none mx-auto sm:mx-0">
36-
<CocktailCard />
37-
</li>{' '}
38-
<li className="w-full min-w-0 max-w-[320px] sm:max-w-none mx-auto sm:mx-0">
39-
<CocktailCard />
40-
</li>{' '}
41-
<li className="w-full min-w-0 max-w-[320px] sm:max-w-none mx-auto sm:mx-0">
42-
<CocktailCard />
43-
</li>
27+
{data.map(({ cocktailImgUrl, cocktailId, cocktailName }) => (
28+
<li key={cocktailId}>
29+
<CocktailCard src={cocktailImgUrl} name={cocktailName} nameKo={cocktailName} />
30+
</li>
31+
))}
4432
</ul>
4533
);
4634
}

0 commit comments

Comments
 (0)