-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: upload image #447
feat: upload image #447
Conversation
this component only allows user to upload image file(png, jpg, jpeg).
- when user upload images, then read the image file as base64. - cardImage(hypercert card preview will be generated based on these). so not necessarily store logo and banner on IPFS. - Replace URL input with image uploader for logo and banner - Add validation for image uploads using base64 or valid URL.
inside the hooks, if data.backgroundImg exists, convert base64 image to File type to upload. and then store on IPFS by using api '/upload'. this process will be done both create/updateHyperboard
when user upload images, then read the image file as base64. if data.avatar exists, convert base64 image to File type to upload. and then store on IPFS by using api '/upload'.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fixed image validation so that form.formState.isValid can handle the state properly. - set "shouldDirty: true" to disable click "save changes" button when user upload image on /setting
skip if data.avatar is not an url. this was causing error when user just wanted to change display name
Thanks, applied changes: |
Great, works for me as well. It can go into production like that for me. It makes the UX much better. Thanks, @tnkshuuhei If I would enhance one thing, it would be that after I click "Save" and it is saved, the button either turns gray again or even green and says "Changes saved". But this isn't necessary, this works well enough. |
Closes #388