Skip to content
Merged

Dev #157

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a47fb14
[fix] ์ฑ—๋ด‡ ์ถ”์ฒœ ํŽ˜์ด์ง€ ์ˆ˜์ • ๋ฐ ๊ธฐ๋Šฅ์ถ”๊ฐ€ (#130)
ahk0413 Oct 13, 2025
61bd59c
Design/main#11 (#131)
EunbinJung Oct 13, 2025
f071906
Style/main page 2#122 (#132)
mtm-git1018 Oct 13, 2025
bd767b0
Style/๋ฉ”์ธํŽ˜์ด์ง€ ์Šฌ๋ผ์ด๋“œ์˜์—ญ (#135)
mtm-git1018 Oct 14, 2025
1dbeb90
[fix] ๋กœ๊ทธ์•„์›ƒ ์‹œ auth/me api ์ž๋™ํ˜ธ์ถœ๋กœ 401 ์—๋Ÿฌ (#136)
ahk0413 Oct 14, 2025
993820d
Design/main#11 (#138)
EunbinJung Oct 15, 2025
d6035f4
[fix] ๋ ˆ์ด์•„์›ƒ ๋ถ„๋ฆฌ (#139)
ahk0413 Oct 15, 2025
0a71cd0
Refactor/recipe fetch (#140)
mtm-git1018 Oct 15, 2025
8ee022c
Merge remote-tracking branch 'origin/main' into dev
mtm-git1018 Oct 15, 2025
95248c2
[fix] ๊ฒฝ๋กœ ์˜ค๋ฅ˜ ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
a160b2a
๊ฒฝ๋กœ ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
9c64186
[fix] ๊ฒฝ๋กœ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
52e82c3
Feat/write#19 (#142)
EunbinJung Oct 15, 2025
3f0e6f3
[fix] MainSlide ์ˆ˜์ • (#143)
ahk0413 Oct 15, 2025
1d0e476
Refactor/์นตํ…Œ์ผ ์ •๋ ฌ ๊ธฐ๋Šฅ ์ˆ˜์ • (#144)
mtm-git1018 Oct 15, 2025
0d6c6be
Merge remote-tracking branch 'origin/main' into dev
mtm-git1018 Oct 15, 2025
c3c3644
[fix]์ถฉ๋Œ์—๋Ÿฌ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
d28a1f4
[style] ํฐํŠธ ์ถ”๊ฐ€
mtm-git1018 Oct 15, 2025
94a65e0
[fix]ํŒŒ์ผ ๋‚ด ์ฝ”๋“œ์ค‘๋ณต ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
9e976a5
[chore]ํฌ๋งคํŒ…
mtm-git1018 Oct 15, 2025
06e809c
[fix]ํƒ€์ž…์ค‘๋ณต ์ˆ˜์ •
mtm-git1018 Oct 15, 2025
fcef37f
[chore]ํฌ๋งคํŒ…
mtm-git1018 Oct 15, 2025
ca5539a
docs/ ํฐํŠธ ์ถ”๊ฐ€ ๋ฐ ์‚ญ์ œ (#146)
mtm-git1018 Oct 15, 2025
1c30893
[fix] scroll ์œ„์น˜์ด๋™
ahk0413 Oct 15, 2025
b517217
Merge remote-tracking branch 'origin/dev' into dev
ahk0413 Oct 15, 2025
ad53efa
Feat/write#19 (#147)
EunbinJung Oct 15, 2025
13fd5e1
Merge remote-tracking branch 'origin/dev' into dev
ahk0413 Oct 15, 2025
b75f7e8
[style] ํฐํŠธ ์ถ”๊ฐ€
mtm-git1018 Oct 15, 2025
0efeda3
Merge branch 'dev' of https://github.com/prgrms-web-devcourse-final-pโ€ฆ
mtm-git1018 Oct 15, 2025
82254e5
[feat] ์Šคํฌ๋กค ๋ฒ„ํŠผ ์ถ”๊ฐ€
ahk0413 Oct 15, 2025
d02add2
Merge remote-tracking branch 'origin/dev' into dev
ahk0413 Oct 15, 2025
3723a9b
[fix] ์‹œ์ž‘ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์›๋ณต
ahk0413 Oct 15, 2025
c99fd87
[docs]README
mtm-git1018 Oct 15, 2025
49a5fbd
Feat/write#19 (#148)
EunbinJung Oct 15, 2025
85690d2
Merge branch 'main' into dev
EunbinJung Oct 15, 2025
c4b7b8b
[fix] ๋กœ๊ทธ์ธ ์‹œ ์—ฌ๋Ÿฌ๋ฒˆ ๋œจ๋Š” toast ์•Œ๋ฆผ ์ด์Šˆ ์ˆ˜์ •
ahk0413 Oct 15, 2025
b3ceb95
Merge branch 'dev' of https://github.com/prgrms-web-devcourse-final-pโ€ฆ
ahk0413 Oct 15, 2025
dfe596e
fix/๋ฉ”์ธํŽ˜์ด์ง€ ์•„์ฝ”๋””์–ธ๋ฐ•์Šค ์˜ค๋ฅ˜ ์ˆ˜์ • (#151)
mtm-git1018 Oct 15, 2025
93c9bef
Merge remote-tracking branch 'origin/main' into dev
mtm-git1018 Oct 15, 2025
1353b45
[fix] ์ˆ˜์ •
EunbinJung Oct 16, 2025
ff1a17a
[fix] ๋‹ค์‹œ ์ˆ˜์ •
EunbinJung Oct 16, 2025
c7f4eb3
์ˆ˜์ •
EunbinJung Oct 16, 2025
42e2438
์ˆ˜์ •
EunbinJung Oct 16, 2025
2591b69
Merge branch 'dev' of https://github.com/prgrms-web-devcourse-final-pโ€ฆ
EunbinJung Oct 16, 2025
0498846
๋ฉ”์ธ ์นตํ…Œ์ผ๋กœ๊ณ  ๋ฐ˜์‘ํ˜•
EunbinJung Oct 16, 2025
da60f41
์ˆ˜์ •
EunbinJung Oct 16, 2025
b1394e7
Merge branch 'main' into dev
EunbinJung Oct 16, 2025
dc27ff7
next.js ์ˆ˜์ •
EunbinJung Oct 16, 2025
e154d53
Merge branch 'main' into dev
EunbinJung Oct 16, 2025
5636a66
Merge branch 'dev' of https://github.com/prgrms-web-devcourse-final-pโ€ฆ
EunbinJung Oct 16, 2025
05038f0
๋ชจ๋ฐ”์ผ๊ธ€์“ฐ๊ธฐ ์ˆ˜์ •
EunbinJung Oct 16, 2025
41adece
Merge branch 'dev' of https://github.com/prgrms-web-devcourse-final-pโ€ฆ
EunbinJung Oct 16, 2025
28b5eb0
์ธํ’‹์˜ต์…˜์ˆ˜์ •
EunbinJung Oct 16, 2025
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
8 changes: 6 additions & 2 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ const nextConfig: NextConfig = {
scrollRestoration: false,
},
images: {
domains: ['team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com'],
// ์™ธ๋ถ€ ์ด๋ฏธ์ง€ ์ตœ์ ํ™” ์™„์ „ ๋น„ํ™œ์„ฑํ™” (Vercel ์œ ๋ฃŒ ๊ธฐ๋Šฅ ํšŒํ”ผ)
unoptimized: true,
domains: [
'team2-app-s3-bucket.s3.ap-northeast-2.amazonaws.com',
'team2-app-s3-bucket.s3.amazonaws.com',
],
remotePatterns: [
{
protocol: 'https',
hostname: 'www.thecocktaildb.com',
},
],
qualities: [25, 50, 75, 90, 100],
},
env: {
NPUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
Expand Down
2 changes: 1 addition & 1 deletion src/domains/community/components/post-info/PostInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function PostInfo({
}: Props) {
return (
<ul
className="flex font-light sm:gap-3 gap-1 sm:text-sm text-xs text-gray"
className="flex font-light sm:gap-3 gap-1 sm:text-sm text-[10px] text-gray"
aria-label="๊ฒŒ์‹œ๊ธ€ ์ •๋ณด"
>
{hasUserName && (
Expand Down
12 changes: 10 additions & 2 deletions src/domains/community/write/CompleteBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@ import Button from '@/shared/components/button/Button';
type Props = {
mode: 'edit' | 'create';
setEditDone: (value: boolean) => void;
isLoading?: boolean;
};

function CompleteBtn({ mode, setEditDone }: Props) {
function CompleteBtn({ mode, setEditDone, isLoading = false }: Props) {
return (
<div className="w-full flex items-center justify-end mt-10">
<Button
type={mode === 'create' ? 'submit' : 'button'}
size="default"
color="default"
disabled={isLoading}
onClick={async () => {
setEditDone(true);
}}
>
{mode === 'create' ? '์˜ฌ๋ฆฌ๊ธฐ' : '์ˆ˜์ •ํ•˜๊ธฐ'}
{isLoading
? mode === 'create'
? '์˜ฌ๋ฆฌ๋Š” ์ค‘...'
: '์ˆ˜์ • ์ค‘...'
: mode === 'create'
? '์˜ฌ๋ฆฌ๊ธฐ'
: '์ˆ˜์ •ํ•˜๊ธฐ'}
</Button>
</div>
);
Expand Down
16 changes: 12 additions & 4 deletions src/domains/community/write/WriteSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function WriteSection({ mode, postId }: Props) {
payload.append('post', postBlob);

try {
setIsLoading(true);
const res = await fetch(`${getApi}/posts`, {
method: 'POST',
credentials: 'include',
Expand All @@ -161,10 +162,17 @@ function WriteSection({ mode, postId }: Props) {

if (res.ok) {
router.push('/community');
} else {
// ์„œ๋ฒ„ ์—๋Ÿฌ ์‘๋‹ต ์ฒ˜๋ฆฌ
const errorData = await res.json().catch(() => ({}));
const errorMessage = errorData.message || `์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. (${res.status})`;
toastError(errorMessage);
}
} catch (err) {
console.error('๊ธ€์ž‘์„ฑ ํผ ์ž‘์„ฑ ์—๋Ÿฌ', err);
return;
toastError('๋„คํŠธ์›Œํฌ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด์ฃผ์„ธ์š”.');
} finally {
setIsLoading(false);
}
};

Expand Down Expand Up @@ -275,14 +283,14 @@ function WriteSection({ mode, postId }: Props) {
e.preventDefault();
};

if (isEditLoading) <Spinner />;
if (isEditLoading) return <Spinner />;

if (isLoading) <DetailSkeleton />;
if (isLoading) return <DetailSkeleton />;

return (
<>
<form onSubmit={mode === 'create' ? handleSubmit : handleEditSubmit}>
<CompleteBtn mode={mode} setEditDone={setEditDone} />
<CompleteBtn mode={mode} setEditDone={setEditDone} isLoading={isLoading || isEditLoading} />
<section>
<FormTitle formData={formData} setFormData={setFormData} />
<Category formData={formData} setFormData={setFormData} />
Expand Down
17 changes: 14 additions & 3 deletions src/domains/community/write/image-upload/ImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ function ImageInput({ uploadedFile, onAddImage }: Props) {

const newFiles = Array.from(newFileList);

// ํŒŒ์ผ์„ ์„ ํƒํ•˜์ง€ ์•Š๊ณ  ์ทจ์†Œํ•œ ๊ฒฝ์šฐ ์กฐ์šฉํžˆ ๋ฆฌํ„ด
if (newFiles.length === 0) return;

try {
// ํŒŒ์ผ ํฌ๊ธฐ ๊ฒ€์ฆ (๋ชจ๋ฐ”์ผ ์ตœ์ ํ™”)
const maxSize = 5 * 1024 * 1024; // 5MB
const oversizedFiles = newFiles.filter((file) => file.size > maxSize);
if (oversizedFiles.length > 0) {
toastError('ํŒŒ์ผ ํฌ๊ธฐ๋Š” 5MB ์ดํ•˜๋กœ ์—…๋กœ๋“œํ•ด์ฃผ์„ธ์š”.');
return;
}

const totalLength = uploadedFile.length + newFiles.length;
if (totalLength > 10) {
toastError('์ตœ๋Œ€ 10๊ฐœ ํŒŒ์ผ๊นŒ์ง€ ์—…๋กœ๋“œํ•  ์ˆ˜ ์žˆ์–ด์š”.');
Expand Down Expand Up @@ -49,7 +60,7 @@ function ImageInput({ uploadedFile, onAddImage }: Props) {
<>
<label
htmlFor="fileInput"
className="border-3 border-dashed shrink-0 border-gray-light w-[100px] h-[100px] sm:w-[80px] sm:h-[80px] rounded-xl cursor-pointer bg-gray-dark flex flex-col gap-3 items-center justify-center hover:bg-gray-dark/70"
className="border-3 border-dashed shrink-0 border-gray-light w-[100px] h-[100px] sm:w-[80px] sm:h-[80px] rounded-xl cursor-pointer bg-gray-dark flex flex-col gap-3 items-center justify-center hover:bg-gray-dark/70 active:bg-gray-dark/50 touch-manipulation"
>
<ImageBox />
<div className="flex items-center md:text-md text-sm">
Expand All @@ -61,8 +72,8 @@ function ImageInput({ uploadedFile, onAddImage }: Props) {
<input
type="file"
id="fileInput"
hidden
accept="image/*"
className="sr-only"
accept="image/*,image/jpeg,image/jpg,image/png,image/webp"
multiple
onChange={handleInputChange}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/domains/community/write/image-upload/UploadedImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DeleteIcon from '@/shared/assets/icons/close_20.svg';
import React, { Dispatch, SetStateAction, useEffect, useRef } from 'react';
import gsap from 'gsap';
import { UploadedItem } from '@/domains/recipe/types/types';
import { useToast } from '@/shared/hook/useToast';

type Props = {
uploadedFile: UploadedItem[];
Expand All @@ -14,6 +15,7 @@ type Props = {
function UploadedImage({ uploadedFile, setUploadedFile }: Props) {
const imageRefs = useRef<HTMLElement[]>([]);
const prevLength = useRef(0);
const { toastError } = useToast();

useEffect(() => {
const isAdded = uploadedFile.length > prevLength.current;
Expand Down Expand Up @@ -71,6 +73,7 @@ function UploadedImage({ uploadedFile, setUploadedFile }: Props) {
onError={(e) => {
// 402 ์—๋Ÿฌ ๋“ฑ์œผ๋กœ ์ด๋ฏธ์ง€ ๋กœ๋”ฉ ์‹คํŒจ ์‹œ fallback ์ด๋ฏธ์ง€ ์‚ฌ์šฉ
e.currentTarget.src = '/CocktailDrop.webp';
toastError('์ด๋ฏธ์ง€๊ฐ€ ๋„ˆ๋ฌด ํฌ๊ฑฐ๋‚˜ ์†์ƒ๋˜์–ด ๊ธฐ๋ณธ ์ด๋ฏธ์ง€๋กœ ๋Œ€์ฒด๋ฉ๋‹ˆ๋‹ค.');
}}
/>
<figcaption className="sr-only">์—…๋กœ๋“œ๋œ ์ด๋ฏธ์ง€์ž…๋‹ˆ๋‹ค</figcaption>
Expand Down
17 changes: 1 addition & 16 deletions src/domains/main/cocktailDrop/CocktailDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ function CocktailDrop({ isDesktop = false }: CocktailDropProps) {
}
);

const cupElement = cupRef.current;
const logoElement = logoRef.current;

if (!cupElement || !logoElement) return;

const cupRect = cupElement.getBoundingClientRect();
const logoRect = logoElement.getBoundingClientRect();

// container ๊ธฐ์ค€ ์ƒ๋Œ€ ์œ„์น˜ ๊ณ„์‚ฐ
const containerTop = containerRef.current?.getBoundingClientRect().top || 0;
const cupTopRelative = cupRect.top - containerTop + 10;
console.log('containerTop', containerTop);
console.log('cupTopRelative', cupTopRelative);
console.log('logoRect.height', logoRect.height);

const getFinalY = (width: number): number => {
if (width >= 1800) return 200;
if (width >= 1400) return 10;
Expand All @@ -70,7 +55,7 @@ function CocktailDrop({ isDesktop = false }: CocktailDropProps) {

// ๋‚ด๋ถ€์—์„œ ์‚ฌ์šฉ
const finalY = getFinalY(window.innerWidth);
console.log('finalY', finalY);

gsap.fromTo(
logoRef.current,
{ y: -300, opacity: 0 },
Expand Down