Commit 8a9e3d69 authored by Thomas's avatar Thomas
Browse files

no message

parent 74565425
......@@ -7676,6 +7676,15 @@
"prop-types": "^15.7.2"
}
},
"react-native-flash-message": {
"version": "0.1.23",
"resolved": "https://registry.npmjs.org/react-native-flash-message/-/react-native-flash-message-0.1.23.tgz",
"integrity": "sha512-T++KNGpIofXRqj3fT+/zJH/su1VgIjGcwiJerSvRsvEXwai1LdUl+O0tX7dz+Lgxi7yzswXKWcUQmY0dZrbG3g==",
"requires": {
"prop-types": "^15.7.2",
"react-native-iphone-x-helper": "^1.3.0"
}
},
"react-native-gesture-handler": {
"version": "1.10.3",
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.10.3.tgz",
......
......@@ -26,6 +26,7 @@
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-elements": "^3.4.1",
"react-native-firebase": "^5.6.0",
"react-native-flash-message": "^0.1.23",
"react-native-gesture-handler": "~1.10.2",
"react-native-maps": "^0.28.0",
"react-native-reanimated": "~2.1.0",
......
......@@ -5,10 +5,13 @@ import { SafeAreaView, Platform, StyleSheet, Share,
import { MaterialCommunityIcons } from '@expo/vector-icons';
import MapView from 'react-native-maps';
import { Overlay } from 'react-native-elements';
import * as SQLite from 'expo-sqlite';
import { showMessage, hideMessage } from "react-native-flash-message";
import FlashMessage from "react-native-flash-message";
export default function BrandScreen({ navigation, route }) {
const {BrandName, Score, Logo, Summary, Updated} = route.params
const [favorite, setFavorite] = React.useState(false);
const onShare = async () => {
try {
......@@ -48,6 +51,27 @@ export default function BrandScreen({ navigation, route }) {
var t = new Date(unformattedDate * 1000);
var dateFormatted = ('0' + t.getDate()).slice(-2) + '-' + ('0' + t.getMonth()).slice(-2) + '-' + ('0' + t.getYear()).slice(-2) + ' ' + ('0' + t.getHours()).slice(-2) + ':' + ('0' + t.getMinutes()).slice(-2);
const addToFavorites = () => {
setFavorite(!favorite)
// message for adding/deleting a brand to/from favorites
favorite ? showMessage({
message: "Brand deleted from favorites",
icon: 'danger',
backgroundColor: '#A5D6AA',
color: 'black',
duration: 1000
})
:
showMessage({
message: "Brand added to favorites",
icon: 'success',
backgroundColor: '#A5D6AA',
color: 'black',
duration: 900
});
}
return(
<SafeAreaView style={style.Container}>
{/*header */}
......@@ -61,14 +85,15 @@ export default function BrandScreen({ navigation, route }) {
</View>
<View style={style.Icons}>
{/*favorite button*/}
<TouchableOpacity onPress={() => alert(BrandName)}>
<MaterialCommunityIcons style={{paddingRight: '5%'}} name="star-outline" size={30}/>
<TouchableOpacity onPress={addToFavorites}>
<MaterialCommunityIcons style={{paddingRight: '5%'}} name={favorite ? 'star': 'star-outline'} size={30}/>
</TouchableOpacity>
{/*share button*/}
<TouchableOpacity onPress={onShare}>
<MaterialCommunityIcons name="share-variant" size={30}/>
</TouchableOpacity>
</View>
<FlashMessage position="top" />
</View>
{/*block*/}
......
......@@ -24,7 +24,7 @@ export default function Contact( {navigation}) {
</View>
<View style={style.Row}>
<Icon name='email' size={25} />
<Text style={style.Space} >tracloso@gmail.com</Text>
<Text style={style.Space} >info@tracloso.com</Text>
</View>
<View style={style.Row}>
<Icon name='twitter' size={25} />
......@@ -38,6 +38,10 @@ export default function Contact( {navigation}) {
<Icon name='instagram' size={25} />
<Text style={style.Space} >@Tracloso</Text>
</View>
<View style={style.Row}>
<Icon name='linkedin' size={25} />
<Text style={style.Space} >Tracloso</Text>
</View>
</View>
</SafeAreaView>
);
......
......@@ -30,13 +30,13 @@ export default function Information({navigation}) {
{/*link to about and contact page*/}
<Divider style={{marginTop: 5}}/>
<TouchableOpacity style={style.Click} onPress={() => navigation.navigate('About')}>
<Text style={[style.title, {paddingTop:5}]}>About</Text>
<Text style={{paddingTop:5, fontSize:17}}>About</Text>
<Icon name='right' size={18} style={{paddingTop: '2%'}} color='#767577'/>
</TouchableOpacity>
<Divider style={{marginTop: 5}}/>
<Divider style={{marginTop: 8}}/>
<TouchableOpacity style={style.Click} onPress={() => navigation.navigate('Contact')}>
<Text style={[style.title, {paddingTop:5}]}>Contact</Text>
<Icon name='right' size={18} style={{paddingTop: '4%'}} color='#767577'/>
<Text style={{paddingTop:5, fontSize:17}}>Contact</Text>
<Icon name='right' size={18} style={{paddingTop: '2%'}} color='#767577'/>
</TouchableOpacity>
</View>
</ScrollView>
......
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