sigit.io/src/routes/index.tsx
2024-05-20 17:48:10 +03:00

63 lines
1.3 KiB
TypeScript

import { HomePage } from '../pages/home'
import { CreatePage } from '../pages/create'
import { LandingPage } from '../pages/landing/LandingPage'
import { Login } from '../pages/login'
import { ProfilePage } from '../pages/profile'
import { hexToNpub } from '../utils'
import { RelaysPage } from '../pages/relays'
import { SignPage } from '../pages/sign'
export const appPrivateRoutes = {
homePage: '/',
create: '/create',
verify: '/verify',
relays: '/relays',
sign: '/sign'
}
export const appPublicRoutes = {
profile: '/profile/:npub',
landingPage: '/',
login: '/login',
help: 'https://help.sigit.io'
}
export const getProfileRoute = (hexKey: string) =>
appPublicRoutes.profile.replace(':npub', hexToNpub(hexKey))
export const publicRoutes = [
{
path: appPublicRoutes.landingPage,
hiddenWhenLoggedIn: true,
element: <LandingPage />
},
{
path: appPublicRoutes.login,
hiddenWhenLoggedIn: true,
element: <Login />
},
{
path: appPublicRoutes.profile,
element: <ProfilePage />
}
]
export const privateRoutes = [
{
path: appPrivateRoutes.homePage,
element: <HomePage />
},
{
path: appPrivateRoutes.create,
element: <CreatePage />
},
{
path: appPrivateRoutes.relays,
element: <RelaysPage />
},
{
path: appPrivateRoutes.sign,
element: <SignPage />
}
]