-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainScreen.tsx
155 lines (148 loc) · 3.78 KB
/
MainScreen.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import React from 'react'
import {
View,
Text,
TouchableOpacity,
Dimensions,
StyleSheet,
StatusBar,
} from 'react-native'
import * as Animatable from 'react-native-animatable'
import { LinearGradient } from 'expo-linear-gradient'
import { useTheme } from '@react-navigation/native'
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper'
import Footer from './Footer'
import { NavigationContext } from './NavigationContext'
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: '#1069AD',
},
}
const SplashScreen = ({ navigation }) => {
const { colors } = useTheme()
const goToLogin = () => {
navigation.navigate('Login')
}
const goToRegistration = () => {
navigation.navigate('Registration')
}
return (
<PaperProvider theme={theme}>
<View style={styles.container}>
<StatusBar backgroundColor='#1069AD' barStyle='light-content' />
<View style={styles.header}>
<Animatable.Image
animation='bounceIn'
duration={1500}
source={require('./assets/images/logo-2.png')}
style={styles.logo}
resizeMode='stretch'
/>
</View>
<Animatable.View
style={[styles.footer, { backgroundColor: colors.background }]}
animation='fadeInUpBig'>
<Text style={[styles.title, { color: colors.text }]}>
Mobile Clinic
</Text>
<View style={styles.textContainer}>
<Text style={styles.text}>... Revolutionizing </Text>
<Text style={styles.text}>Healthcare</Text>
</View>
<View style={styles.button1}>
<TouchableOpacity onPress={goToLogin}>
<LinearGradient
colors={['#1987D8', '#0F6FB6']}
style={styles.signIn}>
<Text style={styles.textSign}>Login</Text>
</LinearGradient>
</TouchableOpacity>
</View>
<View style={styles.button2}>
<TouchableOpacity
onPress={goToRegistration}
style={[
styles.signIn,
{
borderColor: '#1069AD',
borderWidth: 1.5,
marginTop: 15,
},
]}>
<Text style={[styles.textSign, { color: '#1069AD' }]}>
Register
</Text>
</TouchableOpacity>
</View>
</Animatable.View>
<Footer />
</View>
</PaperProvider>
)
}
export default SplashScreen
const { height } = Dimensions.get('screen')
const height_logo = height * 0.28
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#1069AD',
},
header: {
flex: 1.5,
justifyContent: 'center',
alignItems: 'center',
},
footer: {
flex: 1,
backgroundColor: '#fff',
borderTopLeftRadius: 30,
borderTopRightRadius: 30,
paddingVertical: 50,
paddingHorizontal: 30,
},
logo: {
width: height_logo,
height: height_logo,
},
title: {
fontFamily: 'Roboto-Bold', // Use the bold variant of Roboto
color: '#05375a',
textAlign: 'center',
fontSize: 30,
fontWeight: 'bold',
},
textContainer: {
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
marginTop: 5,
},
text: {
fontFamily: 'Roboto-Regular', // Use the regular variant of Roboto
color: 'grey',
fontSize: 12,
},
button1: {
alignItems: 'center',
marginTop: 40,
},
signIn: {
width: 150,
height: 40,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 50,
flexDirection: 'row',
},
textSign: {
color: 'white',
fontWeight: 'bold',
fontSize: 15,
},
button2: {
alignItems: 'center',
},
})