This commit is contained in:
Manav Rathi 2024-05-26 16:03:16 +05:30
parent b2fda16561
commit babe378301
No known key found for this signature in database
3 changed files with 29 additions and 18 deletions

View file

@ -0,0 +1,24 @@
import type { AppName } from "@/next/types/app";
import {
ACCOUNTS_PAGES,
AUTH_PAGES,
PHOTOS_PAGES,
} from "@ente/shared/constants/pages";
/**
* The "home" route for each of our apps.
*
* This is where we redirect to after successful authentication.
*/
export const appHomeRoute = (appName: AppName): string => {
switch (appName) {
case "account":
return ACCOUNTS_PAGES.PASSKEYS;
case "albums":
return "/";
case "auth":
return AUTH_PAGES.AUTH;
case "photos":
return PHOTOS_PAGES.GALLERY;
}
};

View file

@ -0,0 +1,5 @@
/**
* Arbitrary names that we used as keys for indexing various constants
* corresponding to our apps.
*/
export type AppName = "account" | "albums" | "auth" | "photos";

View file

@ -1,23 +1,5 @@
import { ACCOUNTS_PAGES, AUTH_PAGES, PHOTOS_PAGES } from "../constants/pages";
/**
* Arbitrary names that we used as keys for indexing various constants
* corresponding to our apps.
*/
export type AppName = "account" | "albums" | "auth" | "photos";
/**
* The "home" route for each of our apps.
*
* This is where we redirect to, e.g, after successful authentication.
*/
export const appHomeRoute: Record<AppName, string> = {
account: ACCOUNTS_PAGES.PASSKEYS,
albums: "/",
auth: AUTH_PAGES.AUTH,
photos: PHOTOS_PAGES.GALLERY,
};
export enum APPS {
PHOTOS = "PHOTOS",
AUTH = "AUTH",