UNPKG

@theoplayer/react-native-ui

Version:

A React Native UI for @theoplayer/react-native

28 lines 741 B
import React, { useContext } 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; const context = useContext(PlayerContext); return /*#__PURE__*/_jsx(ActionButton, { svg: svg, icon: icon, onPress: () => { if (menuConstructor) { context.ui.openMenu_(menuConstructor); } }, style: style, touchable: true }); }; //# sourceMappingURL=MenuButton.js.map