From e743e56787628b8503c4620a24486cd18d5fe307 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Wed, 16 Aug 2023 09:03:28 +0200 Subject: [PATCH 1/3] remove dashboard and link bar --- .../src/app/(dashboard)/documents/page.tsx | 12 ++++------ .../(dashboard)/layout/desktop-nav.tsx | 22 ++----------------- apps/web/src/components/forms/signin.tsx | 2 +- apps/web/src/middleware.ts | 2 +- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/page.tsx b/apps/web/src/app/(dashboard)/documents/page.tsx index f461d58e2..c36aa644d 100644 --- a/apps/web/src/app/(dashboard)/documents/page.tsx +++ b/apps/web/src/app/(dashboard)/documents/page.tsx @@ -18,6 +18,7 @@ import { } from '~/components/(dashboard)/period-selector/types'; import { DocumentStatus } from '~/components/formatter/document-status'; +import { UploadDocument } from '../dashboard/upload-document'; import { DocumentsDataTable } from './data-table'; export type DocumentsPageProps = { @@ -72,8 +73,8 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage return (
-

All Documents

- + +

Documents

@@ -115,16 +116,11 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
- -
- {/* If we're viewing all documents for all time and there's nuffin we should should an add document component instead */} + {/* If we're viewing all documents for all time and there's nuffin we should should show an add document component instead */} {isNoResults ? ( ) : ( diff --git a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx index d0927c323..279b8ea43 100644 --- a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx +++ b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx @@ -14,18 +14,8 @@ export const DesktopNav = ({ className, ...props }: DesktopNavProps) => { return ( ); diff --git a/apps/web/src/components/forms/signin.tsx b/apps/web/src/components/forms/signin.tsx index 449863e71..ae9540869 100644 --- a/apps/web/src/components/forms/signin.tsx +++ b/apps/web/src/components/forms/signin.tsx @@ -44,7 +44,7 @@ export const SignInForm = ({ className }: SignInFormProps) => { await signIn('credentials', { email, password, - callbackUrl: '/dashboard', + callbackUrl: '/documents', }).catch((err) => { console.error(err); }); diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index 8aabb75ea..8c7405dbe 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; export default async function middleware(req: NextRequest) { if (req.nextUrl.pathname === '/') { - const redirectUrl = new URL('/dashboard', req.url); + const redirectUrl = new URL('/documents', req.url); return NextResponse.redirect(redirectUrl); } From 90e28cd3a482759f36481d4f77a532ce47a2f333 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Wed, 16 Aug 2023 09:29:16 +0200 Subject: [PATCH 2/3] chore: status order to figma --- .../src/app/(dashboard)/documents/page.tsx | 27 ++++++++++--------- .../components/formatter/document-status.tsx | 10 +++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/page.tsx b/apps/web/src/app/(dashboard)/documents/page.tsx index c36aa644d..9a04d7ba1 100644 --- a/apps/web/src/app/(dashboard)/documents/page.tsx +++ b/apps/web/src/app/(dashboard)/documents/page.tsx @@ -78,19 +78,6 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
- - All - - - - - - - - {Math.min(stats.DRAFT, 99)} - - - @@ -111,6 +98,20 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage + + + + + + + {Math.min(stats.DRAFT, 99)} + + + + + + All + diff --git a/apps/web/src/components/formatter/document-status.tsx b/apps/web/src/components/formatter/document-status.tsx index fbe1e1a3b..4e1ccf742 100644 --- a/apps/web/src/components/formatter/document-status.tsx +++ b/apps/web/src/components/formatter/document-status.tsx @@ -13,11 +13,6 @@ type FriendlyStatus = { }; const FRIENDLY_STATUS_MAP: Record = { - DRAFT: { - label: 'Draft', - icon: File, - color: 'text-yellow-500', - }, PENDING: { label: 'Pending', icon: Clock, @@ -28,6 +23,11 @@ const FRIENDLY_STATUS_MAP: Record = { icon: CheckCircle2, color: 'text-green-500', }, + DRAFT: { + label: 'Draft', + icon: File, + color: 'text-yellow-500', + }, }; export type DocumentStatusProps = HTMLAttributes & { From 3b9c57fe5cfd23449eb54868219a11e7ae8524fe Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Wed, 16 Aug 2023 13:49:19 +0200 Subject: [PATCH 3/3] chore: remove double emtpy state add CTA --- apps/web/src/app/(dashboard)/documents/page.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/page.tsx b/apps/web/src/app/(dashboard)/documents/page.tsx index 9a04d7ba1..832d7a7af 100644 --- a/apps/web/src/app/(dashboard)/documents/page.tsx +++ b/apps/web/src/app/(dashboard)/documents/page.tsx @@ -78,7 +78,6 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
- @@ -121,12 +120,7 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
- {/* If we're viewing all documents for all time and there's nuffin we should should show an add document component instead */} - {isNoResults ? ( - - ) : ( - - )} +
);