mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
fix: UI fixes and improvements (#559)
* chore: add cursor pointer * fix: tooltip color * chore: add tooltip * fix: admin pages in mobile
This commit is contained in:
@ -46,6 +46,9 @@ export const BarMetric = <T extends Record<string, Record<keyof T[string], unkno
|
|||||||
<XAxis dataKey="month" />
|
<XAxis dataKey="month" />
|
||||||
<YAxis />
|
<YAxis />
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
labelStyle={{
|
||||||
|
color: 'hsl(var(--primary-foreground))',
|
||||||
|
}}
|
||||||
itemStyle={{
|
itemStyle={{
|
||||||
color: 'hsl(var(--primary-foreground))',
|
color: 'hsl(var(--primary-foreground))',
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ export const CapTable = ({ className, ...props }: CapTableProps) => {
|
|||||||
</Pie>
|
</Pie>
|
||||||
<Legend
|
<Legend
|
||||||
formatter={(value) => {
|
formatter={(value) => {
|
||||||
return <span className="text-sm text-black">{value}</span>;
|
return <span className="text-foreground text-sm">{value}</span>;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
@ -35,6 +35,9 @@ export const FundingRaised = ({ className, data, ...props }: FundingRaisedProps)
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
labelStyle={{
|
||||||
|
color: 'hsl(var(--primary-foreground))',
|
||||||
|
}}
|
||||||
itemStyle={{
|
itemStyle={{
|
||||||
color: 'hsl(var(--primary-foreground))',
|
color: 'hsl(var(--primary-foreground))',
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import { Document, User } from '@documenso/prisma/client';
|
|||||||
import { Avatar, AvatarFallback } from '@documenso/ui/primitives/avatar';
|
import { Avatar, AvatarFallback } from '@documenso/ui/primitives/avatar';
|
||||||
import { DataTable } from '@documenso/ui/primitives/data-table';
|
import { DataTable } from '@documenso/ui/primitives/data-table';
|
||||||
import { DataTablePagination } from '@documenso/ui/primitives/data-table-pagination';
|
import { DataTablePagination } from '@documenso/ui/primitives/data-table-pagination';
|
||||||
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@documenso/ui/primitives/tooltip';
|
||||||
|
|
||||||
import { DocumentStatus } from '~/components/formatter/document-status';
|
import { DocumentStatus } from '~/components/formatter/document-status';
|
||||||
import { LocaleDate } from '~/components/formatter/locale-date';
|
import { LocaleDate } from '~/components/formatter/locale-date';
|
||||||
@ -63,16 +64,34 @@ export const DocumentsDataTable = ({ results }: DocumentsDataTableProps) => {
|
|||||||
header: 'Owner',
|
header: 'Owner',
|
||||||
accessorKey: 'owner',
|
accessorKey: 'owner',
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
|
const avatarFallbackText = row.original.User.name
|
||||||
|
? recipientInitials(row.original.User.name)
|
||||||
|
: row.original.User.email.slice(0, 1).toUpperCase();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/admin/users/${row.original.User.id}`}>
|
<Tooltip delayDuration={200}>
|
||||||
<Avatar className="dark:border-border h-12 w-12 border-2 border-solid border-white">
|
<TooltipTrigger>
|
||||||
<AvatarFallback className="text-gray-400">
|
<Link href={`/admin/users/${row.original.User.id}`}>
|
||||||
<span className="text-sm">
|
<Avatar className="dark:border-border h-12 w-12 border-2 border-solid border-white">
|
||||||
{recipientInitials(row.original.User.name ?? '')}
|
<AvatarFallback className="text-xs text-gray-400">
|
||||||
</span>
|
{avatarFallbackText}
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
</Link>
|
</Link>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent className="flex max-w-xs items-center gap-2">
|
||||||
|
<Avatar className="dark:border-border h-12 w-12 border-2 border-solid border-white">
|
||||||
|
<AvatarFallback className="text-xs text-gray-400">
|
||||||
|
{avatarFallbackText}
|
||||||
|
</AvatarFallback>
|
||||||
|
</Avatar>
|
||||||
|
|
||||||
|
<div className="text-muted-foreground flex flex-col text-sm">
|
||||||
|
<span>{row.original.User.name}</span>
|
||||||
|
<span>{row.original.User.email}</span>
|
||||||
|
</div>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export default async function AdminSectionLayout({ children }: AdminSectionLayou
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto mt-16 w-full max-w-screen-xl px-4 md:px-8">
|
<div className="mx-auto mt-16 w-full max-w-screen-xl px-4 md:px-8">
|
||||||
<div className="grid grid-cols-12 gap-x-8 md:mt-8">
|
<div className="grid grid-cols-12 md:mt-8 md:gap-8">
|
||||||
<AdminNav className="col-span-12 md:col-span-3 md:flex" />
|
<AdminNav className="col-span-12 md:col-span-3 md:flex" />
|
||||||
|
|
||||||
<div className="col-span-12 mt-12 md:col-span-9 md:mt-0">{children}</div>
|
<div className="col-span-12 mt-12 md:col-span-9 md:mt-0">{children}</div>
|
||||||
|
|||||||
@ -16,7 +16,13 @@ export const AdminNav = ({ className, ...props }: AdminNavProps) => {
|
|||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex gap-x-2.5 gap-y-2 md:flex-col', className)} {...props}>
|
<div
|
||||||
|
className={cn(
|
||||||
|
'flex gap-x-2.5 gap-y-2 overflow-hidden overflow-x-auto md:flex-col',
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export default async function AdminStatsPage() {
|
|||||||
<div>
|
<div>
|
||||||
<h2 className="text-4xl font-semibold">Instance Stats</h2>
|
<h2 className="text-4xl font-semibold">Instance Stats</h2>
|
||||||
|
|
||||||
<div className="mt-8 grid flex-1 grid-cols-1 gap-4 md:grid-cols-4">
|
<div className="mt-8 grid flex-1 grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||||
<CardMetric icon={UserIcon} title="Total Users" value={usersCount} />
|
<CardMetric icon={UserIcon} title="Total Users" value={usersCount} />
|
||||||
<CardMetric icon={File} title="Total Documents" value={docStats.ALL} />
|
<CardMetric icon={File} title="Total Documents" value={docStats.ALL} />
|
||||||
<CardMetric
|
<CardMetric
|
||||||
@ -43,7 +43,7 @@ export default async function AdminStatsPage() {
|
|||||||
<CardMetric icon={UserPlus2} title="App Version" value={`v${process.env.APP_VERSION}`} />
|
<CardMetric icon={UserPlus2} title="App Version" value={`v${process.env.APP_VERSION}`} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-16 grid grid-cols-1 gap-8 md:grid-cols-2">
|
<div className="mt-16 grid grid-cols-1 gap-8 md:grid-cols-1 lg:grid-cols-2">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-3xl font-semibold">Document metrics</h3>
|
<h3 className="text-3xl font-semibold">Document metrics</h3>
|
||||||
|
|
||||||
|
|||||||
@ -13,18 +13,24 @@ export const CardMetric = ({ icon: Icon, title, value, className }: CardMetricPr
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'border-border bg-background hover:shadow-border/80 overflow-hidden rounded-lg border shadow shadow-transparent duration-200',
|
'border-border bg-background hover:shadow-border/80 h-32 max-h-32 max-w-full overflow-hidden rounded-lg border shadow shadow-transparent duration-200',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className="px-4 pb-6 pt-4 sm:px-4 sm:pb-8 sm:pt-4">
|
<div className="flex h-full max-h-full flex-col px-4 pb-6 pt-4 sm:px-4 sm:pb-8 sm:pt-4">
|
||||||
<div className="flex items-center">
|
<div className="flex items-start">
|
||||||
{Icon && <Icon className="text-muted-foreground mr-2 h-4 w-4" />}
|
{Icon && (
|
||||||
|
<div className="mr-2 h-4 w-4">
|
||||||
|
<Icon className="text-muted-foreground h-4 w-4" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<h3 className="text-primary-forground flex items-end text-sm font-medium">{title}</h3>
|
<h3 className="text-primary-forground flex items-end text-sm font-medium leading-tight">
|
||||||
|
{title}
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-foreground mt-6 text-4xl font-semibold leading-8 md:mt-8">
|
<p className="text-foreground mt-auto text-4xl font-semibold leading-8">
|
||||||
{typeof value === 'number' ? value.toLocaleString('en-US') : value}
|
{typeof value === 'number' ? value.toLocaleString('en-US') : value}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -85,7 +85,7 @@ const DropdownMenuItem = React.forwardRef<
|
|||||||
<DropdownMenuPrimitive.Item
|
<DropdownMenuPrimitive.Item
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
'focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
||||||
inset && 'pl-8',
|
inset && 'pl-8',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user