react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

fix: add support for changing the surface mode in the menu

Open lenzi-e opened this issue 1 year ago • 7 comments
trafficstars

Motivation

I prefer the "flat" design approach on my components, and would like to be able to use the Menu component in flat mode.

Related issue

You cannot currently change the mode on the Surface that is used in the Menu component.

Test plan

Pull up the menu example and pass mode="flat" to one of the menus to test.

lenzi-e avatar Apr 20 '24 23:04 lenzi-e

Hey @lenzi-erickson, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Apr 21 '24 00:04 callstack-bot

Hey, Modal component has an “elevation” property. If you set elevation={0} it should look like a flat component. Does your change have a better/different effect than the elevation prop? https://callstack.github.io/react-native-paper/docs/components/Menu/#elevation

seb-zabielski avatar Jun 04 '24 07:06 seb-zabielski

Hey, Modal component has an “elevation” property. If you set elevation={0} it should look like a flat component. Does your change have a better/different effect than the elevation prop? https://callstack.github.io/react-native-paper/docs/components/Menu/#elevation

elevation={0} does not do what I was wanting. In my opinion, it makes the menu look broken. If you run the example in this branch, you can see the differences.

Default Screenshot 2024-06-19 at 2 23 44 PM

elevation={0} Screenshot 2024-06-19 at 2 25 46 PM

mode="flat" Screenshot 2024-06-19 at 2 27 07 PM

lenzi-e avatar Jun 19 '24 19:06 lenzi-e

Now I see your point. Change looks good to me. Can you add a test to this case?

seb-zabielski avatar Jun 20 '24 08:06 seb-zabielski

Now I see your point. Change looks good to me. Can you add a test to this case?

What are you wanting me to test, exactly? Since I'm just passing a prop through, and did not add any logic, I'm not sure what you are wanting me to test.

lenzi-e avatar Jun 20 '24 15:06 lenzi-e

I attempted to add some tests. If it's not what you are hoping for, I need some help getting it here, please.

lenzi-e avatar Jun 20 '24 16:06 lenzi-e

This is exactly what I was expecting. Thanks!

seb-zabielski avatar Jun 21 '24 06:06 seb-zabielski

@seb-zabielski What else do I need to do to get this merged? And any ETA on the next release? I would love to get this in. Thanks!

lenzi-e avatar Jul 08 '24 00:07 lenzi-e