Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Zip Uploads to Arweave #517

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
"type-fest": "^2.13.1",
"uuidv4": "^6.2.13"
}
}
}
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
Loading