Skip to content

Commit dc3986e

Browse files
authored
Merge pull request #38 from Etlas-SCU/dev
Dev
2 parents 617c05c + 93f9db1 commit dc3986e

File tree

26 files changed

+667
-62
lines changed

26 files changed

+667
-62
lines changed

.github/workflows/Expo.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: update
2+
on: push
3+
4+
jobs:
5+
update:
6+
name: EAS Update
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check for EXPO_TOKEN
10+
run: |
11+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
12+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
13+
exit 1
14+
fi
15+
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18.x
23+
cache: yarn
24+
25+
- name: Setup EAS
26+
uses: expo/expo-github-action@v8
27+
with:
28+
eas-version: latest
29+
token: ${{ secrets.EXPO_TOKEN }}
30+
31+
- name: Install dependencies
32+
run: yarn install
33+
34+
- name: Publish update
35+
run: eas update --auto

App.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import ForgotPasswordSecond from './Components/ForgetPassword/ForgetPasswordSeco
1616
import ForgotPasswordThird from './Components/ForgetPassword/ForgetPasswordThird';
1717
import BestScore from './Components/BestScore/BestScore';
1818
import EditProfile from './Components/EditProfile/EditProfile';
19+
import { StatusBar } from 'expo-status-bar';
1920

2021

2122
// import the screen
@@ -87,6 +88,11 @@ export default function App() {
8788
// if the font loaded, return the components
8889
return (
8990
<UserProvider>
91+
<StatusBar
92+
backgroundColor={'transparent'}
93+
barStyle='light-content'
94+
translucent={true}
95+
/>
9096
<NavigationContainer>
9197
<Stack.Navigator screenOptions={{
9298
header: () => null,
@@ -95,6 +101,7 @@ export default function App() {
95101
open: timingConfig,
96102
close: timingConfig,
97103
},
104+
headerStatusBarHeight: 0
98105
}}
99106
>
100107
<Stack.Screen name="onBoarding" component={OnBoarding} />

AppStyles.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export const styles = StyleSheet.create({
1111
// dimesnions of the mobile
1212
export const dimensions = {
1313
fullHeight: Dimensions.get('window').height,
14-
fullWidth: Dimensions.get('window').width
14+
fullWidth: Dimensions.get('window').width,
15+
fontScale: Dimensions.get("window").fontScale
1516
}
1617

1718

@@ -24,10 +25,7 @@ export const UI_dimensions = {
2425

2526
// get the responsive font size
2627
export const responsiveFontSize = size => {
27-
const fontScale = PixelRatio.getFontScale();
28-
const getFontSize = size => size / fontScale;
29-
const fontSize = getFontSize(size);
30-
return Math.round(PixelRatio.roundToNearestPixel(fontSize));
28+
return Math.floor(PixelRatio.roundToNearestPixel(size / dimensions.fontScale));
3129
};
3230

3331

@@ -94,6 +92,7 @@ export const colors = {
9492
LightGrey: '#B5B5B5',
9593
DarkGrey: '#606060',
9694
Red: '#e24c4b',
95+
DarkRed: '#A41350',
9796
Green: '#0aa06e',
9897
Blue: '#0000FF',
9998
Yellow: '#fe9800',
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { View, Text, Image, TouchableOpacity } from "react-native";
33
import { translate } from "../../Localization";
44

55

6-
export default function MonumentsCard({ monument, isPage }) {
6+
export default function ArticleCard({ navigation, article, screen }) {
77

8-
const { Title, Description, Date, Img } = monument;
8+
const { Title, Description, Date, Img } = article;
9+
const isPage = (screen != 'Home');
910

1011
return (
1112
<View style={isPage ? Page.MonumentsCard : Swipper.MonumentsCard}>
@@ -16,7 +17,13 @@ export default function MonumentsCard({ monument, isPage }) {
1617
<Text style={isPage ? Page.MonumentsCardDate : Swipper.MonumentsCardDate}>{Date}</Text>
1718
</View>
1819
<View style={isPage ? Page.line : Swipper.line} />
19-
<TouchableOpacity>
20+
<TouchableOpacity
21+
onPress={
22+
() => {
23+
navigation.navigate('ArticleDetails', { Article: article, screen: screen })
24+
}
25+
}
26+
>
2027
<Text style={isPage ? Page.learn : Swipper.learn}>{translate('Home.learnmore')}</Text>
2128
</TouchableOpacity>
2229
</View>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { View, Text, ScrollView, Image, TouchableOpacity } from "react-native";
2+
import { styles } from "./Styles";
3+
import { useState } from "react";
4+
5+
6+
export default function ArticleDetails({ navigation, route }) {
7+
8+
let images_src = Array(5).fill(require('../../assets/TourPage/Tour1.png'));
9+
const images = images_src.map((src, idx) => (<Image source={src} style={styles.image} key={idx}/>));
10+
11+
// get the parameters needed
12+
const { Article, screen } = route.params;
13+
const { Title, Date, Img, fullDescription } = Article;
14+
15+
16+
// get the icons of heart
17+
const fav = require('../../assets/ArticleDetails/filled.png');
18+
const notFav = require('../../assets/ArticleDetails/notfilled.png');
19+
20+
// get the icons of heart
21+
const [favIcon, setFavIcon] = useState(notFav);
22+
23+
// change the icon of heart
24+
const toggleFav = () => {
25+
setFavIcon(fav == favIcon ? notFav : fav);
26+
}
27+
28+
return (
29+
<View style={styles.container}>
30+
<TouchableOpacity
31+
onPress={() => { navigation.navigate(screen) }}
32+
>
33+
<Image source={require('../../assets/Scan/Arr.png')} style={styles.back}/>
34+
</TouchableOpacity>
35+
<Image source={Img} style={styles.upperBox} resizeMode='cover'/>
36+
<View style={styles.lowerBox}>
37+
<View style={styles.upperFields}>
38+
<View style={styles.txts}>
39+
<Text style={styles.title}>{Title}</Text>
40+
<Text style={styles.date}>{Date}</Text>
41+
</View>
42+
<View style={styles.favouriteConainer}>
43+
<View style={styles.fav}>
44+
<TouchableOpacity onPress={toggleFav}>
45+
<Image source={favIcon} style={styles.favIcon} resizeMode="contain"/>
46+
</TouchableOpacity>
47+
</View>
48+
</View>
49+
</View>
50+
<ScrollView contentContainerStyle={styles.scrollView} showsVerticalScrollIndicator={false}>
51+
<Text style={styles.description}>{fullDescription}</Text>
52+
</ScrollView>
53+
</View>
54+
</View>
55+
)
56+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { StyleSheet } from "react-native";
2+
import { colors, fontFamily, responsiveFontSize, responsiveHeight, responsiveWidth, dimensions } from "../../AppStyles";
3+
4+
export const styles = StyleSheet.create({
5+
container: {
6+
flex: 1,
7+
backgroundColor: colors.White,
8+
},
9+
back: {
10+
width: responsiveWidth(32),
11+
height: responsiveHeight(32),
12+
right: responsiveWidth(24),
13+
top: responsiveHeight(60),
14+
position: 'absolute',
15+
tintColor: colors.SolidGrey,
16+
zIndex: 999
17+
},
18+
upperBox: {
19+
width: dimensions.fullWidth,
20+
height: responsiveHeight(431),
21+
zIndex: -1
22+
},
23+
lowerBox: {
24+
flex: 1,
25+
backgroundColor: colors.DarkCyan,
26+
borderTopLeftRadius: responsiveWidth(30),
27+
borderTopRightRadius: responsiveWidth(30),
28+
marginTop: responsiveHeight(-30),
29+
},
30+
title: {
31+
fontFamily: fontFamily.MontserratBold,
32+
fontSize: responsiveFontSize(22),
33+
color: colors.Gold,
34+
},
35+
date: {
36+
fontFamily: fontFamily.MontserratRegular,
37+
fontSize: responsiveFontSize(12),
38+
color: colors.White,
39+
},
40+
scrollView: {
41+
marginTop: responsiveHeight(32),
42+
marginHorizontal: responsiveWidth(24),
43+
paddingBottom: responsiveHeight(150)
44+
},
45+
description: {
46+
fontFamily: fontFamily.MontserratRegular,
47+
fontSize: responsiveFontSize(18),
48+
color: colors.White,
49+
},
50+
upperFields: {
51+
flexDirection: 'row',
52+
justifyContent: 'space-between',
53+
marginHorizontal: responsiveWidth(24),
54+
marginTop: responsiveHeight(22),
55+
},
56+
txts: {
57+
gap: responsiveHeight(5)
58+
},
59+
favouriteConainer: {
60+
justifyContent: 'center'
61+
},
62+
fav: {
63+
width: responsiveWidth(64),
64+
height: responsiveHeight(64),
65+
borderRadius: 20,
66+
backgroundColor: colors.DarkRed,
67+
justifyContent: 'center',
68+
},
69+
favIcon: {
70+
width: responsiveWidth(39.75),
71+
height: responsiveHeight(35.26),
72+
alignSelf: 'center',
73+
}
74+
})

Components/ArticlesPage/ArticlesPage.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { styles } from "./Styles";
33
import { View, ScrollView, Text, TouchableOpacity, Image, TextInput } from "react-native";
44
import { translate } from "../../Localization";
55
import { colors } from "../../AppStyles";
6-
import MonumentsCard from "../MonumentsCard/MonumentsCard";
6+
import ArticleCard from "../ArticleCard/ArticleCard";
77
import { UserContext } from "../Context/Context";
88
import MainMenu from "../MainMenu/MainMenu";
99
import { isIOS } from "../../AppStyles";
@@ -14,18 +14,23 @@ export default function ArticlesPage({ navigation }) {
1414
const [searchTerm, setSearchTerm] = useState('');
1515
const { showModal, setScreen } = useContext(UserContext);
1616

17-
const Monument = {
18-
Title: "Anibus",
17+
const Article = {
18+
Title: "Anubis",
1919
Description: "Know more about Anubis and his powers.",
2020
Date: "15 Jan 2023",
21-
Img: require('../../assets/HomePage/monument.png')
21+
Img: require('../../assets/HomePage/monument.png'),
22+
fullDescription: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
23+
has been the industry's standard dummy text ever since the 1500s, when an unknown
24+
printer took a galley of type and scrambled it to make a type specimen book. It has survived
25+
not only five centuries, but also the leap into electronic typesetting, remaining essentially
26+
unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`
2227
};
2328

24-
let monumentList = [];
29+
let ArticleList = [];
2530
for (let i = 0; i < 20; i++)
26-
monumentList.push(Monument);
31+
ArticleList.push(Article);
2732

28-
const monuments = monumentList.map((monument, idx) => <MonumentsCard monument={monument} key={idx} isPage={true} />);
33+
const Articles = ArticleList.map((article, idx) => <ArticleCard article={article} key={idx} navigation={navigation} screen={'ArticlesPage'}/>);
2934

3035
return (
3136
<View style={styles.container}>
@@ -53,7 +58,7 @@ export default function ArticlesPage({ navigation }) {
5358
</TouchableOpacity>
5459
</View>
5560
<View style={styles.Box}>
56-
{monuments}
61+
{Articles}
5762
</View>
5863
</ScrollView>
5964
</View>

Components/ForgetPassword/ForgetPasswordSecond.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function ForgotPasswordSecond({ navigation }) {
3737
{ popupMessageVisible ? <PopupMessage state={'Error'} message={'Invalid OTP'} /> : null }
3838
<OTPTextInput
3939
ref={otpInput}
40-
inputCount={6}
40+
inputCount={4}
4141
containerStyle={styles.otpInputContainer}
4242
textInputStyle={styles.underlineStyleBase}
4343
tintColor={colors.LightSeaGreen}

Components/ForgetPassword/Styles.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ export const styles = StyleSheet.create({
8686
},
8787
otpInputContainer: {
8888
marginTop: responsiveHeight(94),
89-
marginHorizontal: responsiveWidth(24),
90-
width: responsiveWidth(380),
91-
height: responsiveHeight(85)
89+
marginHorizontal: responsiveWidth(25),
90+
height: responsiveHeight(81)
9291
},
9392
underlineStyleBase: {
94-
width: responsiveWidth(50),
95-
height: responsiveHeight(55),
96-
borderRadius: 15,
93+
width: responsiveWidth(81),
94+
height: responsiveHeight(81),
95+
borderRadius: 20,
9796
backgroundColor: colors.White,
9897
color: colors.Black,
99-
fontSize: responsiveFontSize(20),
98+
fontSize: responsiveFontSize(32),
10099
},
101100
resend: {
102101
marginHorizontal: responsiveWidth(24),
102+
marginTop: responsiveHeight(19),
103103
},
104104
ResendText: {
105105
fontFamily: fontFamily.MontserratMedium,

0 commit comments

Comments
 (0)