From 5cc6c028d023c776cc45e6c2e3433b06062be0f5 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 9 Feb 2024 13:21:59 +0800 Subject: [PATCH] Add info boxes on uploader --- .../templates/homeFeed/AddLinkModal.tsx | 80 ++++++++++++++----- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/packages/web/components/templates/homeFeed/AddLinkModal.tsx b/packages/web/components/templates/homeFeed/AddLinkModal.tsx index f3bb39bb7..083a396c2 100644 --- a/packages/web/components/templates/homeFeed/AddLinkModal.tsx +++ b/packages/web/components/templates/homeFeed/AddLinkModal.tsx @@ -1,6 +1,6 @@ import { useCallback, useRef, useState } from 'react' import * as Progress from '@radix-ui/react-progress' -import { File } from 'phosphor-react' +import { File, Info } from 'phosphor-react' import toast from 'react-hot-toast' import { locale, timeZone } from '../../../lib/dateFormatting' import { saveUrlMutation } from '../../../lib/networking/mutations/saveUrlMutation' @@ -262,14 +262,21 @@ const UploadPDFTab = (props: AddLinkModalProps): JSX.Element => { css={{ height: '180px', width: '100%' }} > + + PDFs have a maximum size of 8MB.{' '} + + } description="Drag PDFs here to add to your library" accept={{ 'application/pdf': ['.pdf'], }} /> - - * PDFs have a maximum size of 8MB - ) } @@ -282,23 +289,30 @@ const UploadImportTab = (props: AddLinkModalProps): JSX.Element => { css={{ height: '180px', width: '100%' }} > + + Imports must be in a supported format.{' '} + + Read more + + + } description="Drop import files here" accept={{ 'text/csv': ['.csv'], 'application/zip': ['.zip'], }} /> - - * Imports must be in a supported format{' '} - - read more - - . - ) } @@ -372,6 +386,7 @@ type UploadInfo = { } type UploadPadProps = { + info: React.Node description: string accept: Accept } @@ -547,7 +562,29 @@ const UploadPad = (props: UploadPadProps): JSX.Element => { ) return ( - + + {props.info && ( + + {props.info} + + )} { @@ -585,14 +622,17 @@ const UploadPad = (props: UploadPadProps): JSX.Element => { > {inDragOperation ? ( <> Drop to upload your file @@ -602,8 +642,10 @@ const UploadPad = (props: UploadPadProps): JSX.Element => { <> {props.description}