File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 88 Text ,
99 TextInput ,
1010 View ,
11+ Button ,
12+ Alert ,
1113} from 'react-native' ;
1214
1315const MESSAGES = [
@@ -27,6 +29,7 @@ export function Chat({
2729 behavior = { Platform . OS === 'ios' ? 'padding' : 'height' }
2830 style = { styles . container }
2931 >
32+ < Button onPress = { ( ) => Alert . alert ( 'Hey' ) } title = "Press me" />
3033 < ScrollView
3134 contentInsetAdjustmentBehavior = "automatic"
3235 style = { styles . inverted }
Original file line number Diff line number Diff line change 11import { useScrollToTop } from '@react-navigation/native' ;
22import * as React from 'react' ;
33import {
4+ Alert ,
45 FlatList ,
56 type FlatListProps ,
67 Platform ,
78 SafeAreaView ,
89 StyleSheet ,
910 Text ,
11+ TouchableOpacity ,
1012 View ,
1113} from 'react-native' ;
1214import { useBottomTabBarHeight } from 'react-native-bottom-tabs' ;
@@ -74,7 +76,10 @@ const CONTACTS: Item[] = [
7476const ContactItem = React . memo (
7577 ( { item } : { item : { name : string ; number : number } } ) => {
7678 return (
77- < View style = { [ styles . item , { backgroundColor : '#fff' } ] } >
79+ < TouchableOpacity
80+ style = { [ styles . item , { backgroundColor : '#fff' } ] }
81+ onPress = { ( ) => Alert . alert ( `Pressed: ${ item . name } ` ) }
82+ >
7883 < View style = { styles . avatar } >
7984 < Text style = { styles . letter } >
8085 { item . name . slice ( 0 , 1 ) . toUpperCase ( ) }
@@ -84,7 +89,7 @@ const ContactItem = React.memo(
8489 < Text style = { styles . name } > { item . name } </ Text >
8590 < Text style = { [ styles . number , { opacity : 0.5 } ] } > { item . number } </ Text >
8691 </ View >
87- </ View >
92+ </ TouchableOpacity >
8893 ) ;
8994 }
9095) ;
You can’t perform that action at this time.
0 commit comments