Skip to content

Commit 617c05c

Browse files
authored
Merge pull request #33 from Etlas-SCU/dev
Dev
2 parents 60bc659 + 15be991 commit 617c05c

File tree

56 files changed

+1611
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1611
-325
lines changed

App.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
import React, { useState, useEffect, useCallback } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import { useFonts } from 'expo-font';
33
import { NavigationContainer } from '@react-navigation/native'
44
import { createStackNavigator, CardStyleInterpolators } from '@react-navigation/stack'
55
import OnBoarding from "./Components/OnBoarding/OnBoarding";
6-
import LanguageSelection from './Components/LanguageSelection/LanguageSelection'
76
import { FirstPage } from './Components/Register/FirstPage';
87
import { SecondPage } from './Components/Register/SecondPage'
98
import Login from './Components/Login/Login'
109
import AsyncStorage from '@react-native-async-storage/async-storage';
1110
import { init } from './Localization';
12-
import { Easing } from 'react-native';
13-
import MenuBar from './Components/MenuBar/MenuBar';
11+
import { Easing, AppRegistry } from 'react-native';
1412
import { UserProvider } from './Components/Context/Context';
15-
import { useResponsiveHeight, useResponsiveWidth, useDimensionsChange } from "react-native-responsive-dimensions";
16-
import { LayoutAnimation, View } from 'react-native'
13+
import MenuBar from './Components/MenuBar/MenuBar';
14+
import ForgotPasswordFirst from './Components/ForgetPassword/ForgetPasswordFirst';
15+
import ForgotPasswordSecond from './Components/ForgetPassword/ForgetPasswordSecond';
16+
import ForgotPasswordThird from './Components/ForgetPassword/ForgetPasswordThird';
17+
import BestScore from './Components/BestScore/BestScore';
18+
import EditProfile from './Components/EditProfile/EditProfile';
19+
1720

1821
// import the screen
1922
const Stack = createStackNavigator();
@@ -94,15 +97,20 @@ export default function App() {
9497
},
9598
}}
9699
>
97-
{language !== 'None' ? null : <Stack.Screen name="languageSelection" component={LanguageSelection} />}
98100
<Stack.Screen name="onBoarding" component={OnBoarding} />
99101
<Stack.Screen name="firstPage" component={FirstPage} />
100102
<Stack.Screen name="secondPage" component={SecondPage} />
101103
<Stack.Screen name="login" component={Login} />
102104
<Stack.Screen name="menuBar" component={MenuBar} />
105+
<Stack.Screen name="forgotPasswordFirst" component={ForgotPasswordFirst} />
106+
<Stack.Screen name="forgotPasswordSecond" component={ForgotPasswordSecond} />
107+
<Stack.Screen name="forgotPasswordThird" component={ForgotPasswordThird} />
108+
<Stack.Screen name="bestScore" component={BestScore} />
109+
<Stack.Screen name="editProfile" component={EditProfile} />
103110
</Stack.Navigator>
104111
</NavigationContainer>
105112
</UserProvider>
106113
);
107114
}
108115

116+
AppRegistry.registerComponent('App', () => App);

AppStyles.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StyleSheet, Dimensions, PixelRatio, Platform } from "react-native";
2+
import * as Device from 'expo-device';
23

34
// styles in app.js
45
export const styles = StyleSheet.create({
@@ -54,6 +55,31 @@ export const isIOS = () => {
5455
return Platform.OS === 'ios';
5556
};
5657

58+
// detect IOS Version
59+
export const hasNotch = (version) => {
60+
const modelName = Device.modelName;
61+
const ex_notch = [
62+
'iPhone 7',
63+
'iPhone 7 Plus',
64+
'iPhone 8',
65+
'iPhone 8 Plus',
66+
'iPhone SE',
67+
'iPhone 6',
68+
'iPhone 6 Plus',
69+
'iPhone 6s',
70+
'iPhone 6s Plus',
71+
'iPhone 5',
72+
'iPhone 5s',
73+
'iPhone 5c',
74+
'iPhone 4s',
75+
'iPhone 4',
76+
'iPhone 3G',
77+
'iPhone 3GS',
78+
'iPhone 1G',
79+
];
80+
return isIOS() && !ex_notch.includes(modelName);
81+
};
82+
5783

5884
// colors used in the app
5985
export const colors = {

Components/ArticlesPage/ArticlesPage.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { View, ScrollView, Text, TouchableOpacity, Image, TextInput } from "reac
44
import { translate } from "../../Localization";
55
import { colors } from "../../AppStyles";
66
import MonumentsCard from "../MonumentsCard/MonumentsCard";
7-
import MainMenu from "../MainMenu/MainMenu";
87
import { UserContext } from "../Context/Context";
8+
import MainMenu from "../MainMenu/MainMenu";
9+
import { isIOS } from "../../AppStyles";
910

1011

1112
export default function ArticlesPage({ navigation }) {
1213

1314
const [searchTerm, setSearchTerm] = useState('');
14-
const { modalVisible, showModal } = useContext(UserContext);
15+
const { showModal, setScreen } = useContext(UserContext);
1516

1617
const Monument = {
1718
Title: "Anibus",
@@ -28,17 +29,17 @@ export default function ArticlesPage({ navigation }) {
2829

2930
return (
3031
<View style={styles.container}>
32+
{isIOS() ? <MainMenu /> : null}
3133
<ScrollView contentContainerStyle={styles.contentContainer}>
3234
<View style={styles.header}>
33-
<TouchableOpacity style={styles.aboutus} onPress={showModal}>
35+
<TouchableOpacity style={styles.aboutus} onPress={() => { showModal(), setScreen('ArticlesPage') }}>
3436
<Image source={require('../../assets/KnowledgeCheck/tabler_exclamation-circle.png')} />
3537
</TouchableOpacity>
3638
<Text style={styles.title}>{translate('Articles.title')}</Text>
3739
<TouchableOpacity onPress={() => { navigation.goBack() }}>
3840
<Image source={require('../../assets/Scan/Arr.png')} />
3941
</TouchableOpacity>
4042
</View>
41-
{modalVisible ? <MainMenu pageName={'ArticlesPage'} /> : null}
4243
<View style={styles.inputContainer}>
4344
<TextInput
4445
style={styles.SearchForm}

Components/BestScore/BestScore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function BestScore({ navigation }) {
99
<ScrollView contentContainerStyle={styles.scrollContainer} showsVerticalScrollIndicator={false}>
1010
<View style={styles.header}>
1111
<Text style={styles.title}>{translate('BestScore.title')}</Text>
12-
<TouchableOpacity onPress={() => navigation.navigate({ name: 'Home' })} style={styles.close}>
12+
<TouchableOpacity onPress={() => navigation.navigate({ name: 'Settings' })} style={styles.close}>
1313
<Image source={require('../../assets/Profile/Arr.png')} />
1414
</TouchableOpacity>
1515
</View>

Components/CameraScreen/Styles.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ export const styles = StyleSheet.create({
2020
borderRadius: 100,
2121
borderColor: colors.DarkCyan,
2222
borderWidth: responsiveWidth(5),
23-
height: responsiveHeight(85.4),
24-
width: responsiveWidth(85.4),
23+
height: 85.55,
24+
width: 85.4,
25+
marginTop: responsiveHeight(-20),
26+
alignSelf: 'center',
27+
alignItems: 'center',
28+
justifyContent: 'center',
2529
},
2630
topBar: {
2731
height: responsiveHeight(120),

Components/ContactUS/ContactUS.js

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,64 @@ import { View, Image, Text, TextInput, ScrollView, TouchableOpacity } from 'reac
44
import { colors } from "../../AppStyles";
55

66

7-
export default function ContactUS({ navigation }) {
7+
export default function ContactUS({ navigation, route }) {
8+
9+
// get pageName from the parameters passed to the naviagtion
10+
const { pageName } = route.params;
11+
812
return (
913
<View style={styles.container}>
1014
<View style={styles.upperBox}>
15+
<TouchableOpacity onPress={() => { navigation.navigate({ name: pageName }) }}>
16+
<Image source={require('../../assets/AboutUs/ep_close-bold.png')} style={styles.close} />
17+
</TouchableOpacity>
1118
<Image source={require('../../assets/ContactUs/Contact_us.png')} style={styles.cover} />
1219
</View>
13-
<ScrollView
14-
contentContainerStyle={styles.scrollContainer}
15-
showsVerticalScrollIndicator={false}
16-
>
17-
<View style={styles.textInputContainer}>
18-
<View style={styles.inputContainer}>
19-
<Text style={styles.title} >{translate('ContactUs.fullname')}</Text>
20-
<TextInput
21-
style={styles.input}
22-
placeholder={translate('ContactUs.fullname')}
23-
placeholderTextColor={colors.Grey}
24-
/>
25-
</View>
26-
<View style={styles.inputContainer}>
27-
<Text style={styles.title} >{translate('ContactUs.email')}</Text>
28-
<TextInput
29-
style={styles.input}
30-
placeholder={translate('ContactUs.email')}
31-
placeholderTextColor={colors.Grey}
32-
/>
20+
<View style={styles.container} >
21+
<ScrollView
22+
contentContainerStyle={styles.scrollContainer}
23+
showsVerticalScrollIndicator={false}
24+
>
25+
<View style={styles.textInputContainer}>
26+
<View style={styles.inputContainer}>
27+
<Text style={styles.title} >{translate('ContactUs.fullname')}</Text>
28+
<TextInput
29+
style={styles.input}
30+
placeholder={translate('ContactUs.fullname')}
31+
placeholderTextColor={colors.Grey}
32+
/>
33+
</View>
34+
<View style={styles.inputContainer}>
35+
<Text style={styles.title} >{translate('ContactUs.email')}</Text>
36+
<TextInput
37+
style={styles.input}
38+
placeholder={translate('ContactUs.email')}
39+
placeholderTextColor={colors.Grey}
40+
/>
41+
</View>
42+
<View style={styles.inputContainer}>
43+
<Text style={styles.title} >{translate('ContactUs.subject')}</Text>
44+
<TextInput
45+
style={styles.input}
46+
placeholder={translate('ContactUs.subject_input')}
47+
placeholderTextColor={colors.Grey}
48+
/>
49+
</View>
50+
<View style={styles.inputContainer}>
51+
<Text style={styles.title} >{translate('ContactUs.message')}</Text>
52+
<TextInput
53+
style={styles.input_message}
54+
placeholder={translate('ContactUs.write_message')}
55+
placeholderTextColor={colors.Grey}
56+
multiline={true}
57+
/>
58+
</View>
59+
<TouchableOpacity style={styles.button}>
60+
<Text style={styles.submit}>{translate('ContactUs.submit')}</Text>
61+
</TouchableOpacity>
3362
</View>
34-
<View style={styles.inputContainer}>
35-
<Text style={styles.title} >{translate('ContactUs.subject')}</Text>
36-
<TextInput
37-
style={styles.input}
38-
placeholder={translate('ContactUs.subject_input')}
39-
placeholderTextColor={colors.Grey}
40-
/>
41-
</View>
42-
<View style={styles.inputContainer}>
43-
<Text style={styles.title} >{translate('ContactUs.message')}</Text>
44-
<TextInput
45-
style={styles.input_message}
46-
placeholder={translate('ContactUs.write_message')}
47-
placeholderTextColor={colors.Grey}
48-
multiline={true}
49-
/>
50-
</View>
51-
<TouchableOpacity style={styles.button}>
52-
<Text style={styles.submit}>{translate('ContactUs.submit')}</Text>
53-
</TouchableOpacity>
54-
</View>
55-
</ScrollView>
63+
</ScrollView>
64+
</View>
5665
</View>
5766
)
5867
}

Components/ContactUS/Styles.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ export const styles = StyleSheet.create({
66
flex: 1,
77
backgroundColor: colors.White,
88
},
9+
close: {
10+
width: responsiveWidth(32),
11+
height: responsiveHeight(32),
12+
right: responsiveWidth(24),
13+
top: responsiveHeight(60),
14+
position: 'absolute',
15+
zIndex: 999,
16+
tintColor: colors.White
17+
},
918
scrollContainer: {
1019
paddingBottom: responsiveHeight(200)
1120
},
@@ -15,12 +24,14 @@ export const styles = StyleSheet.create({
1524
borderBottomRightRadius: 30,
1625
width: responsiveWidth(430),
1726
height: responsiveHeight(288),
27+
zIndex: -1
1828
},
1929
cover: {
2030
borderBottomLeftRadius: 30,
2131
borderBottomRightRadius: 30,
2232
width: responsiveWidth(430),
2333
height: responsiveHeight(288),
34+
zIndex: -1
2435
},
2536
textInputContainer: {
2637
flex: 1,

Components/Context/Context.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const UserProvider = ({ children }) => {
66

77
// for the main menu screen
88
const [ modalVisible, setModalVisible ] = useState(false);
9+
const [ screen, setScreen ] = useState('Home');
910
// hide the main menu
1011
const hideModal = () => setModalVisible(false);
1112
// show the main menu
@@ -18,8 +19,22 @@ const UserProvider = ({ children }) => {
1819
// show the loader
1920
const showLoader = () => setLoaderVisible(true);
2021

22+
// for the popupmessages
23+
const [ popupMessageVisible, setPopupMessageVisible ] = useState(false);
24+
// hide the popupmessage
25+
const hidePopupMessage = () => setPopupMessageVisible(false);
26+
// show the popupmessage
27+
const showPopupMessage = () => setPopupMessageVisible(true);
28+
2129
return (
22-
<UserContext.Provider value={{ modalVisible, hideModal, showModal, loaderVisible, hideLoader, showLoader }}>
30+
<UserContext.Provider
31+
value={{
32+
modalVisible, hideModal, showModal,
33+
loaderVisible, hideLoader, showLoader,
34+
popupMessageVisible, hidePopupMessage, showPopupMessage,
35+
screen, setScreen
36+
}}
37+
>
2338
{children}
2439
</UserContext.Provider>
2540
)

0 commit comments

Comments
 (0)