-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add abity to remove uploaded brand logo #4451
Conversation
async function saveBrandsForm({ color, fontFamily, image }) { | ||
const brandData = { | ||
color, | ||
logo: image, | ||
logo: image || null, |
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.
"removed" image
is an empty string, but backend has validation rule for strings to check if it's URL. This always fails.
logo
is optional, so null
will pass that validation rule and successfully remove the uploaded logo.
@@ -82,10 +88,12 @@ export function BrandingForm() { | |||
setValue('image', path); | |||
} | |||
|
|||
const dropzoneRef = useRef<() => void>(null); |
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.
I created ref for Dropzone, because one of the buttons must trigger openning file explorer
position: absolute; | ||
top: 0; | ||
left: 0; | ||
background-color: ${colors.BGDark + 'D6'}; |
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.
D6
is alpha channel for hex color constant.
&:hover { | ||
cursor: pointer; | ||
|
||
${DropzoneOverlay} { | ||
display: flex; | ||
} | ||
} |
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.
show overlay on hover
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.
Well done! Works perfectly <3
What change does this PR introduce?
This PR introduces ability to remove uploaded brand logo
Why was this change needed?
Closes #3137
Other information (Screenshots)
Quick Loom video