Guest User

Untitled

a guest
Apr 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // @flow
  2. import React from "react";
  3. import { Platform, Text } from "react-native";
  4. import styled from "styled-components/native";
  5.  
  6. const instructions = Platform.select({
  7. ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
  8. android:
  9. "Double tap R on your keyboard to reload,\n" +
  10. "Shake or press menu button for dev menu"
  11. });
  12.  
  13. const Container = styled.View`
  14. flex: 1;
  15. justify-content: center;
  16. align-items: center;
  17. background-color: ${({ isNightTime }) =>
  18. isNightTime ? "#959595" : "#F5FCFF"};
  19. `;
  20.  
  21. const WelcomeText = styled.Text`
  22. font-size: 20px;
  23. text-align: center;
  24. margin: 10px;
  25. ${({ isNightTime }) => isNightTime && `color: white`};
  26. `;
  27.  
  28. const InstructionsText = styled(Text)`
  29. text-align: center;
  30. margin-bottom: 5px;
  31. color: ${"#333333"};
  32. `;
  33.  
  34. type Props = { isNightTime: boolean };
  35. export default (props: Props) => (
  36. <Container isNightTime={props.isNightTime}>
  37. <WelcomeText isNightTime={props.isNightTime}>
  38. Welcome to React Native!
  39. </WelcomeText>
  40. <InstructionsText>To get started, edit App.js</InstructionsText>
  41. <InstructionsText>{instructions}</InstructionsText>
  42. </Container>
  43. );
Add Comment
Please, Sign In to add comment