Commit 0aeeb6f1 authored by Thomas's avatar Thomas
Browse files

no message

parent 615a592a
This diff is collapsed.
......@@ -12,12 +12,20 @@
"@react-navigation/bottom-tabs": "^5.11.11",
"@react-navigation/native": "^5.9.4",
"@react-navigation/stack": "^5.14.5",
"body-parser": "^1.19.0",
"expo": "~41.0.1",
"expo-asset": "~8.3.1",
"expo-file-system": "~11.0.2",
"expo-sqlite": "~9.1.0",
"expo-status-bar": "~1.0.4",
"express": "^4.17.1",
"firebase": "^8.6.8",
"mysql": "^2.18.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"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-gesture-handler": "~1.10.2",
"react-native-maps": "^0.28.0",
"react-native-reanimated": "~2.1.0",
......@@ -28,10 +36,7 @@
"react-native-web": "^0.16.5",
"react-navigation": "^4.4.4",
"react-navigation-drawer": "^2.7.1",
"react-navigation-stack": "^2.10.4",
"expo-sqlite": "~9.1.0",
"expo-file-system": "~11.0.2",
"expo-asset": "~8.3.1"
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"@babel/core": "^7.9.0"
......
......@@ -17,25 +17,27 @@ export default function Contact( {navigation}) {
<MaterialCommunityIcons style={style.Arrow} name="chevron-left" size={18}/>
<Text>back</Text>
</TouchableOpacity>
<View style={style.Row}>
<Icon name='phone' size={25} />
<Text style={style.Space} >+31 6 12345678</Text>
</View>
<View style={style.Row}>
<Icon name='email' size={25} />
<Text style={style.Space} >tracloso@gmail.com</Text>
</View>
<View style={style.Row}>
<Icon name='twitter' size={25} />
<Text style={style.Space} >@tracloso</Text>
</View>
<View style={style.Row}>
<Icon name='facebook' size={25} />
<Text style={style.Space} >Tracloso</Text>
</View>
<View style={style.Row}>
<Icon name='instagram' size={25} />
<Text style={style.Space} >@Tracloso</Text>
<View style={style.Content}>
<View style={style.Row}>
<Icon name='phone' size={25} />
<Text style={style.Space} >+31 6 12345678</Text>
</View>
<View style={style.Row}>
<Icon name='email' size={25} />
<Text style={style.Space} >tracloso@gmail.com</Text>
</View>
<View style={style.Row}>
<Icon name='twitter' size={25} />
<Text style={style.Space} >@tracloso</Text>
</View>
<View style={style.Row}>
<Icon name='facebook' size={25} />
<Text style={style.Space} >Tracloso</Text>
</View>
<View style={style.Row}>
<Icon name='instagram' size={25} />
<Text style={style.Space} >@Tracloso</Text>
</View>
</View>
</SafeAreaView>
);
......@@ -76,6 +78,9 @@ const style = StyleSheet.create({
}
})
},
Content: {
marginTop: 10
},
Row: {
flexDirection: 'row',
margin: 10,
......
import * as React from 'react';
import {useState, useEffect} from 'react';
import { SafeAreaView, StyleSheet, Text, FlatList, Image, TouchableOpacity } from 'react-native';
import HeaderComponent from '../components/Header';
import Card from '../components/Card';
import {getBrands} from '../backend/GetBrand.js';
import firebase from 'firebase/app';
//view for the homescreen
export default function Home({ navigation }) {
......@@ -10,23 +13,63 @@ export default function Home({ navigation }) {
setSelectedIndex
] = React.useState(0);
let [listData, setListData] = useState([]);
const firebaseConfig = {
apiKey: "AIzaSyDUlK-IJcotasPrL9WUqCO1Z86JufUNwJE",
authDomain: "tracloso.firebaseapp.com",
databaseURL: "https://tracloso-default-rtdb.europe-west1.firebasedatabase.app",
projectId: "tracloso",
storageBucket: "tracloso.appspot.com",
messagingSenderId: "174173890413",
appId: "1:174173890413:web:0df0a89c1472cb3cff1c64",
measurementId: "G-EVHYYE4775"
};
if (firebase.apps.length === 0) {
firebase.initializeApp(firebaseConfig)
}
useEffect(() => {
//retrieve record from firebase database
firebase.firestore().collection('Brand').get().then((querySnapshot) => {
let temp = []
console.log('Total brands: ', querySnapshot.size);
querySnapshot.forEach(snapshot => {
console.log('brand ID: ', snapshot.data().brand_name)
let brandDetails = {};
brandDetails = snapshot.data();
temp.push(brandDetails);
setListData(temp)
});
});
}, []);
let renderCard = ({ item }) => {
return(
<Card
BrandName = {item.brand_name}
Score = {item.brand_score}
Logo = {item.brand_logo}
/>
);
};
console.log(listData)
return (
//this 'SafeAreaView' is required to render it safe on the screen, within the margins
<SafeAreaView forceInset={{ bottom: 'always' }} style={style.container}>
<HeaderComponent
selectedIndex={selectedIndex}
selectedIndex={selectedIndex}
setSelectedIndex={setSelectedIndex}
/>
<Card
BrandName="Adidas"
Score="83"
Logo={require('../assets/Adidas.png')}
/>
<Card
BrandName="Nike"
Score="50"
Logo={require('../assets/Nike.png')}
/>
<FlatList
data={listData}
keyExtractor={(item, index) => index.toString()}
renderitem = {renderCard}
/>
</SafeAreaView>
);
}
......
......@@ -17,14 +17,17 @@ export default function Information({navigation}) {
<ScrollView>
<View style={style.content}>
{/*question 1*/}
<Text style={style.title}>How did we get the information?</Text>
<Text>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in oluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</Text>
{/*question 2*/}
<Text style={[style.title, {paddingTop:15}]}>What does the score mean?</Text>
<Text style={{marginBottom: 20}}>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in oluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</Text>
{/*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>
......
......@@ -5,6 +5,8 @@ import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { Overlay } from 'react-native-elements';
import firebase from 'firebase/app';
import 'firebase/firestore'
//view for the requestform
export default function RequestForm() {
......@@ -36,6 +38,29 @@ export default function RequestForm() {
return;
}
//Checked Successfully
const firebaseConfig = {
apiKey: "AIzaSyDUlK-IJcotasPrL9WUqCO1Z86JufUNwJE",
authDomain: "tracloso.firebaseapp.com",
databaseURL: "https://tracloso-default-rtdb.europe-west1.firebasedatabase.app",
projectId: "tracloso",
storageBucket: "tracloso.appspot.com",
messagingSenderId: "174173890413",
appId: "1:174173890413:web:0df0a89c1472cb3cff1c64",
measurementId: "G-EVHYYE4775"
};
if (firebase.apps.length === 0) {
firebase.initializeApp(firebaseConfig)
}
//store record in firebase database
firebase.firestore().collection('Form').add({
name: Name,
email: Mail,
motivation: Motivation,
created_at: firebase.firestore.FieldValue.serverTimestamp()
});
//send email using php file
fetch('https://webspace.science.uu.nl/~8571333/tracloso/form.php', {
method: 'Post',
headers: {
......@@ -48,9 +73,11 @@ export default function RequestForm() {
motivation: Motivation
})
})
Alert.alert("Your request has been received!",
`We send you a conformation email and we keep you updated through the mail. You can also find more information on our social media!`)
`We'll send you a conformation email and we keep you updated through the mail. You can also find more information on our social media!`)
//empty fields
onChangeName('');
onChangeMail('');
onChangeMotivation('');
......@@ -74,12 +101,14 @@ export default function RequestForm() {
return (
<SafeAreaView style={style.container}>
{/*header*/}
<View style={style.FormHeader}>
<Text style={style.HeaderText}>Brand Request Form</Text>
<TouchableOpacity style={style.Icons} onPress={toggleOverlay}>
<MaterialCommunityIcons name="help-circle-outline" size={30}/>
</TouchableOpacity>
</View>
{/*form*/}
<View style={style.Form}>
<View style={style.InputComponent}>
<Text style={style.InputText}>Company Name *</Text>
......@@ -113,12 +142,14 @@ export default function RequestForm() {
multiline= {true}
/>
</View>
{/*send button*/}
<View style={{alignItems: 'center',}}>
<TouchableOpacity onPress={checkTextInput} style={[style.SubmitButton, {backgroundColor: ButtonColor}]} disabled={buttonDisabled}>
<Text style={style.ButtonText}>Send</Text>
</TouchableOpacity>
</View>
</View>
{/*overlay for help*/}
<View>
<Overlay
fullScreen= 'true'
......
......@@ -25,13 +25,14 @@ export default function Settings() {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
return (
<SafeAreaView style={style.container}>
{/*header*/}
<View style={style.Sheader}>
<Text style={style.SheaderText}>Settings</Text>
</View>
<View style={style.SContent}>
{/*dark mode*/}
<View style={style.row}>
<Text style={style.Stext} >Dark mode</Text>
<Switch
......@@ -43,6 +44,7 @@ export default function Settings() {
value={isEnabledDarkMode}
/>
</View>
{/*notification*/}
<View style={style.row}>
<Text style={style.Stext}>Notifications</Text>
<Switch
......@@ -54,6 +56,7 @@ export default function Settings() {
value={isEnabledNotification}
/>
</View>
{/*language*/}
<View style={style.collapse}>
<TouchableOpacity
style={style.Accordion}
......
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