From eccda4d4cacff7e2ffd81883c22a68d4a9fa8ca3 Mon Sep 17 00:00:00 2001 From: Melnyk Mykhailo Date: Mon, 29 Jan 2024 16:15:46 +0200 Subject: [PATCH] move progress timeout delay to constant --- src/components/pages/profile/file-input.tsx | 3 ++- src/constants/profile.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/pages/profile/file-input.tsx b/src/components/pages/profile/file-input.tsx index 1057ccb..2aaeea0 100644 --- a/src/components/pages/profile/file-input.tsx +++ b/src/components/pages/profile/file-input.tsx @@ -3,6 +3,7 @@ import ImageCard from '@/components/pages/auth/image-card' import { Icons } from '@/components/ui/icons' import { Progress } from '@/components/ui/progress' +import { PROGRESS_TIMEOUT_DELAY } from '@/constants' import { cn } from '@/lib/utils' import { FC, FormEvent, useRef, useState } from 'react' @@ -44,7 +45,7 @@ const FileInput: FC = ({ className }) => { fileReader.onload = () => { setPreview(fileReader.result as string) - setTimeout(() => setProgress(0), 500) + setTimeout(() => setProgress(0), PROGRESS_TIMEOUT_DELAY) } } diff --git a/src/constants/profile.tsx b/src/constants/profile.tsx index 5aae672..d7fb582 100644 --- a/src/constants/profile.tsx +++ b/src/constants/profile.tsx @@ -1 +1,2 @@ export const PROFILE_NAME_LENGTH = 1 +export const PROGRESS_TIMEOUT_DELAY = 500