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

fix: MenuButtonImageUpload should call insertImages prop #188

Closed

Conversation

lorenries
Copy link

The MenuButtonImageUpload component doesn't actually call the insertImages prop, although it's defined in the type signature.

@lorenries lorenries force-pushed the fix/menu-button-image-upload branch from ec7b064 to 692b16f Compare January 8, 2024 19:50
Copy link
Owner

@sjdemartini sjdemartini left a comment

Choose a reason for hiding this comment

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

Great catch, thanks for opening the PR @lorenries! Just one minor suggestion, which should simplify things a bit and make it more consistent with some other similar code elsewhere.

@@ -52,6 +55,7 @@ export interface MenuButtonImageUploadProps
export default function MenuButtonImageUpload({
onUploadFiles,
inputProps,
insertImages,
Copy link
Owner

Choose a reason for hiding this comment

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

For consistency with a similar use-case here:

colorToHex = colorToHexDefault,

how about:

Suggested change
insertImages,
insertImages = insertImagesDefault,

(importing with insertImages as insertImagesDefault instead of insertImages as fallbackInsertImages).

And then no need to update any of the code below (no conditional needed)

Choose a reason for hiding this comment

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

sjdemartini added a commit that referenced this pull request Apr 18, 2024
sjdemartini added a commit that referenced this pull request Apr 18, 2024
@sjdemartini
Copy link
Owner

Thanks again for catching this bug and suggesting the fix! Since the final change is so small (with the refactor I suggested a few months back), I've gone ahead and made a separate smaller commit in a branch here #214. Closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants