-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: tanstack router 설정 * feat: tanstack router 적용
- Loading branch information
Showing
10 changed files
with
5,264 additions
and
1,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,16 @@ | ||
import { useState } from 'react'; | ||
import { Button } from '@/components/ui/button.tsx'; | ||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from './components/ui/card'; | ||
import { | ||
Section, | ||
SectionContent, | ||
SectionDescription, | ||
SectionFooter, | ||
SectionHeader, | ||
SectionTitle, | ||
} from './components/ui/section'; | ||
import { createRouter, RouterProvider } from '@tanstack/react-router'; | ||
import { routeTree } from './routeTree.gen'; | ||
|
||
const initialColumns = [ | ||
{ | ||
id: '0', | ||
title: '할 일', | ||
tasks: [ | ||
{ id: '1', title: '프로젝트 계획 수립' }, | ||
{ id: '2', title: '디자인 초안 작성' }, | ||
{ | ||
id: '5', | ||
title: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publish`, | ||
}, | ||
{ id: '6', title: '디자인 초안 작성' }, | ||
{ id: '7', title: '디자인 초안 작성' }, | ||
{ id: '8', title: '디자인 초안 작성' }, | ||
{ id: '9', title: '디자인 초안 작성' }, | ||
{ id: '10', title: '디자인 초안 작성' }, | ||
], | ||
}, | ||
{ | ||
id: '1', | ||
title: '진행 중', | ||
tasks: [ | ||
{ id: '3', title: '프론트엔드 개발' }, | ||
{ id: '11', title: '프론트엔드 개발' }, | ||
], | ||
}, | ||
{ | ||
id: '2', | ||
title: '완료', | ||
tasks: [{ id: '4', title: '요구사항 분석' }], | ||
}, | ||
]; | ||
const router = createRouter({ routeTree }); | ||
|
||
function App() { | ||
const [columns] = useState(initialColumns); | ||
|
||
return ( | ||
<div className="flex h-screen flex-col"> | ||
<div className="p-4"> | ||
<h1 className="text-primary pt-2">Welcome to Harmony!</h1> | ||
<p>Harmony 는 일정관리 서비스입니다.</p> | ||
<Button>default</Button> | ||
<Button variant="destructive">destructive</Button> | ||
<Button variant="secondary">secondary</Button> | ||
<Button variant="outline">outline</Button> | ||
<Button variant="ghost">ghost</Button> | ||
<Button variant="link">link</Button> | ||
</div> | ||
declare module '@tanstack/react-router' { | ||
interface Register { | ||
router: typeof router; | ||
} | ||
} | ||
|
||
<div className="flex flex-1 space-x-2 overflow-x-auto p-4"> | ||
{columns.map((column) => ( | ||
<Section key={column.id} className="flex w-80 flex-shrink-0 flex-col bg-[#f7f8f9]"> | ||
<SectionHeader> | ||
<SectionTitle>{column.title}</SectionTitle> | ||
<SectionDescription>섹션에 대한 추가 설명도 필요할까?</SectionDescription> | ||
</SectionHeader> | ||
<SectionContent className="flex-1 overflow-y-auto"> | ||
<div className="space-y-2"> | ||
{column.tasks.map((task) => ( | ||
<Card key={task.id} className="bg-[#ffffff]"> | ||
<CardHeader> | ||
<CardTitle>{task.title}</CardTitle> | ||
</CardHeader> | ||
<CardContent>라벨1 라벨2 라벨3</CardContent> | ||
<CardFooter>하위 이슈를 아코디언 형식으로 보여줄 것인가?</CardFooter> | ||
</Card> | ||
))} | ||
</div> | ||
</SectionContent> | ||
<SectionFooter>+ 이슈 만들기</SectionFooter> | ||
</Section> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
function App() { | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/* eslint-disable */ | ||
|
||
// @ts-nocheck | ||
|
||
// noinspection JSUnusedGlobalSymbols | ||
|
||
// This file was automatically generated by TanStack Router. | ||
// You should NOT make any changes in this file as it will be overwritten. | ||
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. | ||
|
||
// Import Routes | ||
|
||
import { Route as rootRoute } from './routes/__root'; | ||
import { Route as LoginImport } from './routes/login'; | ||
import { Route as JoinImport } from './routes/join'; | ||
import { Route as IndexImport } from './routes/index'; | ||
|
||
// Create/Update Routes | ||
|
||
const LoginRoute = LoginImport.update({ | ||
id: '/login', | ||
path: '/login', | ||
getParentRoute: () => rootRoute, | ||
} as any); | ||
|
||
const JoinRoute = JoinImport.update({ | ||
id: '/join', | ||
path: '/join', | ||
getParentRoute: () => rootRoute, | ||
} as any); | ||
|
||
const IndexRoute = IndexImport.update({ | ||
id: '/', | ||
path: '/', | ||
getParentRoute: () => rootRoute, | ||
} as any); | ||
|
||
// Populate the FileRoutesByPath interface | ||
|
||
declare module '@tanstack/react-router' { | ||
interface FileRoutesByPath { | ||
'/': { | ||
id: '/'; | ||
path: '/'; | ||
fullPath: '/'; | ||
preLoaderRoute: typeof IndexImport; | ||
parentRoute: typeof rootRoute; | ||
}; | ||
'/join': { | ||
id: '/join'; | ||
path: '/join'; | ||
fullPath: '/join'; | ||
preLoaderRoute: typeof JoinImport; | ||
parentRoute: typeof rootRoute; | ||
}; | ||
'/login': { | ||
id: '/login'; | ||
path: '/login'; | ||
fullPath: '/login'; | ||
preLoaderRoute: typeof LoginImport; | ||
parentRoute: typeof rootRoute; | ||
}; | ||
} | ||
} | ||
|
||
// Create and export the route tree | ||
|
||
export interface FileRoutesByFullPath { | ||
'/': typeof IndexRoute; | ||
'/join': typeof JoinRoute; | ||
'/login': typeof LoginRoute; | ||
} | ||
|
||
export interface FileRoutesByTo { | ||
'/': typeof IndexRoute; | ||
'/join': typeof JoinRoute; | ||
'/login': typeof LoginRoute; | ||
} | ||
|
||
export interface FileRoutesById { | ||
__root__: typeof rootRoute; | ||
'/': typeof IndexRoute; | ||
'/join': typeof JoinRoute; | ||
'/login': typeof LoginRoute; | ||
} | ||
|
||
export interface FileRouteTypes { | ||
fileRoutesByFullPath: FileRoutesByFullPath; | ||
fullPaths: '/' | '/join' | '/login'; | ||
fileRoutesByTo: FileRoutesByTo; | ||
to: '/' | '/join' | '/login'; | ||
id: '__root__' | '/' | '/join' | '/login'; | ||
fileRoutesById: FileRoutesById; | ||
} | ||
|
||
export interface RootRouteChildren { | ||
IndexRoute: typeof IndexRoute; | ||
JoinRoute: typeof JoinRoute; | ||
LoginRoute: typeof LoginRoute; | ||
} | ||
|
||
const rootRouteChildren: RootRouteChildren = { | ||
IndexRoute: IndexRoute, | ||
JoinRoute: JoinRoute, | ||
LoginRoute: LoginRoute, | ||
}; | ||
|
||
export const routeTree = rootRoute | ||
._addFileChildren(rootRouteChildren) | ||
._addFileTypes<FileRouteTypes>(); | ||
|
||
/* ROUTE_MANIFEST_START | ||
{ | ||
"routes": { | ||
"__root__": { | ||
"filePath": "__root.tsx", | ||
"children": [ | ||
"/", | ||
"/join", | ||
"/login" | ||
] | ||
}, | ||
"/": { | ||
"filePath": "index.tsx" | ||
}, | ||
"/join": { | ||
"filePath": "join.tsx" | ||
}, | ||
"/login": { | ||
"filePath": "login.tsx" | ||
} | ||
} | ||
} | ||
ROUTE_MANIFEST_END */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createRootRoute, Outlet } from '@tanstack/react-router'; | ||
import { TanStackRouterDevtools } from '@tanstack/router-devtools'; | ||
|
||
export const Route = createRootRoute({ | ||
component: () => ( | ||
<> | ||
<Outlet /> | ||
<TanStackRouterDevtools /> | ||
</> | ||
), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { createFileRoute, Link } from '@tanstack/react-router'; | ||
|
||
function HomePage() { | ||
return ( | ||
<div className="flex gap-2 p-2"> | ||
<Link to="/" className="[&.active]:font-bold"> | ||
Harmony | ||
</Link> | ||
<Link to="/login" className="[&.active]:font-bold"> | ||
Login | ||
</Link> | ||
<Link to="/join" className="[&.active]:font-bold"> | ||
Join | ||
</Link> | ||
</div> | ||
); | ||
} | ||
|
||
export const Route = createFileRoute('/')({ | ||
component: HomePage, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createFileRoute } from '@tanstack/react-router'; | ||
|
||
function RouteComponent() { | ||
return 'Hello /join!'; | ||
} | ||
|
||
export const Route = createFileRoute('/join')({ | ||
component: RouteComponent, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createFileRoute } from '@tanstack/react-router'; | ||
|
||
function RouteComponent() { | ||
return 'Hello /login!'; | ||
} | ||
|
||
export const Route = createFileRoute('/login')({ | ||
component: RouteComponent, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.