added Profile Page and Change password (also included breadcrumb
This commit is contained in:
18
src/routes/(app)/(auth)/change-password.tsx
Normal file
18
src/routes/(app)/(auth)/change-password.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import ChangePasswordForm from '@/components/form/change-password-form'
|
||||
import i18n from '@/lib/i18n'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/(auth)/change-password')({
|
||||
component: RouteComponent,
|
||||
staticData: { breadcrumb: i18n.t('nav.change_password') },
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="@container/main flex flex-1 flex-col gap-2 p-4">
|
||||
<div className="*:data-[slot=card]:from-primary/5 *:data-[slot=card]:to-card dark:*:data-[slot=card]:bg-card *:data-[slot=card]:bg-gradient-to-br *:data-[slot=card]:shadow-xs grid grid-cols-1 @xl/main:grid-cols-2 @5xl/main:grid-cols-3 gap-4">
|
||||
<ChangePasswordForm />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
9
src/routes/(app)/(auth)/dashboard.tsx
Normal file
9
src/routes/(app)/(auth)/dashboard.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/(auth)/dashboard')({
|
||||
component: RouteComponent,
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Hello "/(app)/dashboard"!</div>
|
||||
}
|
||||
18
src/routes/(app)/(auth)/profile.tsx
Normal file
18
src/routes/(app)/(auth)/profile.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import ProfileForm from '@/components/form/profile-form'
|
||||
import i18n from '@/lib/i18n'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/(auth)/profile')({
|
||||
component: RouteComponent,
|
||||
staticData: { breadcrumb: i18n.t('nav.profile') },
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="@container/main flex flex-1 flex-col gap-2 p-4">
|
||||
<div className="*:data-[slot=card]:from-primary/5 *:data-[slot=card]:to-card dark:*:data-[slot=card]:bg-card *:data-[slot=card]:bg-gradient-to-br *:data-[slot=card]:shadow-xs grid grid-cols-1 @xl/main:grid-cols-2 @5xl/main:grid-cols-3 gap-4">
|
||||
<ProfileForm />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { authMiddleware } from '@/lib/middleware'
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
import { createFileRoute, Outlet, redirect } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/dashboard')({
|
||||
export const Route = createFileRoute('/(app)/(auth)')({
|
||||
beforeLoad: async ({ context }) => {
|
||||
if (!context.userSession) {
|
||||
throw redirect({ to: '/sign-in' })
|
||||
@@ -14,5 +14,5 @@ export const Route = createFileRoute('/(app)/dashboard')({
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Hello "/(app)/dashboard"!</div>
|
||||
return <Outlet />
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
import i18n from '@/lib/i18n'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/(app)/')({ component: App })
|
||||
export const Route = createFileRoute('/(app)/')({
|
||||
component: App,
|
||||
staticData: { breadcrumb: i18n.t('nav.home') },
|
||||
})
|
||||
|
||||
function App() {
|
||||
return <div className="min-h-screen bg-linear-to-b ">Home</div>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const Route = createFileRoute('/(app)')({
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<AuthProvider>
|
||||
<SidebarProvider defaultOpen={true}>
|
||||
<SidebarProvider defaultOpen={false}>
|
||||
<AppSidebar />
|
||||
<SidebarInset>
|
||||
<Header />
|
||||
|
||||
Reference in New Issue
Block a user