Skip to content

Commit

Permalink
move AUDIO_MIME_TYPES to constants.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zir0h committed Jan 12, 2025
1 parent 9c0fb5d commit 9c61607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/form/FormFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AudioVisualizer } from 'react-audio-visualize'
import {
ALLOWED_FILETYPES_LABEL,
ALLOWED_COVER_FILETYPES_LABEL,
AUDIO_MIME_TYPES,
} from '@constants'
import { Controller, useFormContext } from 'react-hook-form'
import classNames from 'classnames'
Expand Down Expand Up @@ -41,13 +42,7 @@ export const FormFields = ({ value, field, error, register, control }) => {
const [showVisualizer, setShowVisualizer] = useState(false)
const [audioBlob, setAudioBlob] = useState(null)
const visualizerRef = useRef(null)
const AUDIO_MIME_TYPES = [
'audio/mpeg',
'audio/wav',
'audio/flac',
'audio/x-flac',
'audio/ogg',
]

const getArtistText = (userInfo, address) => {
if (userInfo?.name) {
return `${userInfo.name} (${address})`
Expand Down
8 changes: 8 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export const MIMETYPE: { [key: string]: string } = {
TXT: 'text/plain',
}

export const AUDIO_MIME_TYPES = [
'audio/mpeg',
'audio/wav',
'audio/flac',
'audio/x-flac',
'audio/ogg',
]

export const ALLOWED_MIMETYPES = Object.keys(MIMETYPE)
.map((k) => MIMETYPE[k])
// disabling GLTF from new updates,
Expand Down

0 comments on commit 9c61607

Please sign in to comment.