From d72792fe0ae83c3ded343aa7b54b1d23a3346f76 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 29 Oct 2025 23:39:49 +0100 Subject: [PATCH] loginview --- frontend/src/index.jsx | 80 +----------------------------- frontend/src/login/LoginView.jsx | 83 ++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 79 deletions(-) create mode 100644 frontend/src/login/LoginView.jsx diff --git a/frontend/src/index.jsx b/frontend/src/index.jsx index f6ad885..84afce2 100644 --- a/frontend/src/index.jsx +++ b/frontend/src/index.jsx @@ -35,6 +35,7 @@ import { createDocumentsSurface } from './documents/DocumentsTable'; import { createPreviewSurface } from './preview/PreviewWorkspace'; import { createDesktopSurface } from './DesktopWorkspace'; import { AppShellContext, useAppShell } from './appShellContext'; +import LoginView from './login/LoginView'; const ASSET_PRESIGN_TTL_MS = 240 * 1000; // backend issues 5 min tokens; refresh slightly early const TAG_MIME_TYPES = ['application/x-papercrate-tag', 'text/papercrate-tag']; @@ -384,11 +385,6 @@ const createRootNode = () => ({ hasChildren: false, }); -const StatusBanner = ({ status }) => { - if (!status) return null; - return
{status.message}
; -}; - const DropOverlay = ({ active, folderName }) => (
@@ -397,80 +393,6 @@ const DropOverlay = ({ active, folderName }) => (
); -const LoginView = ({ - onSubmit, - status, - tenantSelection, - onSelectTenant, - onCancelSelection, - selectingTenantId, -}) => { - const hasTenantSelection = Boolean(tenantSelection?.tenants?.length); - - return ( -
-
-

Papercrate

- {hasTenantSelection ? ( -
-

Select a tenant to finish signing in.

-
- {tenantSelection.tenants.map((tenant) => ( - - ))} -
- -
- ) : ( - <> -

Authenticate to manage your documents.

-
- - - - - -
- - )} - -
-
- ); -}; - const DocumentsLayout = ({ sidebarProps, children, sidebarCollapsed }) => ( diff --git a/frontend/src/login/LoginView.jsx b/frontend/src/login/LoginView.jsx new file mode 100644 index 0000000..346716e --- /dev/null +++ b/frontend/src/login/LoginView.jsx @@ -0,0 +1,83 @@ +import React from 'react'; + +const StatusBanner = ({ status }) => { + if (!status) return null; + return
{status.message}
; +}; + +const LoginView = ({ + onSubmit, + status, + tenantSelection, + onSelectTenant, + onCancelSelection, + selectingTenantId, +}) => { + const hasTenantSelection = Boolean(tenantSelection?.tenants?.length); + + return ( +
+
+

Papercrate

+ {hasTenantSelection ? ( +
+

Select a tenant to finish signing in.

+
+ {tenantSelection.tenants.map((tenant) => ( + + ))} +
+ +
+ ) : ( + <> +

Authenticate to manage your documents.

+
+ + + + + +
+ + )} + +
+
+ ); +}; + +export default LoginView; +