Advertisement
Guest User

Code 1 : style et composants

a guest
Apr 6th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { StyleSheet, Text, View } from 'react-native';
  3.  
  4. export default function App() {
  5.   return (
  6.     <View style={styles.container}>
  7.       <View style={styles.header}>
  8.         <Text style={styles.headerText}>Mon journal de bord</Text>
  9.       </View>
  10.  
  11.       <View style={styles.containerPadding}>
  12.         <Text>Lorem ipsum !</Text>
  13.  
  14.         <View>
  15.           <Text>Bienvenue dans mon journal de bord </Text>
  16.         </View>
  17.  
  18.         <Text>
  19.           Lorem ipsum dolor
  20.         </Text>
  21.         <Text>
  22.           Lorem ipsum dolor
  23.         </Text>
  24.       </View>
  25.     </View>
  26.   );
  27. }
  28.  
  29. const styles = StyleSheet.create({
  30.   container: {
  31.     paddingTop: 30,
  32.     flex: 1,
  33.     backgroundColor: '#fff',
  34.   },
  35.   containerPadding : {
  36.     paddingHorizontal: 30,
  37.     paddingTop: 10,
  38.   },
  39.   header : {
  40.     // Layout
  41.     width: '100%',
  42.     height: 55,
  43.     alignItems: "center",
  44.     justifyContent: "center",
  45.     // Style
  46.     borderBottomColor: 'lightgrey',
  47.     borderBottomWidth: 2,
  48.   },
  49.   headerText: {
  50.     fontSize: 18,
  51.     fontWeight: 'bold'
  52.   }
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement