Commit ca1b4f05 authored by Thomas's avatar Thomas
Browse files

no message

parent b52ce66a
......@@ -2235,6 +2235,11 @@
"react-native-iphone-x-helper": "^1.3.0"
}
},
"@types/geojson": {
"version": "7946.0.7",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.7.tgz",
"integrity": "sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ=="
},
"@types/hammerjs": {
"version": "2.0.39",
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.39.tgz",
......@@ -6992,6 +6997,14 @@
"resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz",
"integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
},
"react-native-maps": {
"version": "0.28.0",
"resolved": "https://registry.npmjs.org/react-native-maps/-/react-native-maps-0.28.0.tgz",
"integrity": "sha512-F+k5ZT9hhl+iXR1H+5ZcoHOEB5lPu9gCIwtA4lI/LoI9nfa9xFvr1vMiLIv44jzeGNzbE3+/R81IpcNDMJ5uDg==",
"requires": {
"@types/geojson": "^7946.0.7"
}
},
"react-native-ratings": {
"version": "7.6.1",
"resolved": "https://registry.npmjs.org/react-native-ratings/-/react-native-ratings-7.6.1.tgz",
......
......@@ -19,6 +19,7 @@
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-elements": "^3.4.1",
"react-native-gesture-handler": "~1.10.2",
"react-native-maps": "^0.28.0",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-safe-area-view": "^1.1.1",
......
import * as React from 'react';
import { SafeAreaView, Platform, StyleSheet, Share, TouchableOpacity, Text, View, Image } from 'react-native';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import MapView from 'react-native-maps';
export default function BrandScreen({ navigation, route }) {
const {BrandName, Score, Logo} = route.params
......@@ -24,8 +25,19 @@ export default function BrandScreen({ navigation, route }) {
alert(error.message);
}}
let transparencyColor;
if (Score <= 100 && Score >= 70) {
var transparancyColor = '#52D858'
} else if(Score < 70 && Score >= 50) {
var transparancyColor = '#F2B05C'
} else {
var transparancyColor = '#FAA09E'
}
return(
<SafeAreaView style={style.Container}>
{/*header */}
<View style={style.BrandHeader}>
<View style={{flexDirection: 'row'}}>
<Image
......@@ -35,20 +47,34 @@ export default function BrandScreen({ navigation, route }) {
<Text style={style.BrandText}>{BrandName}</Text>
</View>
<View style={style.Icons}>
{/*favorite button*/}
<TouchableOpacity onPress={() => alert("You clicked on favorite")}>
<MaterialCommunityIcons style={{paddingRight: '5%'}} name="star-outline" size={30}/>
</TouchableOpacity>
{/*share button*/}
<TouchableOpacity onPress={onShare}>
<MaterialCommunityIcons name="share-variant" size={30}/>
</TouchableOpacity>
</View>
</View>
<View>
<TouchableOpacity style={style.BackButton} onPress={() => navigation.goBack()}>
<MaterialCommunityIcons style={style.Arrow} name="chevron-left" size={18}/>
<Text>back</Text>
</TouchableOpacity>
{/*block*/}
<View style={{flexDirection: 'row', justifyContent:'space-between'}}>
{/*back button*/}
<View>
<TouchableOpacity style={style.BackButton} onPress={() => navigation.goBack()}>
<MaterialCommunityIcons style={style.Arrow} name="chevron-left" size={18}/>
<Text>back</Text>
</TouchableOpacity>
<Text style={style.UpdateText}>Last updated on 24-5-2021 13:37</Text>
</View>
{/*transparancy score*/}
<View style={[style.transparancyBox, {shadowColor: transparancyColor}]}>
<Text style={[style.transparancyText, {color: transparancyColor}]}>{Score}%</Text>
</View>
</View>
</SafeAreaView>
)
}
......@@ -96,4 +122,35 @@ const style = StyleSheet.create ({
Arrow: {
paddingTop: 2
},
transparancyBox: {
backgroundColor: '#ffffff',
height: 30,
borderRadius: 100,
width: 70,
shadowOffset: {
width: 0,
height: 12,
},
shadowOpacity: 0.58 ,
shadowRadius: 16,
elevation: 24,
marginRight: 20,
marginTop: 20
},
transparancyText: {
textAlign: 'center',
fontSize: 16,
paddingTop: '3%'
},
UpdateText: {
marginLeft: '5%',
marginTop: 3,
color: '#979797',
fontStyle: 'italic',
fontSize: 12
},
Map: {
width: 200,
height: 200,
}
})
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment