Skip to content

Commit

Permalink
remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
fabOnReact committed Nov 29, 2022
1 parent bf37a34 commit dc4c54e
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions packages/rn-tester/js/examples/Modal/ModalPresentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
*/

/* eslint-disable no-alert */

import * as React from 'react';
import {
AccessibilityInfo,
Modal,
Platform,
StyleSheet,
Switch,
Text,
View,
} from 'react-native';
import {Modal, Platform, StyleSheet, Switch, Text, View} from 'react-native';
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
import RNTOption from '../../components/RNTOption';
const RNTesterButton = require('../../components/RNTesterButton');
Expand All @@ -43,23 +35,6 @@ const presentationStyles = [
const iOSActions = ['None', 'On Dismiss', 'On Show'];
const noniOSActions = ['None', 'On Show'];

const TitleComponent = React.forwardRef((props, forwardedRef) => {
return (
<Text
ref={forwardedRef}
style={{
width: '100%',
position: 'absolute',
top: 500,
textAlign: 'center',
backgroundColor: 'red',
zIndex: 20,
}}>
My custom title
</Text>
);
});

function ModalPresentation() {
const [animationType, setAnimationType] = React.useState('none');
const [transparent, setTransparent] = React.useState(false);
Expand All @@ -72,7 +47,6 @@ function ModalPresentation() {
React.useState('Portrait');
const [currentOrientation, setCurrentOrientation] = React.useState('unknown');
const [action, setAction] = React.useState('None');
let ref = React.useRef<?React.ElementRef<typeof TitleComponent>>(null);
const actions = Platform.OS === 'ios' ? iOSActions : noniOSActions;
const onDismiss = () => {
setVisible(false);
Expand All @@ -85,13 +59,7 @@ function ModalPresentation() {
if (action === 'onShow') {
alert('onShow');
}
if (ref != null && ref.current != null && visible === true) {
// see https://github.com/facebook/react-native/issues/30097#issuecomment-1285927266
const focusEvent = Platform.OS === 'ios' ? 'focus' : 'viewHoverEnter';
AccessibilityInfo.sendAccessibilityEvent(ref.current, focusEvent);
}
};

/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
* LTI update could not be added via codemod */
const onOrientationChange = event =>
Expand Down Expand Up @@ -119,7 +87,6 @@ function ModalPresentation() {
onOrientationChange={onOrientationChange}
onDismiss={onDismiss}
onShow={onShow}>
<TitleComponent ref={ref} />
<View style={[styles.modalContainer, modalBackgroundStyle]}>
<View
style={[
Expand Down

0 comments on commit dc4c54e

Please sign in to comment.