Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit 7b32a8b

Browse files
committed
Remove dependency on expo
1 parent 36e531e commit 7b32a8b

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

src/Header.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import React from 'react';
2-
import { Animated, Dimensions, Platform, StyleSheet, View } from 'react-native';
2+
import { Animated, Dimensions, Platform, StatusBar, StyleSheet, View } from 'react-native';
33
import { withNavigation, HeaderBackButton } from 'react-navigation';
4-
import { Constants } from 'expo';
54

65
const APPBAR_HEIGHT = Platform.OS === 'ios' ? 50 : 56;
7-
const STATUSBAR_HEIGHT = Constants.statusBarHeight;
86
const TITLE_OFFSET = Platform.OS === 'ios' ? 70 : 56;
97

8+
// @todo: this is static and we don't know if it's visible or not on iOS.
9+
// need to use a more reliable and cross-platform API when one exists, like
10+
// LayoutContext.
11+
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 25 : StatusBar.currentHeight;
12+
1013
@withNavigation
1114
export default class Header extends React.PureComponent {
1215
static HEIGHT = APPBAR_HEIGHT + STATUSBAR_HEIGHT;

src/SearchBar.android.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React from 'react';
22
import { NativeModules, StyleSheet, TextInput, View } from 'react-native';
33
import { withNavigation } from 'react-navigation';
44
import Touchable from 'react-native-platform-touchable';
5-
6-
import { Icon } from 'expo';
5+
import Ionicons from 'react-native-vector-icons/Ionicons';
76

87
@withNavigation
98
export default class SearchBar extends React.PureComponent {
@@ -48,7 +47,7 @@ export default class SearchBar extends React.PureComponent {
4847
hitSlop={{top: 15, left: 10, right: 15, bottom: 15}}
4948
style={{ padding: 5 }}
5049
background={Touchable.Ripple(this.props.tintColor, true)}>
51-
<Icon.Ionicons
50+
<Ionicons
5251
name="md-close"
5352
size={25}
5453
color={this.props.tintColor}

src/SearchBar.ios.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {
1111
View,
1212
} from 'react-native';
1313
import { withNavigation } from 'react-navigation';
14-
15-
// TODO: remove dependency on Expo
16-
import { Icon } from 'expo';
14+
import Ionicons from 'react-native-vector-icons/Ionicons';
1715

1816
const Layout = {
1917
window: {
@@ -24,10 +22,11 @@ const SearchContainerHorizontalMargin = 10;
2422
const SearchContainerWidth =
2523
Layout.window.width - SearchContainerHorizontalMargin * 2;
2624

27-
const SearchIcon = () =>
25+
const SearchIcon = () => (
2826
<View style={styles.searchIconContainer}>
29-
<Icon.Ionicons name="ios-search" size={18} color="#ccc" />
30-
</View>;
27+
<Ionicons name="ios-search" size={18} color="#ccc" />
28+
</View>
29+
);
3130

3231
@withNavigation
3332
class PlaceholderButtonSearchBar extends React.PureComponent {
@@ -151,7 +150,7 @@ export default class SearchBar extends React.PureComponent {
151150
fontSize: 17,
152151
color: this.props.tintColor || '#007AFF',
153152
}}>
154-
Cancel
153+
{this.props.cancelButtonText || 'Cancel'}}
155154
</Text>
156155
</TouchableOpacity>
157156
</View>

src/SearchLayout.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import React from 'react';
22
import { Platform, StyleSheet, Text, View } from 'react-native';
3-
4-
// TODO: remove dependency on expo
5-
import { Constants } from 'expo';
6-
73
import SearchBar from './SearchBar';
84
import Header from './Header';
95

0 commit comments

Comments
 (0)