Skip to content

Commit

Permalink
Support the new dark/light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
kunall17 committed May 22, 2017
1 parent 1915c96 commit 6dba9a5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
16 changes: 5 additions & 11 deletions src/compose/ModeViews/PrivateBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ import {
import TagInput from 'react-native-tag-input';

import PeopleAutocomplete from '../../autocomplete/PeopleAutocomplete';

const styles = StyleSheet.create({
privateInput: {
flexDirection: 'row',
alignItems: 'center',
flex: 1
},
});
import styles from '../../styles/index';

export default class PrivateBox extends Component {
constructor() {
Expand Down Expand Up @@ -69,13 +62,14 @@ export default class PrivateBox extends Component {
}

render() {
const tagStyle = StyleSheet.flatten(styles.tagInput);
const { text } = this.state;
const inputProps = {
keyboardType: 'default',
placeholder: 'Enter names',
autoFocus: true,
onChangeText: this.handleChangeText,
value: text
value: text,
};

return (
Expand All @@ -88,8 +82,8 @@ export default class PrivateBox extends Component {
<TagInput
value={this.extractNames()}
onChange={this.onChangeTags}
tagColor="#ecf0f1"
tagTextColor="black"
tagColor={tagStyle.backgroundColor}
tagTextColor={tagStyle.color}
inputProps={inputProps}
numberOfLines={1}
/>
Expand Down
7 changes: 4 additions & 3 deletions src/compose/ModeViews/StreamBox.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { Component } from 'react';
import {
View, TextInput, Text, StyleSheet
View, Text, StyleSheet
} from 'react-native';
import StreamAutocomplete from '../../autocomplete/StreamAutocomplete';
import Input from '../../common/Input';

const styles = StyleSheet.create({
streamInputWrapper: {
Expand Down Expand Up @@ -47,7 +48,7 @@ export default class StreamBox extends Component {
<View style={styles.streamInputWrapper}>
{autoComplete &&
<StreamAutocomplete filter={operator} onAutocomplete={this.handleAutocompleteOperator} />}
<TextInput
<Input
style={styles.streamInput}
placeholder={'Stream'}
onChange={(event) => {
Expand All @@ -62,7 +63,7 @@ export default class StreamBox extends Component {
autoFocus
/>
<Text>{'>'}</Text>
<TextInput
<Input
ref={component => { this.operandInput = component; }}
style={styles.topicInput}
placeholder={'Topic'}
Expand Down
13 changes: 11 additions & 2 deletions src/styles/theme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Platform } from 'react-native';
import { BORDER_COLOR, BRAND_COLOR, STATUSBAR_HEIGHT, CONTROL_SIZE, NAVBAR_HEIGHT } from './';
import { BORDER_COLOR, BRAND_COLOR, STATUSBAR_HEIGHT, CONTROL_SIZE, NAVBAR_HEIGHT, HALF_COLOR } from './';

export default ({ color, backgroundColor, borderColor }) => ({
export default ({ color, backgroundColor, borderColor, tagColor }) => ({
color: {
color,
},
Expand Down Expand Up @@ -140,4 +140,13 @@ export default ({ color, backgroundColor, borderColor }) => ({
height: CONTROL_SIZE * 3 / 4,
borderColor: BORDER_COLOR,
},
tagInput: {
backgroundColor: tagColor,
color,
},
privateInput: {
flexDirection: 'row',
alignItems: 'center',
flex: 1
},
});
1 change: 1 addition & 0 deletions src/styles/themeDark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export default ({
color: '#d5d9dd',
backgroundColor: '#212D3B',
borderColor: 'rgba(127, 127, 127, 0.25)',
tagColor: '#2c3e50'
});
1 change: 1 addition & 0 deletions src/styles/themeLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export default ({
color: '#333',
backgroundColor: 'white',
borderColor: 'rgba(127, 127, 127, 0.25)',
tagColor: '#ecf0f1'
});

0 comments on commit 6dba9a5

Please sign in to comment.