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

feat: add abity to remove uploaded brand logo #4451

Merged
merged 6 commits into from
Oct 17, 2023
Merged

feat: add abity to remove uploaded brand logo #4451

merged 6 commits into from
Oct 17, 2023

Conversation

michaldziuba03
Copy link
Contributor

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

image

image

image

Hover uses cursor: pointer

image

Hover uses cursor: pointer

image

async function saveBrandsForm({ color, fontFamily, image }) {
const brandData = {
color,
logo: image,
logo: image || null,
Copy link
Contributor Author

@michaldziuba03 michaldziuba03 Oct 6, 2023

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);
Copy link
Contributor Author

@michaldziuba03 michaldziuba03 Oct 6, 2023

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'};
Copy link
Contributor Author

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.

Comment on lines +280 to +286
&:hover {
cursor: pointer;

${DropzoneOverlay} {
display: flex;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show overlay on hover

@michaldziuba03 michaldziuba03 marked this pull request as ready for review October 6, 2023 20:07
Copy link
Contributor

@scopsy scopsy left a 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

@scopsy scopsy merged commit 598881e into novuhq:next Oct 17, 2023
17 of 21 checks passed
@michaldziuba03 michaldziuba03 deleted the nv-2053-remove-brand-logo branch October 17, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NV-2053] 🐛 Bug Report: Remove Brand logo
3 participants