From 7141709500fa4cc3b42749e5f87fc7c83f4e054c Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Tue, 18 Jun 2024 16:06:09 +0900 Subject: [PATCH 1/2] design: Skeleton when loading on dashboard page --- gitlio/app/studio/dashboard/page.tsx | 3 ++- gitlio/components/PortfolioSkeleton.tsx | 34 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gitlio/components/PortfolioSkeleton.tsx diff --git a/gitlio/app/studio/dashboard/page.tsx b/gitlio/app/studio/dashboard/page.tsx index 69a563e..1b56e92 100644 --- a/gitlio/app/studio/dashboard/page.tsx +++ b/gitlio/app/studio/dashboard/page.tsx @@ -5,6 +5,7 @@ import { useUserStore } from '@/store/userStore'; import { getIdAfterLogin, getUserPortfolios } from '@/actions/user'; import PortfolioComponent from '@/components/PortfolioComponent'; import { useRouter } from 'next/navigation'; +import PortfolioSkeleton from '@/components/PortfolioSkeleton'; export default function DashboardPage() { const { isSignedIn, user, isLoaded } = useUser(); @@ -69,7 +70,7 @@ export default function DashboardPage() { }, [isSignedIn, user, userId]); // 의존성 배열을 최적화하여 필요한 변수들만 포함시킴 if (loading) { - return
Loading...
; + return ; } return ( diff --git a/gitlio/components/PortfolioSkeleton.tsx b/gitlio/components/PortfolioSkeleton.tsx new file mode 100644 index 0000000..3dea96e --- /dev/null +++ b/gitlio/components/PortfolioSkeleton.tsx @@ -0,0 +1,34 @@ +// components/PortfolioSkeleton.tsx +import React from 'react'; + +const PortfolioSkeleton: React.FC = () => { + return ( +
+ {Array.from({ length: 3 }).map((_, index) => ( +
+
+
+ {/* Title placeholder */} +
+ {/* Deploy status placeholder */} +
+ {/* Date placeholder */} +
+ {/* URL input placeholder */} +
+
+ {/* Delete button placeholder */} +
+ {/* Edit button placeholder */} +
+
+
+ ))} +
+ ); +}; + +export default PortfolioSkeleton; From 123e9fefb8ad3828b2e6edfa60df4c4aa67d767e Mon Sep 17 00:00:00 2001 From: Kevin Kim Date: Wed, 19 Jun 2024 00:16:12 +0900 Subject: [PATCH 2/2] design: move editor component to center --- gitlio/app/editor/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlio/app/editor/layout.tsx b/gitlio/app/editor/layout.tsx index 6445098..cb3eb62 100644 --- a/gitlio/app/editor/layout.tsx +++ b/gitlio/app/editor/layout.tsx @@ -60,8 +60,8 @@ const EditorLayout: React.FC<{ children: React.ReactNode }> = ({ {/*
*/} {/* */} {/*
*/} -
-
{children}
+
+
{children}