Skip to content
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

General cleanup on stylesheet #308

Merged
merged 5 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Text = ({
fontSize,
lineHeight: 20,
textAlign,
...fontFamily[family],
fontFamily: fontFamily[family],
...mergedStyles,
};

Expand Down
6 changes: 3 additions & 3 deletions src/page/HomePage/Report/ReportHistoryCompose.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {View, Image, TouchableOpacity} from 'react-native';
import styles from '../../../style/StyleSheet';
import styles, {colors} from '../../../style/StyleSheet';
import TextInputFocusable from '../../../components/TextInputFocusable';
import sendIcon from '../../../../assets/images/icon-send.png';

Expand Down Expand Up @@ -81,7 +81,7 @@ class ReportHistoryCompose extends React.Component {
multiline
textAlignVertical="top"
placeholder="Write something..."
placeholderTextColor="#7D8B8F"
placeholderTextColor={colors.textSupporting}
onChangeText={this.updateComment}
onKeyPress={this.triggerSubmitShortcut}
style={[styles.textInput, styles.textInputCompose, styles.flex4]}
Expand All @@ -90,7 +90,7 @@ class ReportHistoryCompose extends React.Component {
<TouchableOpacity
style={[styles.chatItemSubmitButton, styles.buttonSuccess]}
onPress={this.submitForm}
underlayColor="#fff"
underlayColor={colors.componentBG}
>
<Image
resizeMode="contain"
Expand Down
6 changes: 3 additions & 3 deletions src/page/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {withRouter} from '../lib/Router';
import {signIn} from '../lib/actions/Session';
import IONKEYS from '../IONKEYS';
import withIon from '../components/withIon';
import styles from '../style/StyleSheet';
import styles, {colors} from '../style/StyleSheet';
import logo from '../../assets/images/expensify-logo_reversed.png';

const propTypes = {
Expand Down Expand Up @@ -100,7 +100,7 @@ class App extends Component {
style={[styles.textInput, styles.textInputReversed]}
value={this.state.twoFactorAuthCode}
placeholder="Required when 2FA is enabled"
placeholderTextColor="#C6C9CA"
placeholderTextColor={colors.icon}
onChangeText={text => this.setState({twoFactorAuthCode: text})}
onSubmitEditing={this.submitForm}
/>
Expand All @@ -109,7 +109,7 @@ class App extends Component {
<TouchableOpacity
style={[styles.button, styles.buttonSuccess, styles.mb4]}
onPress={this.submitForm}
underlayColor="#fff"
underlayColor={colors.componentBG}
>
<Text style={[styles.buttonText, styles.buttonSuccessText]}>Log In</Text>
</TouchableOpacity>
Expand Down
44 changes: 24 additions & 20 deletions src/style/StyleSheet.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
// We place items a percentage to the safe area on the top or bottom of the screen
import fontFamily from './fontFamily';

const safeInsertPercentage = 0.7;

const colors = {
componentBG: '#FFFFFF',
background: '#FAFAFA',
blue: '#2EAAE2',
border: '#ECECEC',
icon: '#C6C9CA',
green: '#2ECB70',
heading: '#37444C',
icon: '#C6C9CA',
text: '#4A5960',
textReversed: '#FFFFFF',
textSupporting: '#7D8B8F',
blue: '#2EAAE2',
green: '#2ECB70',
red: '#E84A3B',
shadow: '#000000',
};

const styles = {
Expand Down Expand Up @@ -99,7 +103,7 @@ const styles = {
},

colorReversed: {
color: '#ffffff',
color: colors.textReversed,
},

button: {
Expand All @@ -122,7 +126,7 @@ const styles = {
},

buttonSuccessText: {
color: '#ffffff',
color: colors.textReversed,
},

// History Items
Expand All @@ -142,7 +146,7 @@ const styles = {
borderColor: colors.border,
borderWidth: 1,
color: colors.text,
fontFamily: 'GTAmericaExp-Regular',
fontFamily: fontFamily.GTA,
padding: 12,
textAlignVertical: 'center',
},
Expand All @@ -152,7 +156,7 @@ const styles = {
borderRadius: 8,
borderColor: colors.text,
borderWidth: 1,
color: '#ffffff',
color: colors.textReversed,
padding: 12,
},

Expand Down Expand Up @@ -251,16 +255,16 @@ const styles = {
},

sidebarFooterUsername: {
color: '#FFFFFF',
color: colors.textReversed,
fontSize: 15,
fontWeight: '700',
},

sidebarFooterLink: {
color: '#C6C9CA',
color: colors.icon,
fontSize: 11,
textDecorationLine: 'none',
fontFamily: 'GTAmericaExp-Regular',
fontFamily: fontFamily.GTA,
lineHeight: 20,
},

Expand All @@ -276,7 +280,7 @@ const styles = {
},

sidebarListHeader: {
color: '#FFFFFF',
color: colors.textReversed,
fontSize: 15,
fontWeight: '700',
paddingTop: 8,
Expand Down Expand Up @@ -307,7 +311,7 @@ const styles = {
},

sidebarLinkText: {
color: '#C6C9CA',
color: colors.icon,
fontSize: 13,
textDecorationLine: 'none',
overflow: 'hidden',
Expand All @@ -325,17 +329,17 @@ const styles = {
},
sidebarLinkTextUnread: {
fontWeight: '600',
color: '#ffffff',
color: colors.textReversed,
},
sidebarLinkActiveText: {
color: '#ffffff',
color: colors.textReversed,
fontSize: 13,
textDecorationLine: 'none',
overflow: 'hidden',
},

unreadBadge: {
backgroundColor: '#2ECB70',
backgroundColor: colors.green,
borderRadius: 15,
height: 10,
marginTop: 3,
Expand Down Expand Up @@ -467,7 +471,7 @@ const styles = {
chatItemMessage: {
color: colors.text,
fontSize: 15,
fontFamily: 'GTAmericaExp-Regular',
fontFamily: fontFamily.GTA,
lineHeight: 20,
marginTop: -2,
marginBottom: -2,
Expand All @@ -484,7 +488,7 @@ const styles = {
},

chatItemComposeBox: {
backgroundColor: '#FFFFFF',
backgroundColor: colors.componentBG,
borderWidth: 1,
borderColor: colors.border,
borderRadius: 8,
Expand Down Expand Up @@ -523,7 +527,7 @@ const styles = {
bottom: 0,
zIndex: 2,
width: 300,
shadowColor: '#000000',
shadowColor: colors.shadow,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is okay for now, but I wonder if we might just want this to be colors.black or something, and then at some point we might have a standard shadow which we could extend that would have the correct color/offset/opacity/radius values.

shadowOffset: {
width: 0,
height: 0,
Expand All @@ -542,7 +546,7 @@ const webViewStyles = {
tagStyles: {
em: {
fontStyle: 'italic',
fontFamily: 'System'
fontFamily: fontFamily.SYSTEM,
},

del: {
Expand All @@ -562,7 +566,7 @@ const webViewStyles = {
baseFontStyle: {
color: colors.text,
fontSize: 15,
fontFamily: 'GTAmericaExp-Regular'
fontFamily: fontFamily.GTA
}
};

Expand Down
5 changes: 2 additions & 3 deletions src/style/fontFamily/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fontFamily = {
GTA: {
fontFamily: 'GTAmericaExp-Regular',
},
GTA: 'GTAmericaExp-Regular',
SYSTEM: 'System',
};

export default fontFamily;