Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WRFE-63](feat): 백오피스 사이드바 컴포넌트 구현 #69

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions apps/admin/app/@content/announcement/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>AnnouncementPage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/category/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>CategoryPage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Default() {
return null;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/main-page/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>Main-PagePage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/push-notice/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>PushNoticePage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/raffle-event/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>RaffleEventPage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/recommend-keyword/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>KeywordPage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/settlement/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>SettlementPage</div>;
}
3 changes: 3 additions & 0 deletions apps/admin/app/@content/user/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div className='w-full'>UserPage</div>;
}
40 changes: 40 additions & 0 deletions apps/admin/app/@sidebar/_components/SideBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import SideBarTab from './SideBarTab.tsx';
import Image from 'next/image';

export default function SideBar() {
return (
<div className='flex h-full w-full flex-col space-y-10 bg-[#F3F4F6] p-8'>
{/* 헤더 */}
<div className='w-full'>
{/* 로고 */}
<div className='mb-4 h-auto w-1/2'>
<Image
src='/logo.png'
alt='logo'
width={102}
height={57}
layout='responsive'
/>
</div>

{/* 계정정보 */}
<div className='flex flex-col rounded bg-white p-2'>
<p className='font-bold text-[#4D5562]'>어드민</p>
<p className='text-[#777777]'>[email protected]</p>
</div>
</div>

{/* 탭 */}
<div className='flex w-full flex-col gap-y-4'>
<SideBarTab href='/user'>회원 관리</SideBarTab>
<SideBarTab href='/settlement'>정산 관리</SideBarTab>
<SideBarTab href='/raffle-event'>래플/이벤트 관리</SideBarTab>
<SideBarTab href='/category'>카테고리 관리</SideBarTab>
<SideBarTab href='/push-notice'>푸시 알림 관리</SideBarTab>
<SideBarTab href='/recommend-keyword'>추천 검색어 관리</SideBarTab>
<SideBarTab href='/announcement'>공지사항 관리</SideBarTab>
<SideBarTab href='/main-page'>메인 페이지 관리</SideBarTab>
</div>
</div>
);
}
39 changes: 39 additions & 0 deletions apps/admin/app/@sidebar/_components/SideBarTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use client';

import Link from 'next/link';
import {usePathname} from 'next/navigation';
import {Icon} from '@wraffle/ui';

export default function SideBarTab({
children,
href,
}: {
children: React.ReactNode;
href: string;
}) {
const path = usePathname();
const isActive = href === path;
return (
<Link href={href}>
<div className='group flex flex-row items-center justify-between'>
<p
className={
isActive ? 'p-2 font-bold text-[#4E5968]' : 'p-2 text-[#4E5968]'
}
>
{children}
</p>
<Icon
name='arrow-right'
stroke='#B0B8C1'
width={12}
height={12}
className={`transition-opacity duration-300 ${
isActive ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'
}`}
/>
</div>
</Link>
);
}
`p-2 text-[#4E5968]`;
11 changes: 11 additions & 0 deletions apps/admin/app/@sidebar/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import SideBar from './_components/SideBar';

export default function Home() {
return (
<main className='flex h-screen flex-col items-start justify-between bg-white'>
<div className='h-full w-[14%] min-w-[240px]'>
<SideBar />
</div>
</main>
);
}
Binary file removed apps/admin/app/favicon.ico
Binary file not shown.
26 changes: 19 additions & 7 deletions apps/admin/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
import './globals.css';
import type {Metadata} from 'next';
import {Inter} from 'next/font/google';
import IconLoader from '@wraffle/ui/src/ui/icon/IconLoader';

const inter = Inter({subsets: ['latin']});

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: 'Wraffle Admin',
description: 'Wraffle Admin',
icons: {
icon: '/favicon.png',
},
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
sidebar,
content,
}: {
sidebar: React.ReactNode;
content: React.ReactNode;
}) {
return (
<html lang='en'>
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<div className='flex h-screen w-screen flex-row bg-white'>
{IconLoader}
{sidebar}
{content}
</div>
</body>
</html>
);
}
112 changes: 1 addition & 111 deletions apps/admin/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,113 +1,3 @@
import Image from 'next/image';

export default function Home() {
return (
<main className='flex min-h-screen flex-col items-center justify-between p-24'>
<div className='z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex'>
<p className='fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:dark:bg-zinc-800/30'>
Get started by editing&nbsp;
<code className='font-mono font-bold'>app/page.tsx</code>
</p>
<div className='fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white lg:static lg:size-auto lg:bg-none dark:from-black dark:via-black'>
<a
className='pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0'
href='https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app'
target='_blank'
rel='noopener noreferrer'
>
By{' '}
<Image
src='/vercel.svg'
alt='Vercel Logo'
className='dark:invert'
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className="before:bg-gradient-radial after:bg-gradient-conic relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full before:-translate-x-1/2 before:rounded-full before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full after:translate-x-1/3 after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40">
<Image
className='relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert'
src='/next.svg'
alt='Next.js Logo'
width={180}
height={37}
priority
/>
</div>

<div className='mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left'>
<a
href='https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app'
className='group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30'
target='_blank'
rel='noopener noreferrer'
>
<h2 className='mb-3 text-2xl font-semibold'>
Docs{' '}
<span className='inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none'>
-&gt;
</span>
</h2>
<p className='m-0 max-w-[30ch] text-sm opacity-50'>
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href='https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app'
className='group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30'
target='_blank'
rel='noopener noreferrer'
>
<h2 className='mb-3 text-2xl font-semibold'>
Learn{' '}
<span className='inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none'>
-&gt;
</span>
</h2>
<p className='m-0 max-w-[30ch] text-sm opacity-50'>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href='https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app'
className='group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30'
target='_blank'
rel='noopener noreferrer'
>
<h2 className='mb-3 text-2xl font-semibold'>
Templates{' '}
<span className='inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none'>
-&gt;
</span>
</h2>
<p className='m-0 max-w-[30ch] text-sm opacity-50'>
Explore starter templates for Next.js.
</p>
</a>

<a
href='https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app'
className='group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30'
target='_blank'
rel='noopener noreferrer'
>
<h2 className='mb-3 text-2xl font-semibold'>
Deploy{' '}
<span className='inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none'>
-&gt;
</span>
</h2>
<p className='m-0 max-w-[30ch] text-balance text-sm opacity-50'>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
);
return null;
}
3 changes: 3 additions & 0 deletions apps/admin/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const nextConfig = {
};
return config;
},
experimental: {
optimizePackageImports: ['@wraffle/ui'],
},
};

export default nextConfig;
3 changes: 3 additions & 0 deletions apps/admin/public/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/admin/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/admin/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion apps/admin/public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion apps/admin/public/vercel.svg

This file was deleted.