Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <View>
  2.         <Text>{weatherConditions[weather].color}</Text>
  3.     </View>
  4.  
  5. Weather.propTypes = {
  6.   temperature: PropTypes.number.isRequired,
  7.   weather: PropTypes.string
  8. };
  9.  
  10. const styles = StyleSheet.create({
  11.   weatherContainer: {
  12.     flex: 1
  13.   },
  14.   headerContainer: {
  15.     flex: 1,
  16.     flexDirection: 'row',
  17.     alignItems: 'center',
  18.     justifyContent: 'space-around'
  19.   },
  20.   tempText: {
  21.     fontSize: 72,
  22.     color: '#fff'
  23.   },
  24.   bodyContainer: {
  25.     flex: 2,
  26.     alignItems: 'flex-start',
  27.     justifyContent: 'flex-end',
  28.     paddingLeft: 25,
  29.     marginBottom: 40
  30.   },
  31.   title: {
  32.     fontSize: 60,
  33.     color: '#fff'
  34.   },
  35.   subtitle: {
  36.     fontSize: 24,
  37.     color: '#fff'
  38.   }
  39. });
  40. const weatherConditions = {
  41.     Rain: {
  42.       color: '#005BEA',
  43.       title: 'Raining',
  44.       subtitle: 'Get a cup of coffee',
  45.       icon: 'weather-rainy'
  46.     },
  47.     Clear: {
  48.       color: '#f7b733',
  49.       title: 'So Sunny',
  50.       subtitle: 'It is hurting my eyes',
  51.       icon: 'weather-sunny'
  52.     },
  53.     Thunderstorm: {
  54.       color: '#616161',
  55.       title: 'A Storm is coming',
  56.       subtitle: 'Because Gods are angry',
  57.       icon: 'weather-lightning'
  58.     },
  59.     Clouds: {
  60.       color: '#1F1C2C',
  61.       title: 'Clouds',
  62.       subtitle: 'Everywhere',
  63.       icon: 'weather-cloudy'
  64.     },
  65.  
  66.     Snow: {
  67.       color: '#00d2ff',
  68.       title: 'Snow',
  69.       subtitle: 'Get out and build a snowman for me',
  70.       icon: 'weather-snowy'
  71.     },
  72.     Drizzle: {
  73.       color: '#076585',
  74.       title: 'Drizzle',
  75.       subtitle: 'Partially raining...',
  76.       icon: 'weather-hail'
  77.     },
  78.     Haze: {
  79.       color: '#66A6FF',
  80.       title: 'Haze',
  81.       subtitle: 'Another name for Partial Raining',
  82.       icon: 'weather-hail'
  83.     },
  84.     Mist: {
  85.       color: '#3CD3AD',
  86.       title: 'Mist',
  87.       subtitle: "Don't roam in forests!",
  88.       icon: 'weather-fog'
  89.     }
  90.   };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement