Skip to content

Commit

Permalink
move progress timeout delay to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
dEdmishka committed Jan 29, 2024
1 parent 8bc864b commit eccda4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/pages/profile/file-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -44,7 +45,7 @@ const FileInput: FC<FileInputProps> = ({ className }) => {

fileReader.onload = () => {
setPreview(fileReader.result as string)
setTimeout(() => setProgress(0), 500)
setTimeout(() => setProgress(0), PROGRESS_TIMEOUT_DELAY)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/constants/profile.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const PROFILE_NAME_LENGTH = 1
export const PROGRESS_TIMEOUT_DELAY = 500

0 comments on commit eccda4d

Please sign in to comment.