Skip to content

Commit c6a7350

Browse files
authored
feat: 어드민 Bruno API 테스트(Postman) 페이지 추가 (#445)
* feat: 어드민 공통 사이드바와 textarea 컴포넌트 추가 * feat: 어드민 Bruno API 테스트 페이지 추가
1 parent 5ff1cde commit c6a7350

5 files changed

Lines changed: 495 additions & 39 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Building2, FileText, FlaskConical, UserCircle2 } from "lucide-react";
2+
import { cn } from "@/lib/utils";
3+
4+
interface AdminSidebarProps {
5+
activeMenu: "scores" | "bruno";
6+
}
7+
8+
const sideMenus = [
9+
{ key: "university", label: "대학 관리", icon: Building2 },
10+
{ key: "mentor", label: "멘토 관리", icon: UserCircle2 },
11+
{ key: "user", label: "유저 관리", icon: UserCircle2 },
12+
{ key: "scores", label: "성적 관리", icon: FileText, to: "/scores" as const },
13+
{ key: "bruno", label: "Bruno API", icon: FlaskConical, to: "/bruno" as const },
14+
] as const;
15+
16+
export function AdminSidebar({ activeMenu }: AdminSidebarProps) {
17+
return (
18+
<aside className="flex w-[212px] flex-col border-r border-k-100 bg-bg-100 px-5 py-7">
19+
<div className="mb-10">
20+
<p className="typo-sb-11 text-primary">Solid Connection</p>
21+
<h1 className="mt-1 typo-bold-1 tracking-[-0.03em] text-primary-700">
22+
Admin
23+
<br />
24+
boards
25+
</h1>
26+
</div>
27+
28+
<p className="mb-4 typo-sb-11 text-k-400">관리 메뉴</p>
29+
<nav className="space-y-1.5">
30+
{sideMenus.map((menu) => {
31+
const isActive = menu.key === activeMenu;
32+
const menuClassName = cn(
33+
"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left typo-medium-3 transition-colors",
34+
isActive ? "bg-primary-100 text-primary" : "text-k-400 hover:bg-k-0 hover:text-k-700",
35+
);
36+
37+
if ("to" in menu) {
38+
return (
39+
<a key={menu.label} href={menu.to} className={menuClassName}>
40+
<menu.icon className="h-4 w-4" />
41+
{menu.label}
42+
</a>
43+
);
44+
}
45+
46+
return (
47+
<button key={menu.label} type="button" className={menuClassName} disabled>
48+
<menu.icon className="h-4 w-4" />
49+
{menu.label}
50+
</button>
51+
);
52+
})}
53+
</nav>
54+
</aside>
55+
);
56+
}

apps/admin/src/components/ui/textarea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"tex
77
return (
88
<textarea
99
className={cn(
10-
"flex min-h-20 w-full rounded-md border border-k-200 bg-k-0 px-3 py-2 typo-regular-4 text-k-700 shadow-sm transition-colors placeholder:text-k-400 focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
10+
"flex min-h-24 w-full rounded-md border border-k-200 bg-k-0 px-3 py-2 typo-regular-4 text-k-700 shadow-sm transition-colors placeholder:text-k-400 focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
1111
className,
1212
)}
1313
ref={ref}

apps/admin/src/routeTree.gen.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import { Route as rootRouteImport } from './routes/__root'
1212
import { Route as IndexRouteImport } from './routes/index'
1313
import { Route as ScoresIndexRouteImport } from './routes/scores/index'
14+
import { Route as BrunoIndexRouteImport } from './routes/bruno/index'
1415
import { Route as AuthLoginRouteImport } from './routes/auth/login'
1516

1617
const IndexRoute = IndexRouteImport.update({
@@ -23,6 +24,11 @@ const ScoresIndexRoute = ScoresIndexRouteImport.update({
2324
path: '/scores/',
2425
getParentRoute: () => rootRouteImport,
2526
} as any)
27+
const BrunoIndexRoute = BrunoIndexRouteImport.update({
28+
id: '/bruno/',
29+
path: '/bruno/',
30+
getParentRoute: () => rootRouteImport,
31+
} as any)
2632
const AuthLoginRoute = AuthLoginRouteImport.update({
2733
id: '/auth/login',
2834
path: '/auth/login',
@@ -32,30 +38,34 @@ const AuthLoginRoute = AuthLoginRouteImport.update({
3238
export interface FileRoutesByFullPath {
3339
'/': typeof IndexRoute
3440
'/auth/login': typeof AuthLoginRoute
41+
'/bruno/': typeof BrunoIndexRoute
3542
'/scores/': typeof ScoresIndexRoute
3643
}
3744
export interface FileRoutesByTo {
3845
'/': typeof IndexRoute
3946
'/auth/login': typeof AuthLoginRoute
47+
'/bruno': typeof BrunoIndexRoute
4048
'/scores': typeof ScoresIndexRoute
4149
}
4250
export interface FileRoutesById {
4351
__root__: typeof rootRouteImport
4452
'/': typeof IndexRoute
4553
'/auth/login': typeof AuthLoginRoute
54+
'/bruno/': typeof BrunoIndexRoute
4655
'/scores/': typeof ScoresIndexRoute
4756
}
4857
export interface FileRouteTypes {
4958
fileRoutesByFullPath: FileRoutesByFullPath
50-
fullPaths: '/' | '/auth/login' | '/scores/'
59+
fullPaths: '/' | '/auth/login' | '/bruno/' | '/scores/'
5160
fileRoutesByTo: FileRoutesByTo
52-
to: '/' | '/auth/login' | '/scores'
53-
id: '__root__' | '/' | '/auth/login' | '/scores/'
61+
to: '/' | '/auth/login' | '/bruno' | '/scores'
62+
id: '__root__' | '/' | '/auth/login' | '/bruno/' | '/scores/'
5463
fileRoutesById: FileRoutesById
5564
}
5665
export interface RootRouteChildren {
5766
IndexRoute: typeof IndexRoute
5867
AuthLoginRoute: typeof AuthLoginRoute
68+
BrunoIndexRoute: typeof BrunoIndexRoute
5969
ScoresIndexRoute: typeof ScoresIndexRoute
6070
}
6171

@@ -75,6 +85,13 @@ declare module '@tanstack/react-router' {
7585
preLoaderRoute: typeof ScoresIndexRouteImport
7686
parentRoute: typeof rootRouteImport
7787
}
88+
'/bruno/': {
89+
id: '/bruno/'
90+
path: '/bruno'
91+
fullPath: '/bruno/'
92+
preLoaderRoute: typeof BrunoIndexRouteImport
93+
parentRoute: typeof rootRouteImport
94+
}
7895
'/auth/login': {
7996
id: '/auth/login'
8097
path: '/auth/login'
@@ -88,6 +105,7 @@ declare module '@tanstack/react-router' {
88105
const rootRouteChildren: RootRouteChildren = {
89106
IndexRoute: IndexRoute,
90107
AuthLoginRoute: AuthLoginRoute,
108+
BrunoIndexRoute: BrunoIndexRoute,
91109
ScoresIndexRoute: ScoresIndexRoute,
92110
}
93111
export const routeTree = rootRouteImport

0 commit comments

Comments
 (0)