File tree Expand file tree Collapse file tree 5 files changed +954
-2
lines changed
Expand file tree Collapse file tree 5 files changed +954
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 SafeAreaProvider ,
1212 useSafeAreaInsets ,
1313} from 'react-native-safe-area-context' ;
14+ import OSDemo from './OSDemo' ;
1415
1516function App ( ) {
1617 const isDarkMode = useColorScheme ( ) === 'dark' ;
@@ -32,12 +33,13 @@ function AppContent() {
3233 templateFileName = "App.tsx"
3334 safeAreaInsets = { safeAreaInsets }
3435 />
36+ < OSDemo name = "OneSignal" />
3537 </ View >
3638 ) ;
37- }
39+ } ;
3840
3941const styles = StyleSheet . create ( {
40- container : {
42+ body : {
4143 flex : 1 ,
4244 } ,
4345} ) ;
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import {
3+ View ,
4+ StyleSheet ,
5+ Platform ,
6+ KeyboardAvoidingView ,
7+ TextInput ,
8+ } from 'react-native' ;
9+ import { Button } from '@react-native-material/core' ;
10+
11+ const disabledColor = '#BEBEBE' ;
12+
13+ export const renderButtonView = ( name : string , callback : Function ) => {
14+ return (
15+ < View key = { name + '_parent' } style = { styles . buttonContainer } >
16+ < Button
17+ key = { name }
18+ title = { name }
19+ onPress = { ( ) => {
20+ callback ( ) ;
21+ } }
22+ />
23+ </ View >
24+ ) ;
25+ } ;
26+
27+ export const renderFieldView = (
28+ name : string ,
29+ value : string ,
30+ callback : ( text : string ) => void ,
31+ ) => {
32+ return (
33+ < KeyboardAvoidingView
34+ key = { name + '_keyboard_avoiding_view' }
35+ style = { {
36+ width : 300 ,
37+ height : 40 ,
38+ borderWidth : 2 ,
39+ borderRadius : 5 ,
40+ marginTop : 8 ,
41+ } }
42+ >
43+ < TextInput
44+ key = { name }
45+ style = { styles . textInput }
46+ placeholder = { name }
47+ value = { value }
48+ multiline = { false }
49+ returnKeyType = "done"
50+ textAlign = "center"
51+ placeholderTextColor = "#d1dde3"
52+ editable = { true }
53+ autoCapitalize = "none"
54+ onChangeText = { callback }
55+ />
56+ </ KeyboardAvoidingView >
57+ ) ;
58+ } ;
59+
60+ const styles = StyleSheet . create ( {
61+ buttonContainer : {
62+ flexDirection : 'column' ,
63+ overflow : 'hidden' ,
64+ borderRadius : 10 ,
65+ marginVertical : 10 ,
66+ marginHorizontal : 10 ,
67+ } ,
68+ textInput : {
69+ marginHorizontal : 10 ,
70+ height : 40 ,
71+ } ,
72+ } ) ;
You can’t perform that action at this time.
0 commit comments