File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed
modules/navigation-buttons Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ export {CloseScreenButton} from './close-screen'
33export { OpenSettingsButton } from './open-settings'
44export { FavoriteButton } from './favorite'
55export { DebugNoticeButton } from './debug'
6+ export { SearchButton } from './search'
Original file line number Diff line number Diff line change 1+ import * as React from 'react'
2+ import { Platform , StyleSheet , Text } from 'react-native'
3+ import Icon from 'react-native-vector-icons/Ionicons'
4+ import { Touchable } from '@frogpond/touchable'
5+ import { useTheme } from '@frogpond/app-theme'
6+ import { commonStyles , rightButtonStyles as styles } from './styles'
7+
8+ type Props = {
9+ onPress : ( ) => void
10+ title ?: string
11+ }
12+
13+ export function SearchButton ( props : Props ) : JSX . Element {
14+ let { colors} = useTheme ( )
15+
16+ return (
17+ < Touchable highlight = { false } onPress = { props . onPress } style = { styles . button } >
18+ { props . title ? (
19+ < Text
20+ style = { [
21+ commonStyles . text ,
22+ searchStyles . text ,
23+ { color : colors . primary } ,
24+ ] }
25+ >
26+ { props . title }
27+ </ Text >
28+ ) : (
29+ < Icon
30+ name = {
31+ Platform . OS === 'ios' ? 'ios-search-outline' : 'md-search-outline'
32+ }
33+ style = { styles . icon }
34+ />
35+ ) }
36+ </ Touchable >
37+ )
38+ }
39+
40+ const searchStyles = StyleSheet . create ( {
41+ text : {
42+ ...Platform . select ( {
43+ ios : {
44+ fontWeight : '600' ,
45+ } ,
46+ android : {
47+ fontWeight : '400' ,
48+ } ,
49+ } ) ,
50+ } ,
51+ } )
You can’t perform that action at this time.
0 commit comments