diff --git a/src/components/DownloadButton.tsx b/src/components/DownloadButton.tsx index c031820..1895b33 100644 --- a/src/components/DownloadButton.tsx +++ b/src/components/DownloadButton.tsx @@ -8,7 +8,7 @@ export default function DownloadButton({ return ( diff --git a/src/components/Downloader.tsx b/src/components/Downloader.tsx index 75f8d33..cbffbd4 100644 --- a/src/components/Downloader.tsx +++ b/src/components/Downloader.tsx @@ -11,6 +11,7 @@ import StopButton from './StopButton' import ProgressBar from './ProgressBar' import TitleText from './TitleText' import ReturnHome from './ReturnHome' +import { pluralize } from '../utils/pluralize' interface FileInfo { fileName: string @@ -29,7 +30,9 @@ export function DownloadComplete({ }): JSX.Element { return ( <> - You downloaded {filesInfo.length} files. + + You downloaded {pluralize(filesInfo.length, 'file', 'files')}. +
@@ -55,14 +58,16 @@ export function DownloadInProgress({ return ( <> - You are about to start downloading {filesInfo.length} files. + You are downloading {pluralize(filesInfo.length, 'file', 'files')}.
- +
+ +
) @@ -78,7 +83,8 @@ export function ReadyToDownload({ return ( <> - You are about to start downloading {filesInfo.length} files. + You are about to start downloading{' '} + {pluralize(filesInfo.length, 'file', 'files')}.
@@ -106,9 +112,7 @@ export function PasswordEntry({ return ( <> - - {errorMessage || 'This download requires a password.'} - + This download requires a password.
+ {errorMessage && ( +
+ {errorMessage} +
+ )} ) } diff --git a/src/components/InputLabel.tsx b/src/components/InputLabel.tsx index 1f383a6..8a5549e 100644 --- a/src/components/InputLabel.tsx +++ b/src/components/InputLabel.tsx @@ -2,11 +2,17 @@ import React from 'react' export default function InputLabel({ children, + hasError = false, }: { children: React.ReactNode + hasError?: boolean }): JSX.Element { return ( -