Merge pull request #313 from adithyaakrishna/feat/improve-readability

feat: improve readability and rendering of some components
This commit is contained in:
Lucas Smith
2023-08-31 14:08:52 +10:00
committed by GitHub
3 changed files with 56 additions and 76 deletions
@@ -9,6 +9,22 @@ import { cn } from '@documenso/ui/lib/utils';
export type FooterProps = HTMLAttributes<HTMLDivElement>; export type FooterProps = HTMLAttributes<HTMLDivElement>;
const SOCIAL_LINKS = [
{ href: 'https://twitter.com/documenso', icon: <Twitter className="h-6 w-6" /> },
{ href: 'https://github.com/documenso/documenso', icon: <Github className="h-6 w-6" /> },
{ href: 'https://documen.so/discord', icon: <MessagesSquare className="h-6 w-6" /> },
];
const FOOTER_LINKS = [
{ href: '/pricing', text: 'Pricing' },
{ href: '/blog', text: 'Blog' },
{ href: '/open', text: 'Open' },
{ href: 'https://shop.documenso.com', text: 'Shop', target: '_blank' },
{ href: 'https://status.documenso.com', text: 'Status', target: '_blank' },
{ href: 'mailto:support@documenso.com', text: 'Support' },
{ href: '/privacy', text: 'Privacy' },
];
export const Footer = ({ className, ...props }: FooterProps) => { export const Footer = ({ className, ...props }: FooterProps) => {
return ( return (
<div className={cn('border-t py-12', className)} {...props}> <div className={cn('border-t py-12', className)} {...props}>
@@ -19,77 +35,25 @@ export const Footer = ({ className, ...props }: FooterProps) => {
</Link> </Link>
<div className="mt-4 flex flex-wrap items-center gap-x-4 gap-y-4 text-[#8D8D8D]"> <div className="mt-4 flex flex-wrap items-center gap-x-4 gap-y-4 text-[#8D8D8D]">
<Link {SOCIAL_LINKS.map((link, index) => (
href="https://twitter.com/documenso" <Link key={index} href={link.href} target="_blank" className="hover:text-[#6D6D6D]">
target="_blank" {link.icon}
className="hover:text-[#6D6D6D]" </Link>
> ))}
<Twitter className="h-6 w-6" />
</Link>
<Link
href="https://github.com/documenso/documenso"
target="_blank"
className="hover:text-[#6D6D6D]"
>
<Github className="h-6 w-6" />
</Link>
<Link
href="https://documen.so/discord"
target="_blank"
className="hover:text-[#6D6D6D]"
>
<MessagesSquare className="h-6 w-6" />
</Link>
</div> </div>
</div> </div>
<div className="flex flex-wrap items-center gap-x-4 gap-y-2.5"> <div className="flex flex-wrap items-center gap-x-4 gap-y-2.5">
<Link {FOOTER_LINKS.map((link, index) => (
href="/pricing" <Link
className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]" key={index}
> href={link.href}
Pricing target={link.target}
</Link> className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"
>
<Link href="/blog" className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"> {link.text}
Blog </Link>
</Link> ))}
<Link href="/open" className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]">
Open
</Link>
<Link
href="https://shop.documenso.com"
target="_blank"
className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"
>
Shop
</Link>
<Link
href="https://status.documenso.com"
target="_blank"
className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"
>
Status
</Link>
<Link
href="mailto:support@documenso.com"
className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"
>
Support
</Link>
<Link
href="/privacy"
className="flex-shrink-0 text-sm text-[#8D8D8D] hover:text-[#6D6D6D]"
>
Privacy
</Link>
</div> </div>
</div> </div>
<div className="mx-auto mt-4 w-full max-w-screen-xl px-8 md:mt-12 lg:mt-24"> <div className="mx-auto mt-4 w-full max-w-screen-xl px-8 md:mt-12 lg:mt-24">
@@ -5,6 +5,7 @@ import { Clock, File, FileCheck } from 'lucide-react';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { findDocuments } from '@documenso/lib/server-only/document/find-documents'; import { findDocuments } from '@documenso/lib/server-only/document/find-documents';
import { getStats } from '@documenso/lib/server-only/document/get-stats'; import { getStats } from '@documenso/lib/server-only/document/get-stats';
import { DocumentStatus as InternalDocumentStatus } from '@documenso/prisma/client';
import { import {
Table, Table,
TableBody, TableBody,
@@ -21,6 +22,24 @@ import { LocaleDate } from '~/components/formatter/locale-date';
import { UploadDocument } from './upload-document'; import { UploadDocument } from './upload-document';
const CARD_DATA = [
{
icon: FileCheck,
title: 'Completed',
status: InternalDocumentStatus.COMPLETED,
},
{
icon: File,
title: 'Drafts',
status: InternalDocumentStatus.DRAFT,
},
{
icon: Clock,
title: 'Pending',
status: InternalDocumentStatus.PENDING,
},
];
export default async function DashboardPage() { export default async function DashboardPage() {
const user = await getRequiredServerComponentSession(); const user = await getRequiredServerComponentSession();
@@ -39,15 +58,11 @@ export default async function DashboardPage() {
<h1 className="text-4xl font-semibold">Dashboard</h1> <h1 className="text-4xl font-semibold">Dashboard</h1>
<div className="mt-8 grid grid-cols-1 gap-4 md:grid-cols-3"> <div className="mt-8 grid grid-cols-1 gap-4 md:grid-cols-3">
<Link href={'/documents?status=COMPLETED'} passHref> {CARD_DATA.map((card) => (
<CardMetric icon={FileCheck} title="Completed" value={stats.COMPLETED} /> <Link key={card.status} href={`/documents?status=${card.status}`}>
</Link> <CardMetric icon={card.icon} title={card.title} value={stats[card.status]} />
<Link href={'/documents?status=DRAFT'} passHref> </Link>
<CardMetric icon={File} title="Drafts" value={stats.DRAFT} /> ))}
</Link>
<Link href={'/documents?status=PENDING'} passHref>
<CardMetric icon={Clock} title="Pending" value={stats.PENDING} />
</Link>
</div> </div>
<div className="mt-12"> <div className="mt-12">
@@ -136,6 +136,7 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => {
{state === 'signed-text' && ( {state === 'signed-text' && (
<p className="font-signature text-muted-foreground text-lg duration-200 sm:text-xl md:text-2xl lg:text-3xl"> <p className="font-signature text-muted-foreground text-lg duration-200 sm:text-xl md:text-2xl lg:text-3xl">
{/* This optional chaining is intentional, we don't want to move the check into the condition above */}
{signature?.typedSignature} {signature?.typedSignature}
</p> </p>
)} )}