-
Notifications
You must be signed in to change notification settings - Fork 392
Closed as not planned
Labels
staleNo activity in the past 10 daysNo activity in the past 10 daysstatus: in progresswork is currently underway to address this issuework is currently underway to address this issue✨ enhancementsuggestion or feature request to improve uploadthingsuggestion or feature request to improve uploadthing
Description
Describe the feature you'd like to request
Making custom upload buttons is too hard
Describe the solution you'd like to see
// inferred input off useUploadThing
type Input = Parameters<typeof useUploadThing>;
const useUploadThingInputProps = (...args: Input) => {
const $ut = useUploadThing(...args);
const handleChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
if (!e.target.files) return;
const selectedFiles = Array.from(e.target.files);
const result = await $ut.startUpload(selectedFiles);
};
return {
inputProps: {
handleChange,
multiple: ($ut.permittedFileInfo?.config?.image?.maxFileCount ?? 1) > 1,
accept: generateMimeTypes(fileTypes ?? [])?.join(", "),
},
isUploading: $ut.isUploading,
};
};
Can I have this pls <3
Additional information
No response
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR implementing this feature!
imaginamundo
Metadata
Metadata
Assignees
Labels
staleNo activity in the past 10 daysNo activity in the past 10 daysstatus: in progresswork is currently underway to address this issuework is currently underway to address this issue✨ enhancementsuggestion or feature request to improve uploadthingsuggestion or feature request to improve uploadthing