summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/lib/routeHelpers.ts
blob: 50c5867768588bb175370ce883b1a0a2e761725e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { generatePath } from 'react-router';

import { RoutePath } from './routes';

export type GeneratedRoutePath = { routePath: string };

export const disableDismissForRoutes = [
  RoutePath.launch,
  RoutePath.login,
  RoutePath.tooManyDevices,
  RoutePath.deviceRevoked,
  RoutePath.main,
  RoutePath.redeemVoucher,
  RoutePath.voucherSuccess,
  RoutePath.timeAdded,
  RoutePath.setupFinished,
];

export function generateRoutePath(
  routePath: RoutePath,
  parameters: Parameters<typeof generatePath>[1],
): GeneratedRoutePath {
  return { routePath: generatePath(routePath, parameters) };
}