sigit.io/src/routes/index.tsx

71 lines
1.6 KiB
TypeScript
Raw Normal View History

import { HomePage } from '../pages/home'
2024-05-15 13:41:55 +05:00
import { CreatePage } from '../pages/create'
import { LandingPage } from '../pages/landing/LandingPage'
import { Login } from '../pages/login'
2024-03-01 15:16:35 +05:00
import { ProfilePage } from '../pages/profile'
import { hexToNpub } from '../utils'
2024-05-15 16:11:57 +05:00
import { SignPage } from '../pages/sign'
2024-05-16 10:40:56 +05:00
import { VerifyPage } from '../pages/verify'
2024-05-21 09:07:52 +02:00
import { ProfileSettingsPage } from '../pages/settings/profile'
2024-03-22 12:46:57 +05:00
export const appPrivateRoutes = {
homePage: '/',
2024-05-15 13:41:55 +05:00
create: '/create',
2024-05-16 10:40:56 +05:00
sign: '/sign',
2024-05-21 09:07:52 +02:00
verify: '/verify',
profileSettings: '/settings/profile/:npub'
2024-03-22 12:46:57 +05:00
}
export const appPublicRoutes = {
2024-03-01 15:16:35 +05:00
profile: '/profile/:npub',
landingPage: '/',
login: '/login',
help: 'https://help.sigit.io'
}
2024-03-01 15:16:35 +05:00
export const getProfileRoute = (hexKey: string) =>
appPublicRoutes.profile.replace(':npub', hexToNpub(hexKey))
2024-05-21 09:07:52 +02:00
export const getProfileSettingsRoute = (hexKey: string) =>
appPrivateRoutes.profileSettings.replace(':npub', hexToNpub(hexKey))
export const publicRoutes = [
{
path: appPublicRoutes.landingPage,
hiddenWhenLoggedIn: true,
element: <LandingPage />
},
{
path: appPublicRoutes.login,
hiddenWhenLoggedIn: true,
element: <Login />
2024-03-01 15:16:35 +05:00
},
{
path: appPublicRoutes.profile,
element: <ProfilePage />
}
]
export const privateRoutes = [
{
path: appPrivateRoutes.homePage,
element: <HomePage />
},
{
2024-05-15 13:41:55 +05:00
path: appPrivateRoutes.create,
element: <CreatePage />
},
{
2024-05-15 16:11:57 +05:00
path: appPrivateRoutes.sign,
element: <SignPage />
2024-05-16 10:40:56 +05:00
},
{
path: appPrivateRoutes.verify,
element: <VerifyPage />
2024-05-21 09:07:52 +02:00
},
{
path: appPrivateRoutes.profileSettings,
element: <ProfileSettingsPage />
}
]