import React, { ReactNode, useContext } from 'react'; import { PlayerContext } from '../../util/PlayerContext'; import { StyleProp, StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native'; import { ControlBar } from '../../controlbar/ControlBar'; import { TOP_UI_CONTAINER_STYLE } from '../../uicontroller/UiContainer'; import { BackSvg } from '../../button/svg/BackSvg'; import { ActionButton } from '../../button/actionbutton/ActionButton'; export interface MenuViewProps { /** * The menu to render inside the menu view. */ menu: ReactNode; /** * The style overrides for the menu view. */ style?: StyleProp; } /** * The default style for the menu view. */ export const DEFAULT_MENU_VIEW_STYLE: ViewStyle = { flex: 1, flexDirection: 'row', left: 0, right: 0, top: 0, bottom: 0, paddingVertical: 20, paddingLeft: 50, paddingRight: 40, }; /** * A component to render a fullscreen menu with a title and back button for the `react-native-theoplayer` UI. */ export const MenuView = (props: MenuViewProps) => { const { menu, style } = props; const context = useContext(PlayerContext); const onClose = () => { context.ui.closeCurrentMenu_(); }; return ( } /> {context.locale.backButton} {menu} ); };