Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6b7ea7c
Feat: μŠ€μΌˆλ ˆν†€ μ»΄ν¬λ„ŒνŠΈ μΆ”κ°€
yulrang Nov 20, 2024
3257b25
πŸ› Fix: 컬럼 μˆ˜μ •
yulrang Nov 20, 2024
536f3b2
✨ Feat: λ§ˆμ΄νŽ˜μ΄μ§€ ν”„λ‘œν•„ μŠ€μΌˆλ ˆν†€ μΆ”κ°€
yulrang Nov 20, 2024
17d4514
✨ Feat: μž‘μ„±κ°€λŠ₯ν•œλ¦¬λ·° μŠ€μΌˆλ ˆν†€ μΆ”κ°€
yulrang Nov 20, 2024
59ac630
✨ Feat: λ‚˜μ˜ 리뷰 μŠ€μΌˆλ ˆν†€ μΆ”κ°€κ°€
yulrang Nov 20, 2024
e0e83ee
♿️ Fix: μ ‘κ·Όμ„± κ°œμ„ 
yulrang Nov 20, 2024
0878802
✨ Feat: λ‚˜μ˜ 약속 λ‘œλ”© μŠ€μΌˆλ ˆν†€ μΆ”κ°€
yulrang Nov 20, 2024
ff82386
πŸ’„ Design: ν˜Έλ²„μ‹œ 그림자 적용
yulrang Nov 20, 2024
f8f4f95
🚨 Fix: λΉŒλ“œ 였λ₯˜ μˆ˜μ •
yulrang Nov 20, 2024
52eb474
πŸ› Fix: DateTimePicker λ™μž‘κ°œμ„ 
yulrang Nov 20, 2024
013fde3
♿️ Fix: 크루 폼 μ ‘κ·Όμ„± κ°œμ„ 
yulrang Nov 20, 2024
8ecaabf
♿️ Fix : 약속 폼 μ ‘κ·Όμ„± κ°œμ„ 
yulrang Nov 20, 2024
fef8165
♿️ Fix: 크루찾기 μ ‘κ·Όμ„± κ°œμ„ 
yulrang Nov 20, 2024
fea5c28
πŸ› Fix: 이미지 fill, cover μ›Œλ‹ μ—†μ• κΈ°
yulrang Nov 20, 2024
de86036
Merge branch 'develop' into Fix/YoulBugFix
yulrang Nov 20, 2024
4dc9e50
Merge branch 'develop' into Fix/YoulBugFix
yulrang Nov 20, 2024
3ce5331
🍱 Fix: μƒ˜ν”Œ 이미지 ꡐ체
yulrang Nov 21, 2024
cbb4d4e
✨ Feat: 메타 μ„€μ •
yulrang Nov 21, 2024
2656c9c
Merge branch 'Fix/YoulBugFix' of https://github.com/CodeitFESI4-Team1…
yulrang Nov 21, 2024
43a4179
Merge branch 'develop' into Fix/YoulBugFix
yulrang Nov 21, 2024
43fd284
⬇️ Chore: package install
yulrang Nov 21, 2024
9260be9
πŸ› Fix: νŒŒμΌμΈν’‹ λ™μž‘ κ°œμ„ 
yulrang Nov 21, 2024
96f1e22
Co-authored-by: JEP <[email protected]>
yulrang Nov 21, 2024
0a5ab41
πŸ› Fix: FileInput λ™μž‘ κ°œμ„ 
yulrang Nov 21, 2024
5e014cf
🚨 Fix: λΉŒλ“œμ˜€λ₯˜ μˆ˜μ •
yulrang Nov 21, 2024
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
26 changes: 20 additions & 6 deletions src/app/(crew)/crew/create/_components/create-crew-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function CreateCrewForm({
</div>
<div className="flex flex-col gap-3">
<label
htmlFor="crew-category"
htmlFor="crew-mainCategory"
className="text-base font-semibold text-gray-800 md:text-xl"
>
μΉ΄ν…Œκ³ λ¦¬λ₯Ό μ„ νƒν•΄μ£Όμ„Έμš”.
Expand All @@ -167,6 +167,7 @@ export default function CreateCrewForm({
render={({ field }) => (
<DropDown
{...field}
id="crew-mainCategory"
variant="default"
inWhere="form"
placeholder={isEdit && field.value ? field.value : '메인 μΉ΄ν…Œκ³ λ¦¬'}
Expand All @@ -180,12 +181,16 @@ export default function CreateCrewForm({
/>
)}
/>
<label htmlFor="crew-subCategory" className="sr-only">
μ„ΈλΆ€ μΉ΄ν…Œκ³ λ¦¬λ₯Ό μ„ νƒν•΄μ£Όμ„Έμš”.
</label>
<Controller
name="subCategory"
control={control}
render={({ field }) => (
<DropDown
{...field}
id="crew-subCategory"
variant="default"
inWhere="form"
placeholder={isEdit && field.value ? field.value : 'μ„ΈλΆ€ μΉ΄ν…Œκ³ λ¦¬'}
Expand All @@ -199,9 +204,9 @@ export default function CreateCrewForm({
</div>

<div className="flex flex-col gap-3">
<label htmlFor="crew-image" className="text-base font-semibold text-gray-800 md:text-xl">
<span className="text-base font-semibold text-gray-800 md:text-xl">
λŒ€ν‘œμ΄λ―Έμ§€λ₯Ό μ„ νƒν•˜κ±°λ‚˜ μ²¨λΆ€ν•΄μ£Όμ„Έμš”.
</label>
</span>
Comment on lines +230 to +232
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

이미지 선택 UI의 μ‹œλ§¨ν‹± λ§ˆν¬μ—… κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

label μ—˜λ¦¬λ¨ΌνŠΈλ₯Ό span으둜 λ³€κ²½ν•˜λ©΄ 접근성이 μ €ν•˜λ  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

-          <span className="text-base font-semibold text-gray-800 md:text-xl">
+          <label htmlFor="crew-image" className="text-base font-semibold text-gray-800 md:text-xl">
            λŒ€ν‘œμ΄λ―Έμ§€λ₯Ό μ„ νƒν•˜κ±°λ‚˜ μ²¨λΆ€ν•΄μ£Όμ„Έμš”.
-          </span>
+          </label>

Committable suggestion skipped: line range outside the PR's diff.

<Controller
name="imageUrl"
control={control}
Expand Down Expand Up @@ -237,7 +242,7 @@ export default function CreateCrewForm({

<div className="flex flex-col gap-3">
<label
htmlFor="crew-category"
htmlFor="crew-mainLocation"
className="text-base font-semibold text-gray-800 md:text-xl"
>
지역을 μ„ νƒν•΄μ£Όμ„Έμš”.
Expand All @@ -250,6 +255,7 @@ export default function CreateCrewForm({
render={({ field }) => (
<DropDown
{...field}
id="crew-mainLocation"
variant="default"
inWhere="form"
placeholder={isEdit && field.value ? field.value : 'νŠΉλ³„μ‹œ/도'}
Expand All @@ -263,13 +269,17 @@ export default function CreateCrewForm({
/>
)}
/>
<label htmlFor="crew-subLocation" className="sr-only">
μ„ΈλΆ€ 지역을 μ„ νƒν•΄μ£Όμ„Έμš”.
</label>
<Controller
name="subLocation"
control={control}
rules={{ required: 'μ‹œ/κ΅°/ꡬλ₯Ό μ„ νƒν•΄μ£Όμ„Έμš”.' }}
render={({ field }) => (
<DropDown
{...field}
id="crew-subLocation"
variant="default"
inWhere="form"
placeholder={isEdit && field.value ? field.value : 'μ‹œ/κ΅°/ꡬ'}
Expand Down Expand Up @@ -314,11 +324,14 @@ export default function CreateCrewForm({
</div>
<div className="flex flex-col gap-3">
<div className="flex justify-between">
<label htmlFor="gathering-introduce" className="text-base font-semibold text-gray-800">
<label
htmlFor="crew-introduce"
className="text-base font-semibold text-gray-800 md:text-xl"
>
크루 μ†Œκ°œ
</label>
<span>
<span className="text-blue-500">{introduce?.length}</span>/100
<span className="text-blue-500">{introduce.length}</span>/100
</span>
</div>
<Controller
Expand All @@ -327,6 +340,7 @@ export default function CreateCrewForm({
render={({ field }) => (
<Textarea
{...field}
id="crew-introduce"
placeholder="크루 μ†Œκ°œκΈ€μ„ 100자 μ΄λ‚΄λ‘œ μž…λ ₯ν•΄μ£Όμ„Έμš”."
maxLength={100}
inputClassNames="h-40 py-2.5 px-4 bg-gray-100 placeholder:text-gray-400 font-pretendard text-base font-medium rounded-xl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ export default function CreateGatheringForm({
/>
</div>
<div className="flex flex-col gap-3">
<label htmlFor="gathering-image" className="text-base font-semibold text-gray-800">
이미지 선택/첨뢀
</label>
<span className="text-base font-semibold text-gray-800">이미지 선택/첨뢀</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

μ ‘κ·Όμ„± κ°œμ„ μ„ μœ„ν•΄ 의미둠적 νƒœκ·Έ μ‚¬μš© ν•„μš”

이미지 선택 λ ˆμ΄λΈ”μ΄ <span> νƒœκ·Έλ‘œ λ³€κ²½λ˜μ–΄ 접근성이 μ €ν•˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 슀크린 리더 μ‚¬μš©μžλ₯Ό μœ„ν•΄ <label> νƒœκ·Έλ‘œ λ˜λŒλ¦¬λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 μ œμ•ˆν•©λ‹ˆλ‹€:

-<span className="text-base font-semibold text-gray-800">이미지 선택/첨뢀</span>
+<label htmlFor="gathering-image" className="text-base font-semibold text-gray-800">이미지 선택/첨뢀</label>

Committable suggestion skipped: line range outside the PR's diff.

<div className="flex">
<Controller
name="imageUrl"
Expand Down Expand Up @@ -161,9 +159,7 @@ export default function CreateGatheringForm({
</div>
<div className="flex flex-col gap-3">
<div className="flex justify-between">
<label htmlFor="gathering-dateTime" className="text-base font-semibold text-gray-800">
λ‚ μ§œ
</label>
<span className="text-base font-semibold text-gray-800">λ‚ μ§œ</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

λ‚ μ§œ 선택 λ ˆμ΄λΈ”μ˜ 의미둠적 λ§ˆν¬μ—… κ°œμ„  ν•„μš”

λ‚ μ§œ 선택 λ ˆμ΄λΈ”λ„ <span> νƒœκ·Έλ‘œ λ³€κ²½λ˜μ–΄ 접근성이 μ €ν•˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 슀크린 리더 μ‚¬μš©μžλ₯Ό μœ„ν•΄ <label> νƒœκ·Έλ₯Ό μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 μ œμ•ˆν•©λ‹ˆλ‹€:

-<span className="text-base font-semibold text-gray-800">λ‚ μ§œ</span>
+<label htmlFor="gathering-datetime" className="text-base font-semibold text-gray-800">λ‚ μ§œ</label>

Committable suggestion skipped: line range outside the PR's diff.

</div>
<Controller
name="dateTime"
Expand Down Expand Up @@ -223,6 +219,7 @@ export default function CreateGatheringForm({
render={({ field }) => (
<Textarea
{...field}
id="gathering-introduce"
placeholder="λͺ¨μ§‘ μ„€λͺ…/곡지λ₯Ό 100자 μ΄λ‚΄λ‘œ μž…λ ₯ν•΄μ£Όμ„Έμš”."
maxLength={100}
inputClassNames="h-40 py-2.5 px-4 bg-gray-100 placeholder:text-gray-400 font-pretendard text-base font-medium rounded-xl"
Expand Down
5 changes: 2 additions & 3 deletions src/app/(crew)/my-crew/hosted/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Loader } from '@mantine/core';
import { useGetMyCrewHostedQuery } from '@/src/_queries/crew/my-crew-hosted-list-query';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
import CrewSkeletonList from '@/src/components/common/skeleton/crew-skeleton-list';

export default function MyCrewHostedPage() {
const { data, isLoading, error, ref, isFetchingNextPage } = useInfiniteScroll(
Expand All @@ -15,9 +16,7 @@ export default function MyCrewHostedPage() {
<div>
<CrewCardList inWhere="my-crew" data={data ?? { pages: [], pageParams: [] }} />
{isLoading || isFetchingNextPage ? (
<div className="flex justify-center py-10">
<Loader size="sm" />
</div>
<CrewSkeletonList num={6} column={1} />
) : (
<div ref={ref} className="h-[1px]" />
)}
Expand Down
5 changes: 2 additions & 3 deletions src/app/(crew)/my-crew/joined/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Loader } from '@mantine/core';
import { useGetMyCrewJoinedQuery } from '@/src/_queries/crew/my-crew-joined-list-query';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
import CrewSkeletonList from '@/src/components/common/skeleton/crew-skeleton-list';

export default function MyCrewJoinedPage() {
const { data, isLoading, error, ref, isFetchingNextPage } = useInfiniteScroll(
Expand All @@ -15,9 +16,7 @@ export default function MyCrewJoinedPage() {
<div>
<CrewCardList inWhere="my-crew" data={data ?? { pages: [], pageParams: [] }} />
{isLoading || isFetchingNextPage ? (
<div className="flex justify-center py-10">
<Loader size="sm" />
</div>
<CrewSkeletonList num={6} column={1} />
) : (
<div ref={ref} className="h-[1px]" />
)}
Expand Down
4 changes: 3 additions & 1 deletion src/app/(crew)/my-gathering/hosted/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { useGetHostedGatheringListQuery } from '@/src/_queries/my-gathering/host
import { formatDateToRequest } from '@/src/utils/format-date';
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
import MyGatheringSkeletonList from '@/src/components/common/skeleton/my-gathering-skeleton-list';
import { GatheringCardProps } from '@/src/types/gathering-data';

export default function MyGatheringHostedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [hostedGatheringList, setHostedGatheringList] = useState<GatheringCardProps[]>();

const { data, refetch } = useQuery(
const { data, isLoading, refetch } = useQuery(
useGetHostedGatheringListQuery(formatDateToRequest(selectedDate)),
);

Expand All @@ -29,6 +30,7 @@ export default function MyGatheringHostedPage() {
<div className="py-4 md:py-6">
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
</div>
{isLoading && <MyGatheringSkeletonList num={6} />}
{hostedGatheringList && <GatheringListWithDate gatheringList={hostedGatheringList} />}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

λ‘œλ”© μƒνƒœ UIκ°€ 적절히 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

μŠ€μΌˆλ ˆν†€ λ‘œλ”© μƒνƒœμ™€ 데이터 ν‘œμ‹œκ°€ 쑰건뢀 λ Œλ”λ§μœΌλ‘œ 잘 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ μ—λŸ¬ μƒνƒœ μ²˜λ¦¬κ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μ—λŸ¬ μƒνƒœ 처리λ₯Ό μΆ”κ°€ν•˜λŠ” 것을 μΆ”μ²œλ“œλ¦½λ‹ˆλ‹€:

   {isLoading && <MyGatheringSkeletonList num={6} />}
+  {error && <div className="text-red-500">데이터λ₯Ό λΆˆλŸ¬μ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.</div>}
   {hostedGatheringList && <GatheringListWithDate gatheringList={hostedGatheringList} />}

Committable suggestion skipped: line range outside the PR's diff.

</div>
);
Expand Down
4 changes: 3 additions & 1 deletion src/app/(crew)/my-gathering/joined/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { useGetJoinedGatheringListQuery } from '@/src/_queries/my-gathering/join
import { formatDateToRequest } from '@/src/utils/format-date';
import GatheringListWithDate from '@/src/app/(crew)/my-gathering/_component/gathering-list-with-date';
import PopOverCalendar from '@/src/components/common/input/pop-over-calendar';
import MyGatheringSkeletonList from '@/src/components/common/skeleton/my-gathering-skeleton-list';
import { GatheringCardProps } from '@/src/types/gathering-data';

export default function MyGatheringJoinedPage() {
const [selectedDate, setSelectedDate] = useState(new Date());
const [joinedGatheringList, setJoinedGatheringList] = useState<GatheringCardProps[]>();

const { data, refetch } = useQuery(
const { data, isLoading, refetch } = useQuery(
useGetJoinedGatheringListQuery(formatDateToRequest(selectedDate)),
);

Expand All @@ -29,6 +30,7 @@ export default function MyGatheringJoinedPage() {
<div className="py-4 md:py-6">
<PopOverCalendar value={selectedDate} onChange={(d) => setSelectedDate(d)} />
</div>
{isLoading && <MyGatheringSkeletonList num={6} />}
{joinedGatheringList && <GatheringListWithDate gatheringList={joinedGatheringList} />}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@/src/_apis/auth/user-apis';
import { useUser } from '@/src/_queries/auth/user-queries';
import { useAuth } from '@/src/hooks/use-auth';
import ProfileSkeleton from '@/src/components/common/skeleton/profile-skeleton';
import ProfileCardPresenter from './presenter';

export default function ProfileCard() {
Expand Down Expand Up @@ -38,7 +39,7 @@ export default function ProfileCard() {
}
}, [user]);

if (userLoading || !isAuthChecked) return <div>λ‘œλ”© 쀑...</div>;
if (userLoading || !isAuthChecked) return <ProfileSkeleton />;
if (!user) return null;

const handleEdit = () => {
Expand Down
15 changes: 11 additions & 4 deletions src/app/(crew)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useRef, useState } from 'react';
import Image from 'next/image';
import { Divider, Loader, TextInput } from '@mantine/core';
import { Divider, Loader, Skeleton, TextInput } from '@mantine/core';
import { useGetCrewListQuery } from '@/src/_queries/crew/crew-list-queries';
import regionData from '@/src/data/region.json';
import { useInfiniteScroll } from '@/src/hooks/use-infinite-scroll';
Expand All @@ -11,6 +11,7 @@ import HeroCrew from '@/src/app/(crew)/_components/hero/hero-crew';
import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
import Button from '@/src/components/common/input/button';
import DropDown from '@/src/components/common/input/drop-down';
import CrewSkeletonList from '@/src/components/common/skeleton/crew-skeleton-list';
import IcoSearch from '@/public/assets/icons/ic-search.svg';

export default function HomePage() {
Expand Down Expand Up @@ -102,7 +103,11 @@ export default function HomePage() {
</Button>
</div>
<div className="flex-0 flex justify-between gap-2 md:gap-4">
<label htmlFor="region" className="sr-only">
μ§€μ—­ 선택
</label>
<DropDown
id="region"
name="region"
variant="default"
data={regionData.map((dataItem) => dataItem.main)}
Expand All @@ -113,7 +118,11 @@ export default function HomePage() {
setRegion(newValue as string);
}}
/>
<label htmlFor="sort" className="sr-only">
μ •λ ¬ 선택
</label>
<DropDown
id="sort"
name="sort"
variant="sort"
data={[
Expand All @@ -133,9 +142,7 @@ export default function HomePage() {
<div className="mt-8 px-3 md:px-8 lg:px-11.5">
{data && <CrewCardList data={data} />}
{isLoading || isFetchingNextPage ? (
<div className="flex justify-center py-10">
<Loader size="sm" />
</div>
<CrewSkeletonList num={6} column={2} />
) : (
<div ref={ref} className="h-[1px]" />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/crew-list/crew-card-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function CrewCardList({ data, inWhere }: CrewCardListProps) {
);

return (
<ul className={`mx-auto grid w-full grid-cols-1 gap-x-2 gap-y-2 ${gridColsStyle}`}>
<ul className={`mx-auto grid w-full grid-cols-1 gap-x-4 gap-y-6 ${gridColsStyle}`}>
{crewDataList.map((inform) => (
<li key={inform?.id} className="w-full">
<CrewCard
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/crew-list/crew-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function CrewCard({
<div
role="presentation"
onClick={() => router.push(CREWPAGE)}
className="relative mx-auto flex h-[430px] w-full animate-fade cursor-pointer flex-col overflow-hidden rounded-[14px] bg-white shadow-bg md:h-[203px] md:flex-row"
className="relative mx-auto flex h-[430px] w-full animate-fade cursor-pointer flex-col overflow-hidden rounded-[14px] bg-white transition-shadow hover:shadow-card md:h-[203px] md:flex-row"
>
{/* 썸넀일 */}
<div className="relative h-[203px] w-full flex-shrink-0 md:w-[230px]">
Expand Down
12 changes: 10 additions & 2 deletions src/components/common/input/date-time-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ export default function DateTimePicker({ fullDate, onChange }: DateTimePickerPro
const [minute, setMinute] = useState<string | null>('λΆ„');

const handleSelect = (date: Date) => {
const newDate = new Date(selected);
const isSelected = selected;

newDate.setFullYear(Number(date.getFullYear()));
newDate.setMonth(Number(date.getMonth()));
newDate.setDate(Number(date.getDate()));

const kstDate = new Date(newDate.getTime() - newDate.getTimezoneOffset() * 60000).toISOString();

if (isSelected) {
setSelected(date);
setSelected(newDate);
onChange(kstDate);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

λ‚ μ§œ 선택 둜직 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ κ΅¬ν˜„μ—μ„œ λͺ‡ κ°€μ§€ 잠재적인 문제점이 μžˆμŠ΅λ‹ˆλ‹€:

  1. isSelected λ³€μˆ˜κ°€ 항상 trueλ₯Ό λ°˜ν™˜ν•˜μ—¬ 쑰건문이 λΆˆν•„μš”ν•©λ‹ˆλ‹€
  2. μ‹œκ°„λŒ€ λ³€ν™˜ μ‹œ 쀑볡 μ½”λ“œκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

- const newDate = new Date(selected);
- const isSelected = selected;
+ const newDate = new Date(selected);

  newDate.setFullYear(Number(date.getFullYear()));
  newDate.setMonth(Number(date.getMonth()));
  newDate.setDate(Number(date.getDate()));

  const kstDate = new Date(newDate.getTime() - newDate.getTimezoneOffset() * 60000).toISOString();

- if (isSelected) {
-   setSelected(newDate);
-   onChange(kstDate);
- }
+ setSelected(newDate);
+ onChange(kstDate);

λ˜ν•œ μ‹œκ°„λŒ€ λ³€ν™˜ λ‘œμ§μ„ λ³„λ„μ˜ μœ ν‹Έλ¦¬ν‹° ν•¨μˆ˜λ‘œ λΆ„λ¦¬ν•˜μ—¬ μž¬μ‚¬μš©μ„±μ„ λ†’μ΄λŠ” 것을 κ³ λ €ν•΄λ³΄μ„Έμš”.

πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const newDate = new Date(selected);
const isSelected = selected;
newDate.setFullYear(Number(date.getFullYear()));
newDate.setMonth(Number(date.getMonth()));
newDate.setDate(Number(date.getDate()));
const kstDate = new Date(newDate.getTime() - newDate.getTimezoneOffset() * 60000).toISOString();
if (isSelected) {
setSelected(date);
setSelected(newDate);
onChange(kstDate);
const newDate = new Date(selected);
newDate.setFullYear(Number(date.getFullYear()));
newDate.setMonth(Number(date.getMonth()));
newDate.setDate(Number(date.getDate()));
const kstDate = new Date(newDate.getTime() - newDate.getTimezoneOffset() * 60000).toISOString();
setSelected(newDate);
onChange(kstDate);

}
};

Expand Down Expand Up @@ -53,7 +61,7 @@ export default function DateTimePicker({ fullDate, onChange }: DateTimePickerPro
})}
firstDayOfWeek={0}
classNames={{
day: 'w-full aspect-square text-gray-800 data-[selected=true]:text-white flex',
day: 'w-full aspect-square text-gray-800 data-[selected=true]:text-white data-[selected=true]:rounded-xl flex',
monthCell: 'w-[calc(14.285vw-5.714px)] aspect-square md:w-[85px]',
monthsListCell:
'w-[calc(33.333vw-13.333px)] h-[10vw] md:w-[200px] md:h-[80px] text-gray-800',
Expand Down
3 changes: 3 additions & 0 deletions src/components/common/input/drop-down/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ComboboxData, Select } from '@mantine/core';
import IconArrow from '@/public/assets/icons/ic-arrow';

export interface DropDownProps {
id?: string;
variant: 'default' | 'sort';
data: ComboboxData;
name: string;
Expand All @@ -16,6 +17,7 @@ export interface DropDownProps {
}

export default function DropDown({
id,
inWhere = 'default',
name,
variant,
Expand Down Expand Up @@ -73,6 +75,7 @@ export default function DropDown({

return (
<Select
id={id}
error={error}
mt="md"
data={data}
Expand Down
18 changes: 18 additions & 0 deletions src/components/common/skeleton/crew-skeleton-list/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import CrewSkeleton from '../crew-skeleton';

interface CrewSkeletonListProps {
num: number;
column?: number;
}

export default function CrewSkeletonList({ num, column }: CrewSkeletonListProps) {
const columnStyle = column === 2 ? 'lg:grid-cols-2' : 'lg:grid-cols-1';
return (
<div className={`grid grid-cols-1 gap-x-4 gap-y-6 ${columnStyle}`} aria-label="μ½˜ν…μΈ  λ‘œλ”© 쀑">
{[...Array(num)].map((_, index) => (
// eslint-disable-next-line react/no-array-index-key
<CrewSkeleton key={index} />
))}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

λ°°μ—΄ 인덱슀λ₯Ό key둜 μ‚¬μš©ν•˜λŠ” 것은 ꢌμž₯λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

React의 μž¬μ‘°μ •(reconciliation) κ³Όμ •μ—μ„œ λ¬Έμ œκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€. 더 μ•ˆμ •μ μΈ key 생성 방법을 κ³ λ €ν•΄λ³΄μ„Έμš”.

λ‹€μŒκ³Ό 같이 κ°œμ„ ν•΄λ³΄μ„Έμš”:

-{[...Array(num)].map((_, index) => (
-  // eslint-disable-next-line react/no-array-index-key
-  <CrewSkeleton key={index} />
-))}
+{[...Array(num)].map((_, index) => (
+  <CrewSkeleton key={`crew-skeleton-${index}-${Date.now()}`} />
+))}

Committable suggestion skipped: line range outside the PR's diff.

</div>
);
}
15 changes: 15 additions & 0 deletions src/components/common/skeleton/crew-skeleton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Skeleton } from '@mantine/core';

export default function CrewSkeleton() {
return (
<div className="flex overflow-hidden rounded-xl">
<Skeleton className="h-[203px] w-[230px]" />
<div className="relative flex flex-1 flex-col gap-2 p-6">
<Skeleton className="h-4 w-20" />
<Skeleton className="h-4 w-32" />
<Skeleton className="h-4 w-40" />
<Skeleton className="absolute bottom-6 left-6 right-6 h-2 w-auto" />
</div>
</div>
);
}
Loading
Loading