sigit.io/src/routes/index.tsx

56 lines
1.2 KiB
TypeScript
Raw Normal View History

import { DecryptZip } from '../pages/decrypt'
import { HomePage } from '../pages/home'
import { LandingPage } from '../pages/landing/LandingPage'
import { Login } from '../pages/login'
2024-03-01 10:16:35 +00:00
import { ProfilePage } from '../pages/profile'
import { hexToNpub } from '../utils'
import { SignDocument } from '../pages/sign'
2024-03-22 07:46:57 +00:00
export const appPrivateRoutes = {
homePage: '/',
decryptZip: '/decrypt',
sign: '/sign'
2024-03-22 07:46:57 +00:00
}
export const appPublicRoutes = {
2024-03-01 10:16:35 +00:00
profile: '/profile/:npub',
landingPage: '/',
login: '/login',
help: 'https://help.sigit.io'
}
2024-03-01 10:16:35 +00:00
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 />
2024-03-01 10:16:35 +00:00
},
{
path: appPublicRoutes.profile,
element: <ProfilePage />
}
]
export const privateRoutes = [
{
path: appPrivateRoutes.homePage,
element: <HomePage />
},
{
path: appPrivateRoutes.decryptZip,
element: <DecryptZip />
},
{
path: appPrivateRoutes.sign,
element: <SignDocument />
}
]