Skip to content

Instantly share code, notes, and snippets.

@Nightbr
Last active January 2, 2023 08:18
Show Gist options
  • Save Nightbr/c41a0390454ea36d0bd6caf96823396a to your computer and use it in GitHub Desktop.
Save Nightbr/c41a0390454ea36d0bd6caf96823396a to your computer and use it in GitHub Desktop.
Create type safe links functions without React deps (From Chicane router)
import { createLinks } from './create-links';
// Search params constants
export const TOKEN_SEARCH_PARAMS = 'token';
// Here we list all our application pages
export const routes = {
AppArea: '/*',
AppRoot: '/',
// Auth
Login: '/login?:redirect',
ForgetPassword: '/forget-password',
ResetPassword: `/reset-password?:${TOKEN_SEARCH_PARAMS}`,
Register: '/register?:redirect',
RedeemInvite: `/redeem-invite?:${TOKEN_SEARCH_PARAMS}`,
} as const;
export const Links = createLinks(routes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment