Skip to content

Commit

Permalink
add loading spinner component
Browse files Browse the repository at this point in the history
  • Loading branch information
mollpo committed Sep 4, 2024
1 parent 6976422 commit a35314b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/files/DeleteFileAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import IconDelete from '@aboutbits/react-material-icons/dist/IconDeleteRoundedFi
import { useState } from 'react'
import { useInternationalization } from '../../framework'
import { ButtonVariant } from '../button'
import { IconSpinner } from '../loading/IconSpinner'
import { LoadingSpinner } from '../loading/LoadingSpinner'
import { Tone } from '../types'
import { FileUploadObject } from './FileUploadState'
import { ResponsiveButtonIcon } from './ResponsiveButtonIcon'
Expand Down Expand Up @@ -35,7 +35,7 @@ export function DeleteFileAction<TRemoteFile>({
setIsDeleting(false)
})
}}
icon={isDeleting ? IconSpinner : IconDelete}
icon={isDeleting ? LoadingSpinner : IconDelete}
label={messages['files.action.delete']}
/>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/files/DownloadFileAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import IconDownload from '@aboutbits/react-material-icons/dist/IconDownloadRound
import { useState } from 'react'
import { useInternationalization } from '../../framework'
import { ButtonVariant } from '../button'
import { IconSpinner } from '../loading/IconSpinner'
import { LoadingSpinner } from '../loading/LoadingSpinner'
import { Tone } from '../types'
import { FileUploadObject } from './FileUploadState'
import { ResponsiveButtonIcon } from './ResponsiveButtonIcon'
Expand All @@ -25,7 +25,7 @@ export function DownloadFileAction<TRemoteFile>({
variant={ButtonVariant.Transparent}
tone={Tone.Neutral}
disabled={isDownloading}
icon={isDownloading ? IconSpinner : IconDownload}
icon={isDownloading ? LoadingSpinner : IconDownload}
onClick={() => {
setIsDownloading(true)
Promise.resolve(onDownload(fileUploadObject))
Expand Down
4 changes: 2 additions & 2 deletions src/components/files/FileListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import IconDraftRounded from '@aboutbits/react-material-icons/dist/IconDraftRoun
import classNames from 'classnames'
import { ReactNode, useEffect, useState } from 'react'
import { useInternationalization, useTheme } from '../../framework'
import { IconSpinner } from '../loading/IconSpinner'
import { LoadingSpinner } from '../loading/LoadingSpinner'
import { FileSpace, FileState, FileUploadObject } from './FileUploadState'
import { useHumanReadableFileSize } from './utils'

Expand Down Expand Up @@ -68,7 +68,7 @@ export function FileListItem<TRemoteFile>({
files.icon.container.default,
)}
>
<IconSpinner
<LoadingSpinner
className={classNames(files.icon.size, files.icon.default)}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classNames from 'classnames'
import { useTheme } from '../../framework'
import { IconProps } from '../types'

export function IconSpinner({ className, ...props }: IconProps) {
export function LoadingSpinner({ className, ...props }: IconProps) {
const { loading } = useTheme()
return (
<IconProgressActivityRounded
Expand Down

0 comments on commit a35314b

Please sign in to comment.