2023-09-20 20:28:34 +00:00
|
|
|
import trimEnd from 'lodash/trimEnd';
|
|
|
|
|
|
|
|
// Make all route paths 'absolute' for easier
|
|
|
|
// href creation
|
|
|
|
export const Routes = {
|
|
|
|
HOME: '/',
|
2023-10-16 18:18:26 +00:00
|
|
|
MARKETS: '/markets',
|
2023-09-20 20:28:34 +00:00
|
|
|
MARKET: '/markets/:marketId',
|
|
|
|
LIQUIDITY: '/liquidity/:marketId',
|
|
|
|
PORTFOLIO: '/portfolio',
|
|
|
|
DISCLAIMER: '/disclaimer',
|
|
|
|
ASSETS: '/portfolio/assets',
|
|
|
|
DEPOSIT: '/portfolio/assets/deposit',
|
|
|
|
WITHDRAW: '/portfolio/assets/withdraw',
|
|
|
|
TRANSFER: '/portfolio/assets/transfer',
|
2023-09-21 13:25:19 +00:00
|
|
|
REFERRALS: '/referrals',
|
|
|
|
REFERRALS_APPLY_CODE: '/referrals/apply-code',
|
|
|
|
REFERRALS_CREATE_CODE: '/referrals/create-code',
|
2024-01-31 14:21:29 +00:00
|
|
|
COMPETITIONS: '/competitions',
|
|
|
|
COMPETITIONS_TEAMS: '/competitions/teams',
|
|
|
|
COMPETITIONS_TEAM: '/competitions/teams/:teamId',
|
|
|
|
COMPETITIONS_CREATE_TEAM: '/competitions/teams/create',
|
|
|
|
COMPETITIONS_CREATE_TEAM_SOLO: '/competitions/teams/create?solo=true',
|
|
|
|
COMPETITIONS_UPDATE_TEAM: '/competitions/teams/:teamId/update',
|
2023-10-25 21:59:30 +00:00
|
|
|
FEES: '/fees',
|
2023-11-15 21:46:19 +00:00
|
|
|
REWARDS: '/rewards',
|
2023-09-20 20:28:34 +00:00
|
|
|
} as const;
|
|
|
|
|
|
|
|
type ConsoleLinks = {
|
|
|
|
[R in keyof typeof Routes]: (...args: string[]) => string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Links: ConsoleLinks = {
|
|
|
|
HOME: () => Routes.HOME,
|
|
|
|
MARKET: (marketId: string) =>
|
|
|
|
trimEnd(Routes.MARKET.replace(':marketId', marketId)),
|
|
|
|
MARKETS: () => Routes.MARKETS,
|
|
|
|
PORTFOLIO: () => Routes.PORTFOLIO,
|
|
|
|
LIQUIDITY: (marketId: string) =>
|
|
|
|
trimEnd(Routes.LIQUIDITY.replace(':marketId', marketId)),
|
|
|
|
DISCLAIMER: () => Routes.DISCLAIMER,
|
|
|
|
ASSETS: () => Routes.ASSETS,
|
|
|
|
DEPOSIT: () => Routes.DEPOSIT,
|
|
|
|
WITHDRAW: () => Routes.WITHDRAW,
|
|
|
|
TRANSFER: () => Routes.TRANSFER,
|
2023-09-21 13:25:19 +00:00
|
|
|
REFERRALS: () => Routes.REFERRALS,
|
|
|
|
REFERRALS_APPLY_CODE: () => Routes.REFERRALS_APPLY_CODE,
|
|
|
|
REFERRALS_CREATE_CODE: () => Routes.REFERRALS_CREATE_CODE,
|
2024-01-31 14:21:29 +00:00
|
|
|
COMPETITIONS: () => Routes.COMPETITIONS,
|
|
|
|
COMPETITIONS_TEAMS: () => Routes.COMPETITIONS_TEAMS,
|
|
|
|
COMPETITIONS_TEAM: (teamId: string) =>
|
|
|
|
Routes.COMPETITIONS_TEAM.replace(':teamId', teamId),
|
|
|
|
COMPETITIONS_CREATE_TEAM: () => Routes.COMPETITIONS_CREATE_TEAM,
|
|
|
|
COMPETITIONS_CREATE_TEAM_SOLO: () => Routes.COMPETITIONS_CREATE_TEAM_SOLO,
|
|
|
|
COMPETITIONS_UPDATE_TEAM: (teamId: string) =>
|
|
|
|
Routes.COMPETITIONS_UPDATE_TEAM.replace(':teamId', teamId),
|
2023-10-25 21:59:30 +00:00
|
|
|
FEES: () => Routes.FEES,
|
2023-11-15 21:46:19 +00:00
|
|
|
REWARDS: () => Routes.REWARDS,
|
2023-09-20 20:28:34 +00:00
|
|
|
};
|