Commit 286d2500 authored by Solveig Hergot Langås's avatar Solveig Hergot Langås
Browse files

#23 Changed the Favourite page for when the user has no favourite

parents 9c8cc771 9dbe8293
......@@ -220,4 +220,5 @@ ActionButton.propTypes = {
onPress: PropTypes.func.isRequired,
};
export default MaterialDialog;
\ No newline at end of file
......@@ -106,7 +106,7 @@ class Card extends Component {
<View>
<FlatList contentContainerStyle={{
width: 350,
paddingBottom: 65
paddingBottom: 80
}}
data = {data}
renderItem = { ({ item }) => (
......@@ -121,7 +121,6 @@ class Card extends Component {
maxToRenderPerBatch = {10}
windowSize = {5}
keyExtractor={(item, index) => index.toString()}
//updateCellsBatchingPeriod = {10}
/>
<MaterialDialog
......
......@@ -51,6 +51,21 @@ class FavouritePage extends Component {
backgroundColor: 'aliceblue'
},
})
console.log(this.state.favourite)
console.log("Burde det funke? ")
console.log(this.props.fav)
console.log(this.props.log === undefined)
if (this.props.fav === "" || this.props.fav === undefined){
return(
<View style = {styles.container}>
<Text style = {{fontSize: 20}}> You have not chosen a favourite destination yet! </Text>
<Text style = {{fontSize: 14}} > Browse our app to find to find your dream destination. </Text>
</View>)
} else {
return (
<View style={styles.container}>
<Text style={{fontSize: 28, textAlign: "center", padding: 8}}>Your favourite destination</Text>
......@@ -63,7 +78,7 @@ class FavouritePage extends Component {
</View>
);
}
}}
}
const mapStateToProps = (state) => { //give us accsess to the data in store
......
Supports Markdown
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