Skip to content

Commit

Permalink
Improve styling of SearchRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Sep 10, 2024
1 parent 4e1b90c commit 0966fad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/components/Search/SearchRouter/SearchRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SearchRouter({type}: SearchRouterProps) {
toggleSearchRouter();
}}
>
<View style={[styles.flex1, styles.p5]}>
<View style={[styles.flex1, styles.p3]}>
<SearchRouterInput onSearch={onSearch} />
</View>
</Modal>
Expand Down
22 changes: 5 additions & 17 deletions src/components/Search/SearchRouter/SearchRouterInput.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, {useState} from 'react';
import {View} from 'react-native';
import TextInput from '@components/TextInput';
import useTheme from '@hooks/useTheme';
import BaseTextInput from '@components/TextInput/BaseTextInput';
import useThemeStyles from '@hooks/useThemeStyles';
import variables from '@styles/variables';
import CONST from '@src/CONST';

type SearchRouterInputProps = {
Expand All @@ -11,7 +11,6 @@ type SearchRouterInputProps = {

function SearchRouterInput({onSearch}: SearchRouterInputProps) {
const styles = useThemeStyles();
const theme = useTheme();

const [value, setValue] = useState('');

Expand All @@ -22,23 +21,12 @@ function SearchRouterInput({onSearch}: SearchRouterInputProps) {

return (
<View style={[]}>
<TextInput
<BaseTextInput
value={value}
onChangeText={onChangeText}
textInputContainerStyles={[{borderWidth: 0}]}
containerStyles={[]}
hideFocusedState
inputStyle={[
styles.w80,
styles.h13,
styles.ph4,
{
width: 400,
borderRadius: 8,
borderWidth: 4,
borderColor: theme.borderFocus,
},
]}
textInputContainerStyles={[{borderBottomWidth: 0, width: variables.popoverWidth}]}
inputStyle={[styles.searchInputStyle, styles.searchRouterInputStyle, styles.ph2]}
role={CONST.ROLE.PRESENTATION}
/>
</View>
Expand Down
26 changes: 7 additions & 19 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3587,31 +3587,19 @@ const styles = (theme: ThemeColors) =>
flex: 1,
},

searchPressable: {
height: variables.componentSizeNormal,
},

searchContainer: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
gap: 8,
paddingHorizontal: 24,
backgroundColor: theme.hoverComponentBG,
borderRadius: variables.componentBorderRadiusRounded,
justifyContent: 'center',
},

searchContainerHovered: {
backgroundColor: theme.border,
},

searchInputStyle: {
color: theme.textSupporting,
fontSize: 13,
lineHeight: 16,
},

searchRouterInputStyle: {
borderRadius: variables.componentBorderRadiusSmall,
borderWidth: 2,
borderColor: theme.borderFocus,
paddingHorizontal: 8,
},

searchTableHeaderActive: {
fontWeight: FontUtils.fontWeight.bold,
},
Expand Down

0 comments on commit 0966fad

Please sign in to comment.