import React from 'react'; import {Component} from 'react'; import { SafeAreaView, StyleSheet, View, Button, Modal, TouchableWithoutFeedback, } from 'react-native'; // @ts-ignore: CameraRollExample has no typings in same folder import CameraRollExample from './CameraRollExample'; import GetPhotosPerformanceExample from './GetPhotosPerformanceExample'; interface Props {} interface State { showChangeExampleModal: boolean; currentExampleIndex: number; } interface Example { label: string; Component: React.ComponentType; } const examples: Example[] = [ { label: 'CameraRollExample', Component: CameraRollExample, }, { label: 'GetPhotosPerformanceExample', Component: GetPhotosPerformanceExample, }, ]; /** * Container for displaying and switching between multiple examples. * * Shows a button which opens up a Modal to switch between examples, as well * as the current example itself. */ export default class ExamplesContainer extends Component { state: State = {showChangeExampleModal: false, currentExampleIndex: 0}; render() { const {currentExampleIndex} = this.state; return (