From 720b1d77d14b5ce95d9a9caadcbf99a7f8ea760d Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 9 Nov 2023 13:52:03 +0530 Subject: [PATCH] add auth page --- .../src/components}/AuthFooter.tsx | 0 .../pages/auth => auth/src/components}/Navbar.tsx | 6 +++--- .../src/components}/OTPDisplay.tsx | 0 .../src/components}/TimerProgress.tsx | 0 apps/{photos => auth}/src/pages/auth/index.tsx | 12 ++++++------ .../services/authenticator/authenticatorService.ts | 0 apps/{photos => auth}/src/types/authenticator/api.ts | 0 .../{photos => auth}/src/types/authenticator/code.ts | 0 .../shared/components/OverflowMenu/context.tsx | 0 .../shared}/components/OverflowMenu/menu.tsx | 2 +- .../shared}/components/OverflowMenu/option.tsx | 0 11 files changed, 10 insertions(+), 10 deletions(-) rename apps/{photos/src/components/Authenicator => auth/src/components}/AuthFooter.tsx (100%) rename apps/{photos/src/components/pages/auth => auth/src/components}/Navbar.tsx (84%) rename apps/{photos/src/components/Authenicator => auth/src/components}/OTPDisplay.tsx (100%) rename apps/{photos/src/components/Authenicator => auth/src/components}/TimerProgress.tsx (100%) rename apps/{photos => auth}/src/pages/auth/index.tsx (92%) rename apps/{photos => auth}/src/services/authenticator/authenticatorService.ts (100%) rename apps/{photos => auth}/src/types/authenticator/api.ts (100%) rename apps/{photos => auth}/src/types/authenticator/code.ts (100%) rename apps/photos/src/contexts/overflowMenu.tsx => packages/shared/components/OverflowMenu/context.tsx (100%) rename {apps/photos/src => packages/shared}/components/OverflowMenu/menu.tsx (97%) rename {apps/photos/src => packages/shared}/components/OverflowMenu/option.tsx (100%) diff --git a/apps/photos/src/components/Authenicator/AuthFooter.tsx b/apps/auth/src/components/AuthFooter.tsx similarity index 100% rename from apps/photos/src/components/Authenicator/AuthFooter.tsx rename to apps/auth/src/components/AuthFooter.tsx diff --git a/apps/photos/src/components/pages/auth/Navbar.tsx b/apps/auth/src/components/Navbar.tsx similarity index 84% rename from apps/photos/src/components/pages/auth/Navbar.tsx rename to apps/auth/src/components/Navbar.tsx index fe8d83c22..59505efe0 100644 --- a/apps/photos/src/components/pages/auth/Navbar.tsx +++ b/apps/auth/src/components/Navbar.tsx @@ -1,11 +1,11 @@ -import { HorizontalFlex } from 'components/Container'; +import { HorizontalFlex } from '@ente/shared/components/Container'; import NavbarBase from '@ente/shared/components/Navbar/base'; import React from 'react'; import { t } from 'i18next'; import { logoutUser } from '@ente/accounts/services/user'; import { EnteLogo } from '@ente/shared/components/EnteLogo'; -import OverflowMenu from 'components/OverflowMenu/menu'; -import { OverflowMenuOption } from 'components/OverflowMenu/option'; +import OverflowMenu from '@ente/shared/components/OverflowMenu/menu'; +import { OverflowMenuOption } from '@ente/shared/components/OverflowMenu/option'; import MoreHoriz from '@mui/icons-material/MoreHoriz'; import LogoutOutlined from '@mui/icons-material/LogoutOutlined'; import { AppContext } from 'pages/_app'; diff --git a/apps/photos/src/components/Authenicator/OTPDisplay.tsx b/apps/auth/src/components/OTPDisplay.tsx similarity index 100% rename from apps/photos/src/components/Authenicator/OTPDisplay.tsx rename to apps/auth/src/components/OTPDisplay.tsx diff --git a/apps/photos/src/components/Authenicator/TimerProgress.tsx b/apps/auth/src/components/TimerProgress.tsx similarity index 100% rename from apps/photos/src/components/Authenicator/TimerProgress.tsx rename to apps/auth/src/components/TimerProgress.tsx diff --git a/apps/photos/src/pages/auth/index.tsx b/apps/auth/src/pages/auth/index.tsx similarity index 92% rename from apps/photos/src/pages/auth/index.tsx rename to apps/auth/src/pages/auth/index.tsx index 0f4993028..ec9ba6be5 100644 --- a/apps/photos/src/pages/auth/index.tsx +++ b/apps/auth/src/pages/auth/index.tsx @@ -1,17 +1,17 @@ import React, { useContext, useEffect, useState } from 'react'; -import OTPDisplay from 'components/Authenicator/OTPDisplay'; +import OTPDisplay from 'components/OTPDisplay'; import { getAuthCodes } from 'services/authenticator/authenticatorService'; -import { CustomError } from 'utils/error'; +import { CustomError } from '@ente/shared/error'; import { PHOTOS_PAGES as PAGES } from '@ente/shared/constants/pages'; import { useRouter } from 'next/router'; -import { AuthFooter } from 'components/Authenicator/AuthFooter'; +import { AuthFooter } from 'components/AuthFooter'; import { AppContext } from 'pages/_app'; import { TextField } from '@mui/material'; -import AuthNavbar from 'components/pages/auth/Navbar'; +import AuthNavbar from 'components/Navbar'; import { t } from 'i18next'; import EnteSpinner from '@ente/shared/components/EnteSpinner'; -import { VerticallyCentered } from 'components/Container'; -import InMemoryStore, { MS_KEYS } from 'services/InMemoryStore'; +import { VerticallyCentered } from '@ente/shared/components/Container'; +import InMemoryStore, { MS_KEYS } from '@ente/shared/storage/InMemoryStore'; const AuthenticatorCodesPage = () => { const appContext = useContext(AppContext); diff --git a/apps/photos/src/services/authenticator/authenticatorService.ts b/apps/auth/src/services/authenticator/authenticatorService.ts similarity index 100% rename from apps/photos/src/services/authenticator/authenticatorService.ts rename to apps/auth/src/services/authenticator/authenticatorService.ts diff --git a/apps/photos/src/types/authenticator/api.ts b/apps/auth/src/types/authenticator/api.ts similarity index 100% rename from apps/photos/src/types/authenticator/api.ts rename to apps/auth/src/types/authenticator/api.ts diff --git a/apps/photos/src/types/authenticator/code.ts b/apps/auth/src/types/authenticator/code.ts similarity index 100% rename from apps/photos/src/types/authenticator/code.ts rename to apps/auth/src/types/authenticator/code.ts diff --git a/apps/photos/src/contexts/overflowMenu.tsx b/packages/shared/components/OverflowMenu/context.tsx similarity index 100% rename from apps/photos/src/contexts/overflowMenu.tsx rename to packages/shared/components/OverflowMenu/context.tsx diff --git a/apps/photos/src/components/OverflowMenu/menu.tsx b/packages/shared/components/OverflowMenu/menu.tsx similarity index 97% rename from apps/photos/src/components/OverflowMenu/menu.tsx rename to packages/shared/components/OverflowMenu/menu.tsx index d6d984d8c..1e1c0e0c3 100644 --- a/apps/photos/src/components/OverflowMenu/menu.tsx +++ b/packages/shared/components/OverflowMenu/menu.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import Menu from '@mui/material/Menu'; import { IconButton, PaperProps, styled } from '@mui/material'; -import { OverflowMenuContext } from 'contexts/overflowMenu'; +import { OverflowMenuContext } from './context'; export interface Iprops { triggerButtonIcon: React.ReactNode; diff --git a/apps/photos/src/components/OverflowMenu/option.tsx b/packages/shared/components/OverflowMenu/option.tsx similarity index 100% rename from apps/photos/src/components/OverflowMenu/option.tsx rename to packages/shared/components/OverflowMenu/option.tsx