-
Notifications
You must be signed in to change notification settings - Fork 741
@kane/prince of hill #6575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@kane/prince of hill #6575
Changes from 29 commits
63a3228
95a7203
086c76e
e7b892d
661344a
b060f4c
835d1b2
35283b2
e35764c
c9213df
734ede1
a33e92c
3d7422e
46b6b28
d16e76b
55af12b
308ca96
8924389
99a5e80
b11f637
5fd9846
60a8a9b
5e06885
d07ace1
b2e347d
36e4694
dcba8ec
55a61ee
847b624
b555546
0af9ac4
539a045
7dddc07
5a40e5a
427439a
daa5574
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,13 @@ import { useDebounce } from 'use-debounce'; | |
| import * as lang from '@/languages'; | ||
| import deviceUtils from '@/utils/deviceUtils'; | ||
| import CurrencySelectionList from '@/components/CurrencySelectionList'; | ||
| import { Row } from '@/components/layout'; | ||
| import { useDiscoverScreenContext } from '@/components/Discover/DiscoverScreenContext'; | ||
| import { analytics } from '@/analytics'; | ||
| import { PROFILES, useExperimentalFlag } from '@/config'; | ||
| import { useAccountSettings, useSearchCurrencyList, usePrevious, useHardwareBackOnFocus } from '@/hooks'; | ||
| import { useNavigation } from '@/navigation'; | ||
| import Routes from '@/navigation/routesNames'; | ||
| import { fetchSuggestions } from '@/handlers/ens'; | ||
| import styled from '@/styled-thing'; | ||
| import { ethereumUtils, safeAreaInsetValues } from '@/utils'; | ||
| import { getPoapAndOpenSheetWithQRHash, getPoapAndOpenSheetWithSecretWord } from '@/utils/poaps'; | ||
| import { navigateToMintCollection } from '@/resources/reservoir/mints'; | ||
|
|
@@ -27,10 +25,6 @@ import { ChainId, Network } from '@/state/backendNetworks/types'; | |
| import { useTimeoutEffect } from '@/hooks/useTimeout'; | ||
| import { useDiscoverSearchQueryStore, useDiscoverSearchStore } from '@/__swaps__/screens/Swap/resources/search/searchV2'; | ||
|
|
||
| export const SearchContainer = styled(Row)({ | ||
| height: '100%', | ||
| }); | ||
|
|
||
| type EnsResult = { | ||
| address: string; | ||
| color: string; | ||
|
|
@@ -71,7 +65,8 @@ export default function DiscoverSearch() { | |
| const { swapCurrencyList, swapCurrencyListLoading } = useSearchCurrencyList(); | ||
|
|
||
| const profilesEnabled = useExperimentalFlag(PROFILES); | ||
| const marginBottom = TAB_BAR_HEIGHT + safeAreaInsetValues.bottom + 16; | ||
| const marginBottom = TAB_BAR_HEIGHT; | ||
| // safeAreaInsetValues.bottom + 16; | ||
|
||
| const TOP_OFFSET = safeAreaInsetValues.top + navbarHeight; | ||
|
|
||
| const currencyList = useMemo(() => { | ||
|
|
@@ -266,21 +261,19 @@ export default function DiscoverSearch() { | |
| style={{ height: deviceUtils.dimensions.height - TOP_OFFSET - marginBottom }} | ||
| testID="discover-search-list" | ||
| > | ||
| <SearchContainer> | ||
| <CurrencySelectionList | ||
| footerSpacer | ||
| fromDiscover | ||
| itemProps={itemProps} | ||
| keyboardDismissMode="on-drag" | ||
| // @ts-expect-error - FIXME: ens results / rainbow token results are not compatible with one another | ||
| listItems={currencyList} | ||
| loading={swapCurrencyListLoading || isFetchingEns} | ||
| query={searchQueryForSearch} | ||
| ref={sectionListRef} | ||
| showList | ||
| testID="discover-currency-select-list" | ||
| /> | ||
| </SearchContainer> | ||
| <CurrencySelectionList | ||
| footerSpacer | ||
| fromDiscover | ||
| itemProps={itemProps} | ||
| keyboardDismissMode="on-drag" | ||
| // @ts-expect-error - FIXME: ens results / rainbow token results are not compatible with one another | ||
| listItems={currencyList} | ||
| loading={swapCurrencyListLoading || isFetchingEns} | ||
| query={searchQueryForSearch} | ||
| ref={sectionListRef} | ||
| showList | ||
| testID="discover-currency-select-list" | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import React from 'react'; | ||
| import * as i18n from '@/languages'; | ||
| import { ButtonPressAnimation } from '@/components/animations'; | ||
| import { Box, Inline, Text } from '@/design-system'; | ||
| import DiscoverSearchInput from '@/components/Discover/DiscoverSearchInput'; | ||
| import { useDiscoverScreenContext } from '@/components/Discover/DiscoverScreenContext'; | ||
| import { deviceUtils } from '@/utils'; | ||
| import { useDelayedValueWithLayoutAnimation } from '@/hooks'; | ||
| import { useDiscoverSearchQueryStore } from '@/__swaps__/screens/Swap/resources/search/searchV2'; | ||
| import { NAVBAR_HORIZONTAL_INSET, navbarHeight } from '../navbar/Navbar'; | ||
| import { useTheme } from '@/theme'; | ||
|
|
||
| const placeholderText = deviceUtils.isNarrowPhone | ||
| ? i18n.t(i18n.l.discover.search.search_ethereum_short) | ||
| : i18n.t(i18n.l.discover.search.search_ethereum); | ||
|
|
||
| export function DiscoverSearchBar() { | ||
| const { colors } = useTheme(); | ||
| const { onTapSearch, cancelSearch } = useDiscoverScreenContext(); | ||
| const isSearching = useDiscoverSearchQueryStore(state => state.isSearching); | ||
| const delayedShowSearch = useDelayedValueWithLayoutAnimation(isSearching); | ||
|
|
||
| return ( | ||
| <Box height={navbarHeight} width="full" justifyContent="center" paddingHorizontal={{ custom: NAVBAR_HORIZONTAL_INSET }}> | ||
| <Inline alignVertical="center" space={'16px'}> | ||
| <Box justifyContent="center" style={{ flex: 1 }}> | ||
| <DiscoverSearchInput | ||
| clearTextOnFocus={false} | ||
| isDiscover | ||
| onFocus={onTapSearch} | ||
| placeholderText={placeholderText} | ||
| testID="discover-search" | ||
| /> | ||
| </Box> | ||
| <ButtonPressAnimation onPress={cancelSearch} testID="done-button"> | ||
| {delayedShowSearch && ( | ||
| <Text color={{ custom: colors.appleBlue }} size="17pt" weight="semibold"> | ||
| {i18n.t(i18n.l.button.done)} | ||
| </Text> | ||
| )} | ||
| </ButtonPressAnimation> | ||
| </Inline> | ||
| </Box> | ||
| ); | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.