Skip to content

Commit

Permalink
feat: Update accepted file formats
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Nov 8, 2023
1 parent 54aec16 commit b9479f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useComponentInput } from '../../../hooks/sdk/useComponentInput'
import { Block } from '../../Block'
import { Container } from '../../Container'
import { FileUploadField, Dropdown } from '../../ui'
import { ACCEPTED_FILE_TYPES } from '../../ui/FileUploadField/types'
import { Props } from './types'
import { fromGltf, toGltf, isValidInput, COLLISION_LAYERS, isModel } from './utils'
import { useAppSelector } from '../../../redux/hooks'
Expand Down Expand Up @@ -44,6 +45,7 @@ export default withSdk<Props>(({ sdk, entity }) => {
<Block label="Path">
<FileUploadField
{...getInputProps('src')}
accept={ACCEPTED_FILE_TYPES['model']}
onDrop={handleDrop}
error={files && !isValid}
isValidFile={isModel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ export type Props = Omit<TextFieldProps, 'accept' | 'type' | 'onDrop'> & {
onDrop?: (path: string) => void | Promise<void>
isValidFile?: (node: TreeNode) => boolean
}

export const ACCEPTED_FILE_TYPES = {
model: ['.gltf', '.glb'],
image: ['.png'],
audio: ['.mp3', '.wav', '.ogg']
}

0 comments on commit b9479f0

Please sign in to comment.