nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.45k stars 42 forks source link

feat: android menu #6

Closed intergalacticspacehighway closed 2 years ago

intergalacticspacehighway commented 2 years ago

Why?

Adds native menu on android. The native menu is better for accessibility and has a good default animation.

How?

Uses @react-native-menu/menu library as a peer dependency.

Differences between iOS and Android menu

Android menu doesn't have a Group support (displayInline prop in iOS menu). So, flattened the group here.

Discuss

I think we might need a better name for iOSIconName or add androidIconName prop probably. Maybe just keep it as iconName?

https://user-images.githubusercontent.com/23293248/173624549-55a3754e-19ce-495b-adc0-d18866917d0a.mov

nandorojo commented 2 years ago

I think we might need a better name for iOSIconName or add androidIconName prop probably. Maybe just keep it as iconName?

They probably need to be different, since iOS uses SF Symbols. I assume the names don't match Android

nandorojo commented 2 years ago

Left some small comments. I think we probably keep the icon names separate, since I don't think they'll reliably overlap. alternatively it could be iconName={{ ios: '', android: '' }}, not sure. Inline is probably better

intergalacticspacehighway commented 2 years ago

iconName={{ ios: '', android: '' }}.

Yeah no objects, doesn't work well with memoization.

user can use it as iconName={Platform.select({})} so would be inline, no strong opinions so can add androidIconName. Let me know wyt

nandorojo commented 2 years ago

let’s keep it inline as different props. better to not have to import Platform

nandorojo commented 2 years ago

good to go?

nandorojo commented 2 years ago

I assume you went off the latest iOS file and didn't just copy the showtime code, right? because i've made changes since you guys forked it into showtime

intergalacticspacehighway commented 2 years ago

yeah, looks good to me. Yes, everything is the same as the latest iOS file, the only change is in the way we pass props to native MenuView.

nandorojo commented 2 years ago

i’ll push tomorrow