Skip to content

Commit

Permalink
🎨 Hint text in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
VioMrqs committed Sep 19, 2024
1 parent 6a1b5fa commit e42d7f0
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type UploadDocumentProps = {
format?: 'pdf' | 'csv';
};

const DEFAULT_FILE_SIZE_LIMIT_IN_MB = 5;

export const UploadDocument: FC<UploadDocumentProps> = (props) => {
return !props.documentKey ? (
<UploadNewDocument {...props} />
Expand All @@ -34,8 +36,6 @@ export const UploadDocument: FC<UploadDocumentProps> = (props) => {

const extractFileName = (path: string) => path.replace(/^.*[\\/]/, '');

// violette
// ajouter la limit ici pour ssr
const UploadNewDocument: FC<Omit<UploadDocumentProps, 'documentKey'>> = ({
label,
format = 'pdf',
Expand All @@ -52,7 +52,9 @@ const UploadNewDocument: FC<Omit<UploadDocumentProps, 'documentKey'>> = ({
<div className={`fr-input-group ${className}`}>
<label className="fr-label">
{label}
<div className="fr-hint-text">Format accepté : {format}</div>
<div className="fr-hint-text">
Format accepté : {format}, taille maximale acceptée : {DEFAULT_FILE_SIZE_LIMIT_IN_MB} MB
</div>
</label>

<div className="flex items-center relative mt-3 gap-3">
Expand All @@ -68,7 +70,6 @@ const UploadNewDocument: FC<Omit<UploadDocumentProps, 'documentKey'>> = ({
setUploadFileName(fileName);
}}
/>
<div className="fr-hint-text">Taille maximale acceptée : 5 MB</div>

<Button className="!mt-0" type="button" priority="secondary" onClick={browseForFile}>
<Icon id="fr-icon-folder-2-fill" className="md:mr-1" />
Expand Down

0 comments on commit e42d7f0

Please sign in to comment.