Skip to content

Commit

Permalink
Merge pull request #71 from TU-GitLio/design/#70
Browse files Browse the repository at this point in the history
(#70) Skeleton when loading on dashboard page
  • Loading branch information
POL6463 authored Jun 19, 2024
2 parents f67aa73 + 123e9fe commit 2e5e634
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gitlio/app/editor/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const EditorLayout: React.FC<{ children: React.ReactNode }> = ({
{/*<div className="fixed left-0 top-16 bottom-0">*/}
{/* <LeftSidebar />*/}
{/*</div>*/}
<div className="flex flex-col flex-grow mt-24 overflow-auto">
<div className="px-4 ml-60 mb-16">{children}</div>
<div className="flex flex-col flex-grow mt-24 overflow-auto mr-[450px] mb-16 justify-center items-center">
<div className="px-4">{children}</div>
</div>
<div className="fixed right-0 top-16 bottom-0">
<BaseSideBar />
Expand Down
3 changes: 2 additions & 1 deletion gitlio/app/studio/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -69,7 +70,7 @@ export default function DashboardPage() {
}, [isSignedIn, user, userId]); // 의존성 배열을 최적화하여 필요한 변수들만 포함시킴

if (loading) {
return <div>Loading...</div>;
return <PortfolioSkeleton />;
}

return (
Expand Down
34 changes: 34 additions & 0 deletions gitlio/components/PortfolioSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// components/PortfolioSkeleton.tsx
import React from 'react';

const PortfolioSkeleton: React.FC = () => {
return (
<div className="flex flex-row flex-wrap">
{Array.from({ length: 3 }).map((_, index) => (
<div
key={index}
className="card w-96 shadow-xl border m-2 animate-pulse"
>
<div className="card-body">
<div className="skeleton h-6 w-full mb-4"></div>
{/* Title placeholder */}
<div className="skeleton h-4 w-3/4 mb-2"></div>
{/* Deploy status placeholder */}
<div className="skeleton h-4 w-full mb-2"></div>
{/* Date placeholder */}
<div className="skeleton h-4 w-full mb-4"></div>
{/* URL input placeholder */}
<div className="flex justify-between mt-2">
<div className="skeleton h-8 w-8 rounded-full"></div>
{/* Delete button placeholder */}
<div className="skeleton h-8 w-16"></div>
{/* Edit button placeholder */}
</div>
</div>
</div>
))}
</div>
);
};

export default PortfolioSkeleton;

0 comments on commit 2e5e634

Please sign in to comment.