This repository was archived by the owner on Nov 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React , { Component } from 'react' ;
22import { SignIn } from './canals/SignIn' ;
33import { FullScreenPortal } from 'react-gondola' ;
4+ import { View , TouchableOpacity , Text } from 'react-native' ;
5+
6+ interface State {
7+ example : null | 'SignIn' | 'Instagram' ;
8+ }
9+
10+ const EXAMPLES = { SignIn, Instagram : SignIn } ;
11+
12+ export default class App extends Component < { } , State > {
13+ state : State = {
14+ example : null ,
15+ } ;
416
5- export default class App extends Component < { } > {
617 render ( ) {
18+ if ( ! this . state . example ) {
19+ return (
20+ < View style = { { alignItems : 'center' , flex : 1 , justifyContent : 'center' } } >
21+ { Object . keys ( EXAMPLES ) . map ( example => (
22+ < TouchableOpacity
23+ key = { example }
24+ onPress = { ( ) => {
25+ // @ts -ignore
26+ this . setState ( { example } ) ;
27+ } }
28+ style = { {
29+ paddingHorizontal : 16 ,
30+ paddingVertical : 8 ,
31+ backgroundColor : 'cyan' ,
32+ borderRadius : 4 ,
33+ marginTop : 8 ,
34+ } }
35+ >
36+ < Text > { example } </ Text >
37+ </ TouchableOpacity >
38+ ) ) }
39+ </ View >
40+ ) ;
41+ }
42+
43+ const Example = EXAMPLES [ this . state . example ] ;
44+
745 return (
846 < FullScreenPortal >
9- < SignIn />
47+ < Example />
1048 </ FullScreenPortal >
1149 ) ;
1250 }
You can’t perform that action at this time.
0 commit comments