import React, {memo} from 'react'; import { // ImageBackground, SafeAreaView, StyleSheet, View, GestureResponderHandlers, } from 'react-native'; import {Volume} from './Volume'; import {Back} from './Back'; import {NullControl} from './NullControl'; // import {styles} from './styles'; import type {VideoAnimations} from '../types'; import {Title} from './Title'; interface TopControlProps { title: {primary: string; secondary?: string}; showControls: boolean; panHandlers: GestureResponderHandlers; animations: VideoAnimations; disableBack: boolean; disableVolume: boolean; volumeFillWidth: number; volumeTrackWidth: number; volumePosition: number; onBack: () => void; resetControlTimeout: () => void; } export const TopControls = memo( ({ title, showControls, panHandlers, animations: {AnimatedView, controlsOpacity, topControl}, disableBack, disableVolume, volumeFillWidth, volumePosition, volumeTrackWidth, onBack, resetControlTimeout, }: TopControlProps) => { const backControl = disableBack ? ( ) : ( ); const volumeControl = disableVolume ? ( ) : ( ); return ( {/* */} {backControl} </View> <View style={_styles.pullRight}>{volumeControl}</View> </SafeAreaView> {/* </ImageBackground> */} </AnimatedView> ); }, ); const _styles = StyleSheet.create({ pullRight: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', }, top: { flex: 1, alignItems: 'stretch', justifyContent: 'flex-start', }, topControlGroup: { alignSelf: 'stretch', alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', margin: 12, marginBottom: 18, }, sideControl: { flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', }, });