@@ -101,7 +92,11 @@ export default function Content({ userId, type }: ContentProps) {
)}
{isLoading ? (
-
+
+ {new Array(4).fill(0).map((_, index) => (
+
+ ))}
+
) : (
{lists.map((list) => (
diff --git a/src/app/user/[userId]/_components/FollowButton.tsx b/src/app/user/[userId]/_components/FollowButton.tsx
index 7095956c..68bd174a 100644
--- a/src/app/user/[userId]/_components/FollowButton.tsx
+++ b/src/app/user/[userId]/_components/FollowButton.tsx
@@ -1,5 +1,3 @@
-'use client';
-
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { AxiosError } from 'axios';
@@ -26,9 +24,8 @@ interface FollowButtonProps {
}
export default function FollowButton({ isFollowed, userId }: FollowButtonProps) {
- const { language } = useLanguage();
-
const queryClient = useQueryClient();
+ const { language } = useLanguage();
const { user: userMe } = useUser();
const { isOn, handleSetOff, handleSetOn } = useBooleanOutput();
@@ -85,6 +82,7 @@ export default function FollowButton({ isFollowed, userId }: FollowButtonProps)
diff --git a/src/app/user/[userId]/_components/MasonryGridSkeleton.tsx b/src/app/user/[userId]/_components/MasonryGridSkeleton.tsx
deleted file mode 100644
index ebdf3ea1..00000000
--- a/src/app/user/[userId]/_components/MasonryGridSkeleton.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Skeleton } from '@mui/material';
-import * as styles from './SkeletonDesign.css';
-
-export default function MasonryGridSkeleton() {
- return (
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/app/user/[userId]/_components/Profile.css.ts b/src/app/user/[userId]/_components/Profile.css.ts
index 47bef79e..6148000f 100644
--- a/src/app/user/[userId]/_components/Profile.css.ts
+++ b/src/app/user/[userId]/_components/Profile.css.ts
@@ -48,6 +48,18 @@ export const profileContainer = style({
},
});
+export const skeletonProfileContainer = style({
+ paddingBottom: '3rem',
+ display: 'flex',
+ alignItems: 'center',
+ gap: '1.2rem',
+});
+
+export const skeletonTextContainer = style({
+ display: 'flex',
+ flexDirection: 'column',
+});
+
export const icon = style({
cursor: 'pointer',
});
diff --git a/src/app/user/[userId]/_components/Profile.tsx b/src/app/user/[userId]/_components/Profile.tsx
index b61c8ad4..586923a7 100644
--- a/src/app/user/[userId]/_components/Profile.tsx
+++ b/src/app/user/[userId]/_components/Profile.tsx
@@ -1,17 +1,18 @@
'use client';
import Image from 'next/image';
+import Link from 'next/link';
import { useState } from 'react';
import { useQuery } from '@tanstack/react-query';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import { AxiosError } from 'axios';
+import { Skeleton } from '@mui/material';
import * as styles from './Profile.css';
-import * as modalStyles from '@/components/Modal/ModalButton.css';
import FollowButton from './FollowButton';
+import Modal from '@/components/Modal/Modal';
import SettingIcon from '/public/icons/setting.svg';
-import ProfileSkeleton from './ProfileSkeleton';
import useMoveToPage from '@/hooks/useMoveToPage';
import getUserOne from '@/app/_api/user/getUserOne';
@@ -20,19 +21,18 @@ import { QUERY_KEYS } from '@/lib/constants/queryKeys';
import { UserType } from '@/lib/types/userProfileType';
import numberFormatter from '@/lib/utils/numberFormatter';
-import Modal from '@/components/Modal/Modal';
import { userLocale } from '@/app/user/locale';
import { useLanguage } from '@/store/useLanguage';
export default function Profile({ userId }: { userId: number }) {
const { language } = useLanguage();
- const [hasError, setHasError] = useState(false);
+ const [hasImageError, setHasImageError] = useState(false);
const { onClickMoveToPage } = useMoveToPage();
const fallbackProfileImageSrc = '/images/fallback_profileImage.webp';
const fallbackBackgroundImageSrc = '/images/fallback_backgroundImage.webp';
- const { data, isFetching, error, isError } = useQuery({
+ const { data, error, isError, isLoading } = useQuery({
queryKey: [QUERY_KEYS.userOne, userId],
queryFn: () => getUserOne(userId),
retry: 1,
@@ -43,18 +43,13 @@ export default function Profile({ userId }: { userId: number }) {
return (
{error.response?.data.detail}
-
-
-
+ {userLocale[language].confirm}
);
}
const handleImageError = () => {
- // TODO onError일때 적용할 이미지 공통 로직 만들기
- setHasError(true);
+ setHasImageError(true);
};
return (
@@ -64,18 +59,18 @@ export default function Profile({ userId }: { userId: number }) {
[styles.imageUrl]: `url(${data ? data?.backgroundImageUrl : fallbackBackgroundImageSrc})`,
})}
>
-
- {data?.isOwner && (
-
- )}
-
+
+ {data?.isOwner && }
+
- {isFetching ? (
-
+ {isLoading ? (
+
) : (
<>
@@ -83,7 +78,7 @@ export default function Profile({ userId }: { userId: number }) {
{data?.profileImageUrl ? (
}
-
+
{data?.followingCount !== undefined && numberFormatter(data.followingCount, 'ko')}
{userLocale[language].following}
-
-
+
+
{data?.followerCount !== undefined && numberFormatter(data.followerCount, 'ko')}
- {userLocale[language].follow}
-
+
{userLocale[language].follower}
+
diff --git a/src/app/user/[userId]/_components/ProfileSkeleton.tsx b/src/app/user/[userId]/_components/ProfileSkeleton.tsx
deleted file mode 100644
index 8afc0b6e..00000000
--- a/src/app/user/[userId]/_components/ProfileSkeleton.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Skeleton } from '@mui/material';
-import * as styles from './SkeletonDesign.css';
-
-export default function ProfileSkeleton() {
- return (
-
- );
-}
diff --git a/src/app/user/[userId]/_components/SkeletonDesign.css.ts b/src/app/user/[userId]/_components/SkeletonDesign.css.ts
deleted file mode 100644
index b2fc0a9b..00000000
--- a/src/app/user/[userId]/_components/SkeletonDesign.css.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { style } from '@vanilla-extract/css';
-
-export const gridContainer = style({
- display: 'grid',
- gridTemplateColumns: 'repeat(2, 1fr)',
- rowGap: '1.6rem',
- columnGap: '1.2rem',
-});
-
-export const categoryContainer = style({
- display: 'flex',
- justifyContent: 'center',
- alignItems: 'center',
- gap: '1.5rem',
-});
-
-export const profileContainer = style({
- paddingBottom: '3rem',
- display: 'flex',
- alignItems: 'center',
- gap: '1.2rem',
-});
-
-export const textContainer = style({
- display: 'flex',
- flexDirection: 'column',
-});
diff --git a/src/components/floatingButton/ArrowUpFloatingButton.tsx b/src/components/floatingButton/ArrowUpFloatingButton.tsx
index 84431574..03d84214 100644
--- a/src/components/floatingButton/ArrowUpFloatingButton.tsx
+++ b/src/components/floatingButton/ArrowUpFloatingButton.tsx
@@ -4,13 +4,15 @@ import { useState } from 'react';
import * as styles from './FloatingContainer.css';
import ArrowUpIcon from '/public/icons/arrow_up.svg';
+
import useThrottle from '@/hooks/useThrottle';
-import { commonLocale } from '@/components/locale';
import { useLanguage } from '@/store/useLanguage';
+import { commonLocale } from '@/components/locale';
+
export default function ArrowUpFloatingButton() {
- const { language } = useLanguage();
const [isVisible, setIsVisible] = useState(false);
+ const { language } = useLanguage();
const visibleButton = () => {
if (window.scrollY < 700) {
diff --git a/src/components/floatingButton/PlusOptionFloatingButton.tsx b/src/components/floatingButton/PlusOptionFloatingButton.tsx
index 434ed74c..21bd625d 100644
--- a/src/components/floatingButton/PlusOptionFloatingButton.tsx
+++ b/src/components/floatingButton/PlusOptionFloatingButton.tsx
@@ -9,22 +9,21 @@ import ShareAltIcon from '/public/icons/share_alt.svg';
import WriteIcon from '/public/icons/write.svg';
import useBooleanOutput from '@/hooks/useBooleanOutput';
-import toasting from '@/lib/utils/toasting';
-import toastMessage from '@/lib/constants/toastMessage';
import { useUser } from '@/store/useUser';
+import { useLanguage } from '@/store/useLanguage';
import copyUrl from '@/lib/utils/copyUrl';
import LoginModal from '@/components/login/LoginModal';
import Modal from '@/components/Modal/Modal';
import { commonLocale } from '@/components/locale';
-import { useLanguage } from '@/store/useLanguage';
function FloatingMenu() {
- const { language } = useLanguage();
const router = useRouter();
const path = usePathname();
+
const { user } = useUser();
const { isOn, handleSetOn, handleSetOff } = useBooleanOutput();
+ const { language } = useLanguage();
const handleSharePage = () => {
// TODO 카카오 공유하기 기능으로 변경하기
From 47578e8ca701629784ed21e44f33c007ec4fecf7 Mon Sep 17 00:00:00 2001
From: Eugene Ahn <70089733+Eugene-A-01@users.noreply.github.com>
Date: Fri, 15 Mar 2024 21:43:43 +0900
Subject: [PATCH 2/2] =?UTF-8?q?Hotfix:=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95=20API=20=EC=9A=94=EC=B2=AD=EC=8B=9C=20?=
=?UTF-8?q?=EC=BD=9C=EB=9D=BC=EB=B3=B4=EB=A0=88=EC=9D=B4=ED=84=B0=20ID=20?=
=?UTF-8?q?=EB=AA=A9=EB=A1=9D=EC=97=90=20=EB=B3=B8=EC=9D=B8ID=20=EC=A0=9C?=
=?UTF-8?q?=EC=99=B8=20(#211)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/list/[listId]/edit/page.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/list/[listId]/edit/page.tsx b/src/app/list/[listId]/edit/page.tsx
index 83a4c651..143afee5 100644
--- a/src/app/list/[listId]/edit/page.tsx
+++ b/src/app/list/[listId]/edit/page.tsx
@@ -63,7 +63,7 @@ export default function EditPage() {
//데이터 쪼개기
const listData: ListEditType = {
...originData,
- collaboratorIds: originData.collaboratorIds.length === 0 ? [] : [...originData.collaboratorIds, user.id],
+ collaboratorIds: originData.collaboratorIds,
items: originData.items.map(({ imageUrl, ...rest }) => {
if (typeof imageUrl === 'string') {
return {