diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js index 19c418dd529..590d49d40ca 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestResultView.js @@ -19,8 +19,19 @@ import type { } from './RNTesterPlatformTestTypes'; import * as React from 'react'; -import {useMemo} from 'react'; -import {Button, View, Text, StyleSheet, FlatList} from 'react-native'; +import {useMemo, useState, useCallback} from 'react'; +import { + Button, + View, + Text, + StyleSheet, + FlatList, + Modal, + SafeAreaView, + TextInput, + KeyboardAvoidingView, + Platform, +} from 'react-native'; const DISPLAY_STATUS_MAPPING: {[PlatformTestResultStatus]: string} = { PASS: 'Pass', @@ -28,6 +39,75 @@ const DISPLAY_STATUS_MAPPING: {[PlatformTestResultStatus]: string} = { ERROR: 'Error', }; +type FilterModalProps = $ReadOnly<{ + filterText: string, + setFilterText: (newFilterText: string) => void, +}>; +function FilterModalButton(props: FilterModalProps) { + const {filterText, setFilterText} = props; + + const [modalVisible, setModalVisible] = useState(false); + const [pendingFilterText, setPendingFilterText] = useState(filterText); + + const onFilterButtonPress = useCallback(() => { + setPendingFilterText(filterText); + setModalVisible(true); + }, [filterText]); + + const onFilterSubmit = useCallback(() => { + setFilterText(pendingFilterText); + setModalVisible(false); + }, [pendingFilterText, setFilterText]); + + const onFilterCancel = useCallback(() => { + setModalVisible(false); + }, []); + + const onPendingTextChange = useCallback(newText => { + setPendingFilterText(newText); + }, []); + + return ( + <> +