trucs cools mais pas d'étoile à droite aled

master
Mathilde JEAN 2 years ago
parent 6f398fe1b1
commit 9f9dacefaf

@ -1,5 +1,5 @@
{
"expoServerPort": null,
"expoServerPort": 19000,
"packagerPort": 19000,
"packagerPid": null,
"expoServerNgrokUrl": null,

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -1,6 +1,6 @@
import React, { useState, useSyncExternalStore } from "react";
import { View, StyleSheet, Text, Button, TouchableHighlight, Image } from "react-native";
import { City, getCurrentWeather, Weather } from "../data/stub";
import { City, FAVORITE_CITY_DATA, getCurrentWeather, Weather } from "../data/stub";
type VilleProps = {
@ -19,8 +19,8 @@ const weather = getCurrentWeather(props.city.name);
<Text>{props.city.latitude} - {props.city.longitude}</Text>
</View>
<Text style={styles.temperature}>{weather?.temperature}</Text>
<TouchableHighlight /*onPress={() => props.fav = this.city}*/>
<Image source={ props.city==props.fav ? require('../assets/yellowstar.png') : require('../assets/blackstar.png')} style={styles.button}/>
<TouchableHighlight /*onPress={() => FAVORITE_CITY_DATA = this.city}*/>
<Image source={props.city.longitude===FAVORITE_CITY_DATA.longitude && props.city.latitude===FAVORITE_CITY_DATA.latitude ? require('../assets/yellowstar.png') : require('../assets/blackstar.png')} style={styles.button}/>
</TouchableHighlight>
</View>
</View>

@ -1,8 +1,8 @@
import React from "react";
import { View, Text } from "react-native";
import { View, Text, StyleSheet, TouchableHighlight, Image } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { TopBar } from "../components/TopBar";
import { getCurrentWeather } from "../data/stub";
import { FAVORITE_CITY_DATA, getCurrentWeather, WEATHER_DATA } from "../data/stub";
export default function CityDetails({route}){
const insets = useSafeAreaInsets();
@ -11,10 +11,87 @@ export default function CityDetails({route}){
const city = route.params.city;
const weather = getCurrentWeather(city.name)
var meteo = getCurrentWeather(city.name);
return (
<View style={{alignItems: "center"}}>
<View style={{alignItems: "center", backgroundColor: "darksalmon"}}>
<TopBar/>
<Text>{city.name}</Text>
<Text style={styles.name}>{city.name}</Text>
<View style={styles.place}>
<Text style={styles.petitText}>{city.longitude} - {city.latitude}</Text>
</View>
<TouchableHighlight>
<Image style={styles.image} source={ meteo?.weatherType=="Nuageux" ? require('../assets/Nuageux.png') : require('../assets/Soleil.png')}/>
</TouchableHighlight>
<Text style={styles.weatherType}>{meteo?.weatherType}</Text>
<View style={styles.supertruc}>
<Image style={styles.petitImage} source={require('../assets/temperature.png')}/>
<View style={styles.supertrucencore}>
<Text style={styles.temperature}>{meteo?.temperature}°C</Text>
<Text style={styles.petitTemp}>Ressenti {meteo?.temperatureFeelsLike}°C</Text>
</View>
</View>
<Text style={styles.title}>{meteo?.at}</Text>
<Text style={styles.title}>{meteo?.humidity}</Text>
<Text style={styles.title}>{meteo?.pressure}</Text>
<Text style={styles.title}>{meteo?.visibility}</Text>
<Text style={styles.title}>{meteo?.visibility}</Text>
<Text style={styles.title}>{meteo?.weatherDescription}</Text>
<Text style={styles.title}>{meteo?.windSpeed}</Text>
</View>
)
}
}
const styles = StyleSheet.create({
name: {
marginTop: 30,
fontSize: 35,
fontWeight: "bold"
},
place: {
marginBottom: 20,
},
petitText: {
fontSize: 15
},
image: {
height: 100,
width: 100
},
title: {
fontWeight: "bold",
fontSize: 18
},
temperature: {
marginTop: 10,
fontSize: 25,
fontWeight: "600"
},
petitTemp: {
fontSize: 16,
marginBottom: 35
},
weatherType: {
fontSize: 17,
marginBottom: 20
},
button: {
height: 30,
width: 30,
marginTop: 13,
alignSelf: "flex-end",
margin: 5
},
supertruc: {
flexDirection: "row"
},
supertrucencore: {
flexDirection: "column"
},
petitImage: {
height: 40,
width: 40,
marginRight: 7,
marginTop: 15
}
});
Loading…
Cancel
Save