Skip to content

Commit

Permalink
(BSR): remove Spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
nmajorfrances-pass committed Dec 27, 2024
1 parent e1aad51 commit b83bce2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { buildSearchVenuePosition } from 'libs/algolia/fetchAlgolia/fetchSearchR
import { getCurrentVenuesIndex } from 'libs/algolia/fetchAlgolia/helpers/getCurrentVenuesIndex'
import { analytics } from 'libs/analytics'
import { useLocation } from 'libs/location'
import { Spacer, getSpacing } from 'ui/theme'
import { getSpacing } from 'ui/theme'

type SearchSuggestionsParams = {
queryHistory: string
Expand Down Expand Up @@ -100,7 +100,6 @@ export const SearchSuggestions = ({
keyboardShouldPersistTaps="handled"
onScroll={Keyboard.dismiss}
scrollEventThrottle={16}>
<Spacer.Column numberOfSpaces={4} />
<SearchHistory
history={filteredHistory}
queryHistory={queryHistory}
Expand All @@ -117,12 +116,13 @@ export const SearchSuggestions = ({
/>
<AutocompleteVenue onItemPress={onVenuePress} />
</Index>
<Spacer.Column numberOfSpaces={3} />
</StyledScrollView>
)
}

const StyledScrollView = styled.ScrollView(({ theme }) => ({
paddingTop: getSpacing(4),
paddingBottom: getSpacing(3),
flex: 1,
paddingLeft: getSpacing(6),
paddingRight: getSpacing(6),
Expand Down
15 changes: 8 additions & 7 deletions src/shared/location/LocationSearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { View } from 'react-native'
import styled from 'styled-components/native'

import { LOCATION_PLACEHOLDER } from 'features/location/constants'
Expand All @@ -8,7 +9,7 @@ import { theme } from 'theme'
import { SearchInput } from 'ui/components/inputs/SearchInput'
import { useDebounceValue } from 'ui/hooks/useDebounceValue'
import { MagnifyingGlass } from 'ui/svg/icons/MagnifyingGlass'
import { Spacer } from 'ui/theme'
import { getSpacing } from 'ui/theme'

interface LocationSearchInputProps {
selectedPlace: SuggestedPlace | null
Expand Down Expand Up @@ -38,8 +39,7 @@ export const LocationSearchInput = ({
const shouldShowSuggestedPlaces = isQueryProvided && !selectedPlace

return (
<React.Fragment>
<Spacer.Column numberOfSpaces={4} />
<StyledView>
<SearchInput
autoFocus
LeftIcon={StyledMagnifyingGlass}
Expand All @@ -53,15 +53,16 @@ export const LocationSearchInput = ({
}
/>
{shouldShowSuggestedPlaces ? (
<React.Fragment>
<Spacer.Column numberOfSpaces={4} />
<StyledView>
<SuggestedPlaces query={debouncedPlaceQuery} setSelectedPlace={onSetSelectedPlace} />
</React.Fragment>
</StyledView>
) : null}
</React.Fragment>
</StyledView>
)
}

const StyledMagnifyingGlass = styled(MagnifyingGlass).attrs(({ theme }) => ({
size: theme.icons.sizes.small,
}))``

const StyledView = styled(View)({ paddingTop: getSpacing(4) })

0 comments on commit b83bce2

Please sign in to comment.