Skip to content

Commit

Permalink
Disabled invalid files and camera (that didn't work anyways) from mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
luloxi committed Sep 30, 2024
1 parent ce0186c commit c8d94a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/nextjs/app/create/_components/ImageUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export const ImageUploader: React.FC<ImageUploaderProps> = ({ image, setUploaded
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
>
<input type="file" onChange={handleFileInputChange} className="hidden" />
<input
type="file"
accept="image/*" // This will disable non-image files and camera on mobile
onChange={handleFileInputChange}
className="hidden"
/>
{previewImage ? (
<div className="relative w-full h-full flex items-center justify-center">
<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ const ProfilePictureUpload: React.FC<ProfilePictureUploadProps> = ({
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
>
<input type="file" onChange={handleFileInputChange} className="hidden" />
<input
type="file"
accept="image/*" // This will disable non-image files and camera on mobile
onChange={handleFileInputChange}
className="hidden"
/>
{isEditing ? (
<div className="absolute inset-0 flex flex-col items-center justify-center text-center">
{previewImage ? (
Expand Down

0 comments on commit c8d94a8

Please sign in to comment.