@theoplayer/react-native-ui
Version:
A React Native UI for @theoplayer/react-native
29 lines • 774 B
JavaScript
import React from 'react';
import { ActionButton } from '../../button/actionbutton/ActionButton';
import { PlayerContext } from '../../util/PlayerContext';
import { jsx as _jsx } from "react/jsx-runtime";
/**
* A menu button that opens a fullscreen menu for in the `react-native-theoplayer` UI.
*/
export const MenuButton = props => {
const {
icon,
svg,
style,
menuConstructor
} = props;
return /*#__PURE__*/_jsx(PlayerContext.Consumer, {
children: context => /*#__PURE__*/_jsx(ActionButton, {
svg: svg,
icon: icon,
onPress: () => {
if (menuConstructor) {
context.ui.openMenu_(menuConstructor);
}
},
style: style,
touchable: true
})
});
};
//# sourceMappingURL=MenuButton.js.map