Skip to content

Commit

Permalink
Allow Zip
Browse files Browse the repository at this point in the history
  • Loading branch information
nategeier committed Mar 28, 2024
1 parent c01dd47 commit d2e8374
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 36 deletions.
19 changes: 11 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"dependencies": {
"@types/lodash": "^4.14.182",
"caniuse-lite": "^1.0.30001600",
"lodash": "^4.17.21",
"react-inlinesvg": "^2.3.0",
"react-player": "^2.9.0",
Expand Down
47 changes: 20 additions & 27 deletions src/components/inputs/media-import/mediaImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const MbMediaImport = (props: MediaImportProps) => {
return
}
} else {
setInternalErrorMessage('This media type is not accepted')
setInternalErrorMessage('This media type is not accepted.')
return
}
}
Expand Down Expand Up @@ -132,18 +132,16 @@ export const MbMediaImport = (props: MediaImportProps) => {
<>
<div className="pb-12">
<div
className={`flex items-center justify-center w-full rounded-lg bg-gray-100 dark:bg-gray-900 w-full py-24 ${
isProfileImage && imageUrl ? 'py-24' : 'overflow-hidden'
}`}
className={`flex items-center justify-center w-full rounded-lg bg-gray-100 dark:bg-gray-900 w-full py-24 ${isProfileImage && imageUrl ? 'py-24' : 'overflow-hidden'
}`}
>
<div
className={` ${
isProfileImage
? 'w-24 h-24 sm:h-32 sm:w-32 rounded-full overflow-hidden'
: isHeaderImage
className={` ${isProfileImage
? 'w-24 h-24 sm:h-32 sm:w-32 rounded-full overflow-hidden'
: isHeaderImage
? 'h-32 sm:h-64 w-full'
: 'h-48 w-48 sm:h-64 sm:w-64'
}`}
}`}
>
<img
className="w-full h-full object-cover"
Expand Down Expand Up @@ -176,19 +174,17 @@ export const MbMediaImport = (props: MediaImportProps) => {
<>
<div className="pb-12">
<div
className={`flex items-center justify-center w-full rounded-lg bg-gray-100 dark:bg-gray-900 w-full py-24 ${
isProfileImage && imageUrl ? 'py-24' : 'overflow-hidden'
}`}
className={`flex items-center justify-center w-full rounded-lg bg-gray-100 dark:bg-gray-900 w-full py-24 ${isProfileImage && imageUrl ? 'py-24' : 'overflow-hidden'
}`}
>
{imageUrl ? (
<div
className={` ${
isProfileImage
? 'w-24 h-24 sm:h-32 sm:w-32 rounded-full overflow-hidden'
: isHeaderImage
className={` ${isProfileImage
? 'w-24 h-24 sm:h-32 sm:w-32 rounded-full overflow-hidden'
: isHeaderImage
? 'h-32 sm:h-64 w-full'
: 'h-48 w-48 sm:h-64 sm:w-64'
}`}
}`}
>
<img className="w-full h-full object-cover" src={imageUrl} />
</div>
Expand Down Expand Up @@ -230,25 +226,22 @@ export const MbMediaImport = (props: MediaImportProps) => {
</>
)}
<div
className={`${
(uploadedFile || placeholderUrl) && isMobile() ? 'hidden' : ''
}`}
className={`${(uploadedFile || placeholderUrl) && isMobile() ? 'hidden' : ''
}`}
>
<div className="flex items-center justify-center w-full">
<label
onDragEnter={handleDragIn}
onDragLeave={handleDragOut}
onDragOver={handleDrag}
onDrop={handleDrop}
className={`flex flex-col rounded-lg transition-all duration-500 ${
dragOverlay
? 'bg-gray-100 dark:bg-gray-900'
: 'bg-blue-300-15 dark:bg-blue-100-15 hover:bg-gray-100 dark:hover:bg-gray-900'
} w-full py-32 sm:py-48 group text-center cursor-pointer ${
internalErrorMessage
className={`flex flex-col rounded-lg transition-all duration-500 ${dragOverlay
? 'bg-gray-100 dark:bg-gray-900'
: 'bg-blue-300-15 dark:bg-blue-100-15 hover:bg-gray-100 dark:hover:bg-gray-900'
} w-full py-32 sm:py-48 group text-center cursor-pointer ${internalErrorMessage
? 'ring-1 ring-error-300 dark:ring-error-100'
: ''
}`}
}`}
>
<div className="h-full w-full text-center flex flex-col items-center justify-center p-med-90 relative">
<p className="text-blue-300 dark:text-blue-100">Upload File</p>
Expand Down
2 changes: 1 addition & 1 deletion src/consts/fileFormats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const THREED_TYPES = [
'application/octet-stream',
'glb',
]
export const FILE_TYPES = ['application/pdf']
export const FILE_TYPES = ['application/pdf', 'application/zip']

export const ALL_TYPES = [
...IMAGE_TYPES,
Expand Down

0 comments on commit d2e8374

Please sign in to comment.