-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Polish new app screen component styling #24783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a0291a4
d52dbe0
fbf4bf5
9b47135
594b299
6060f26
9a4bb86
abecbfa
4f29e9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,39 +11,38 @@ | |
| 'use strict'; | ||
|
|
||
| import React from 'react'; | ||
| import {View, Text, StyleSheet, ImageBackground} from 'react-native'; | ||
| import {Text, StyleSheet, ImageBackground} from 'react-native'; | ||
| import Colors from './Colors'; | ||
|
|
||
| const Header = () => ( | ||
| <View style={styles.container}> | ||
| <ImageBackground | ||
| accessibilityRole={'image'} | ||
| source={require('./logo.png')} | ||
| style={styles.backgroundLogo} | ||
| /> | ||
|
|
||
| <ImageBackground | ||
| accessibilityRole={'image'} | ||
| source={require('./logo.png')} | ||
| style={styles.background} | ||
| imageStyle={styles.logo}> | ||
| <Text style={styles.text}>Welcome to React Native</Text> | ||
| </View> | ||
| </ImageBackground> | ||
| ); | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| paddingTop: 100, | ||
| background: { | ||
| paddingBottom: 40, | ||
| paddingTop: 96, | ||
| paddingHorizontal: 32, | ||
| backgroundColor: Colors.lighter, | ||
| }, | ||
| backgroundLogo: { | ||
| position: 'absolute', | ||
| top: -20, | ||
| left: -200, | ||
| logo: { | ||
| opacity: 0.2, | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| height: 540, | ||
| width: 540, | ||
| overflow: 'visible', | ||
| resizeMode: 'cover', | ||
| /* | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had a rough time trying to make the full React logo be nice and offset like in the designs. Another thought I had here is to use a 9-patch-like rectangular image for the background, where the React logo is already cropped, and then fix it to the bottom left corner of this component, to ensure a consistent background image across platforms. |
||
| * These negative margins allow the image to be offset similarly across screen sizes and component sizes. | ||
| * | ||
| * The source logo.png image is 512x512px, so as such, these margins attempt to be relative to the | ||
| * source image's size. | ||
| */ | ||
| marginLeft: -128, | ||
| marginBottom: -192, | ||
| }, | ||
| text: { | ||
| fontSize: 40, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm landing it as is but here is a thought: what if this said "Welcome to React" instead? Do you dare to make that change in a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're a bold one, @cpojer: #24785