feat: disable upload document animation for unverified users (#749)

This commit is contained in:
Ephraim Atta-Duncan
2023-12-27 02:54:46 +00:00
committed by GitHub
parent f7cf33c61b
commit 5a11de1db9
4 changed files with 10 additions and 8 deletions

View File

@ -2,7 +2,7 @@
import React from 'react'; import React from 'react';
import { Session } from 'next-auth'; import type { Session } from 'next-auth';
import { SessionProvider } from 'next-auth/react'; import { SessionProvider } from 'next-auth/react';
export type NextAuthProviderProps = { export type NextAuthProviderProps = {

View File

@ -115,11 +115,12 @@ export const DocumentDropzone = ({
return ( return (
<motion.div <motion.div
className={cn('flex', className)} className={cn('flex aria-disabled:cursor-not-allowed', className)}
variants={DocumentDropzoneContainerVariants} variants={DocumentDropzoneContainerVariants}
initial="initial" initial="initial"
animate="animate" animate="animate"
whileHover="hover" whileHover="hover"
aria-disabled={disabled}
> >
<Card <Card
role="button" role="button"
@ -137,8 +138,8 @@ export const DocumentDropzone = ({
{/* <FilePlus strokeWidth="1px" className="h-16 w-16"/> */} {/* <FilePlus strokeWidth="1px" className="h-16 w-16"/> */}
<div className="flex"> <div className="flex">
<motion.div <motion.div
className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 z-10 flex aspect-[3/4] w-24 origin-top-right -rotate-[22deg] flex-col gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm" className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 a z-10 flex aspect-[3/4] w-24 origin-top-right -rotate-[22deg] flex-col gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm"
variants={DocumentDropzoneCardLeftVariants} variants={!disabled ? DocumentDropzoneCardLeftVariants : undefined}
> >
<div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-full rounded-[2px]" /> <div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-full rounded-[2px]" />
<div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-5/6 rounded-[2px]" /> <div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-5/6 rounded-[2px]" />
@ -147,7 +148,7 @@ export const DocumentDropzone = ({
<motion.div <motion.div
className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 z-20 flex aspect-[3/4] w-24 flex-col items-center justify-center gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm" className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 z-20 flex aspect-[3/4] w-24 flex-col items-center justify-center gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm"
variants={DocumentDropzoneCardCenterVariants} variants={!disabled ? DocumentDropzoneCardCenterVariants : undefined}
> >
<Plus <Plus
strokeWidth="2px" strokeWidth="2px"
@ -157,7 +158,7 @@ export const DocumentDropzone = ({
<motion.div <motion.div
className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 z-10 flex aspect-[3/4] w-24 origin-top-left rotate-[22deg] flex-col gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm" className="border-muted-foreground/20 group-hover:border-documenso/80 dark:bg-muted/80 z-10 flex aspect-[3/4] w-24 origin-top-left rotate-[22deg] flex-col gap-y-1 rounded-lg border bg-white/80 px-2 py-4 backdrop-blur-sm"
variants={DocumentDropzoneCardRightVariants} variants={!disabled ? DocumentDropzoneCardRightVariants : undefined}
> >
<div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-full rounded-[2px]" /> <div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-full rounded-[2px]" />
<div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-5/6 rounded-[2px]" /> <div className="bg-muted-foreground/20 group-hover:bg-documenso h-2 w-5/6 rounded-[2px]" />

View File

@ -1,7 +1,8 @@
import * as React from 'react'; import * as React from 'react';
import * as ToastPrimitives from '@radix-ui/react-toast'; import * as ToastPrimitives from '@radix-ui/react-toast';
import { VariantProps, cva } from 'class-variance-authority'; import { cva } from 'class-variance-authority';
import type { VariantProps } from 'class-variance-authority';
import { X } from 'lucide-react'; import { X } from 'lucide-react';
import { cn } from '../lib/utils'; import { cn } from '../lib/utils';

View File

@ -1,7 +1,7 @@
// Inspired by react-hot-toast library // Inspired by react-hot-toast library
import * as React from 'react'; import * as React from 'react';
import { ToastActionElement, type ToastProps } from './toast'; import type { ToastActionElement, ToastProps } from './toast';
const TOAST_LIMIT = 1; const TOAST_LIMIT = 1;
const TOAST_REMOVE_DELAY = 1000000; const TOAST_REMOVE_DELAY = 1000000;