Files
react-native-video/examples/bare/src/components/TopControl.tsx
Krzysztof Moch 9eb5502076 chore: rework examples (#4225)
* remove unused examples

* init bare example with test app

* add react-native-video

* add test app suport in expo plugin

* expo plugin: skip keys that are already in pod file

* fix podfile

* add src files

* fix metro config

* finalize react native test app configuration

* init expo example

* remove old examples

* add guide for example

* Add link to examples apps in docs

* adopt bare example to CI tests

* update CI workflows

* CI build lib after node_modules install

* fix examples readme

* fix iOS CI

* Add Example for DRM

* Update examples/README.md

* fix links

* update examples README

* sync example code

* update README
2024-10-20 20:04:02 +02:00

38 lines
979 B
TypeScript

import React, {FC, memo} from 'react';
import {Text, TouchableOpacity, View} from 'react-native';
import styles from '../styles.tsx';
import {srcList} from '../constants';
import {type AdditionalSourceInfo} from '../types';
type Props = {
srcListId: number;
showRNVControls: boolean;
toggleControls: () => void;
};
const _TopControl: FC<Props> = ({
toggleControls,
showRNVControls,
srcListId,
}) => {
return (
<View style={styles.topControlsContainer}>
<Text style={styles.controlOption}>
{(srcList[srcListId] as AdditionalSourceInfo)?.description ||
'local file'}
</Text>
<View>
<TouchableOpacity
onPress={() => {
toggleControls();
}}>
<Text style={styles.leftRightControlOption}>
{showRNVControls ? 'Hide controls' : 'Show controls'}
</Text>
</TouchableOpacity>
</View>
</View>
);
};
export const TopControl = memo(_TopControl);