chore: made requested changes - v2

Signed-off-by: Adithya Krishna <adikrish@redhat.com>
This commit is contained in:
Adithya Krishna
2023-08-28 12:53:51 +05:30
committed by Mythie
parent 5ca4a7e117
commit a7e43c5d77
3 changed files with 69 additions and 93 deletions

View File

@ -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">

View File

@ -58,12 +58,6 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
return `/documents?${params.toString()}`; return `/documents?${params.toString()}`;
}; };
const documentStatuses = [
InternalDocumentStatus.PENDING,
InternalDocumentStatus.COMPLETED,
InternalDocumentStatus.DRAFT,
];
return ( return (
<div className="mx-auto w-full max-w-screen-xl px-4 md:px-8"> <div className="mx-auto w-full max-w-screen-xl px-4 md:px-8">
<UploadDocument /> <UploadDocument />
@ -73,17 +67,35 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
<div className="mt-8 flex flex-wrap gap-x-4 gap-y-6"> <div className="mt-8 flex flex-wrap gap-x-4 gap-y-6">
<Tabs defaultValue={status} className="overflow-x-auto"> <Tabs defaultValue={status} className="overflow-x-auto">
<TabsList> <TabsList>
{documentStatuses.map((status) => ( <TabsTrigger className="min-w-[60px]" value={InternalDocumentStatus.PENDING} asChild>
<TabsTrigger key={status} className="min-w-[60px]" value={status} asChild> <Link href={getTabHref(InternalDocumentStatus.PENDING)}>
<Link href={getTabHref(status)}> <DocumentStatus status={InternalDocumentStatus.PENDING} />
<DocumentStatus status={status} />
<span className="ml-1 hidden opacity-50 md:inline-block"> <span className="ml-1 hidden opacity-50 md:inline-block">
{Math.min(stats[status], 99)} {Math.min(stats.PENDING, 99)}
</span> </span>
</Link> </Link>
</TabsTrigger> </TabsTrigger>
))}
<TabsTrigger className="min-w-[60px]" value={InternalDocumentStatus.COMPLETED} asChild>
<Link href={getTabHref(InternalDocumentStatus.COMPLETED)}>
<DocumentStatus status={InternalDocumentStatus.COMPLETED} />
<span className="ml-1 hidden opacity-50 md:inline-block">
{Math.min(stats.COMPLETED, 99)}
</span>
</Link>
</TabsTrigger>
<TabsTrigger className="min-w-[60px]" value={InternalDocumentStatus.DRAFT} asChild>
<Link href={getTabHref(InternalDocumentStatus.DRAFT)}>
<DocumentStatus status={InternalDocumentStatus.DRAFT} />
<span className="ml-1 hidden opacity-50 md:inline-block">
{Math.min(stats.DRAFT, 99)}
</span>
</Link>
</TabsTrigger>
<TabsTrigger className="min-w-[60px]" value="ALL" asChild> <TabsTrigger className="min-w-[60px]" value="ALL" asChild>
<Link href={getTabHref('ALL')}>All</Link> <Link href={getTabHref('ALL')}>All</Link>

View File

@ -3,7 +3,7 @@ import { HTMLAttributes } from 'react';
import Image from 'next/image'; import Image from 'next/image';
import Link from 'next/link'; import Link from 'next/link';
import { Github, Slack, Twitter } from 'lucide-react'; import { Github, MessagesSquare, Twitter } from 'lucide-react';
import { cn } from '@documenso/ui/lib/utils'; import { cn } from '@documenso/ui/lib/utils';
@ -12,17 +12,17 @@ export type FooterProps = HTMLAttributes<HTMLDivElement>;
const SOCIAL_LINKS = [ const SOCIAL_LINKS = [
{ href: 'https://twitter.com/documenso', icon: <Twitter className="h-6 w-6" /> }, { 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://github.com/documenso/documenso', icon: <Github className="h-6 w-6" /> },
{ href: 'https://documenso.slack.com', icon: <Slack 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: '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) => {
const footerLinks = [
{ href: '/pricing', text: 'Pricing' },
{ href: 'https://status.documenso.com', text: 'Status', target: '_blank' },
{ href: 'mailto:support@documenso.com', text: 'Support' },
// { href: '/privacy', text: 'Privacy'}
];
return ( return (
<div className={cn('border-t py-12', className)} {...props}> <div className={cn('border-t py-12', className)} {...props}>
<div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8"> <div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8">
@ -41,7 +41,7 @@ export const Footer = ({ className, ...props }: FooterProps) => {
</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">
{footerLinks.map((link, index) => ( {FOOTER_LINKS.map((link, index) => (
<Link <Link
key={index} key={index}
href={link.href} href={link.href}