Skip to content

Commit 5daf97a

Browse files
committed
Android bugfixes:
- fixed text spacing in <Header> - disabled keyboard spacer for android
1 parent 464cec6 commit 5daf97a

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/components/Header.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
import {
22
StyleSheet,
33
Text,
4+
View,
45
} from 'react-native';
56
import React, { PropTypes } from 'react';
67
import clrs from '../utils/clrs';
78

89
const Header = ({ style, children }) => {
910
return (
10-
<Text style={[ styles.header, style ]}>
11-
{ children }
12-
</Text>
11+
<View style={ styles.container }>
12+
<Text style={[ styles.text, style ]}>
13+
{ children }
14+
</Text>
15+
</View>
1316
);
1417
};
1518

1619
export default Header;
1720

1821
const styles = StyleSheet.create({
19-
header: {
20-
fontWeight: '600',
21-
fontSize: 12,
22+
container: {
2223
paddingVertical: 4,
2324
paddingHorizontal: 16,
24-
justifyContent: 'center',
25-
alignItems: 'center',
2625
backgroundColor: clrs.lightGray,
26+
},
27+
text: {
28+
fontWeight: '600',
29+
fontSize: 12,
2730
color: clrs.white,
2831
borderColor: clrs.lightGray,
2932
},

src/containers/Pokedex.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
StyleSheet,
33
View,
44
ListView,
5+
Platform,
56
} from 'react-native';
67
import Immutable, { List } from 'immutable';
78
import React, { Component, PropTypes } from 'react';
@@ -14,6 +15,8 @@ import clrs from '../utils/clrs';
1415
import * as actions from '../actions';
1516
import { filteredPokemon } from '../selectors';
1617

18+
const Spacer = Platform.OS === 'ios' ? <KeyboardSpacer /> : null;
19+
1720

1821
class Pokedex extends Component {
1922
constructor(props) {
@@ -47,7 +50,7 @@ class Pokedex extends Component {
4750

4851
<SearchBar onChange={ filter } value={ query } />
4952

50-
<KeyboardSpacer />
53+
{ Spacer }
5154

5255
</View>
5356
</Loader>

0 commit comments

Comments
 (0)