-
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
Merged
Merged
@kane/prince of hill #6575
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
63a3228
initial KoH card, refactored search bar
maxbbb 95a7203
fix points context useeffect usage
maxbbb 086c76e
last winner section, formatting, details
maxbbb e7b892d
rename search bar, cleanup
maxbbb 661344a
fix double separator when no remote cards
maxbbb b060f4c
symbol truncation
maxbbb 835d1b2
localizations
maxbbb 35283b2
gradient borders on last winner section pills
maxbbb e35764c
animated countdown text
maxbbb c9213df
integrate real backend query
maxbbb 734ede1
card design tweaks, code organization
maxbbb a33e92c
change to new query shape
maxbbb 3d7422e
android discover search alignment fixes
maxbbb 46b6b28
light mode fixes, countdown clock, loading skeleton
maxbbb d16e76b
updates to smooth pager
maxbbb 55af12b
explain sheet, disable fetching when not discover
maxbbb 308ca96
add feature flag
maxbbb 8924389
gradient text header, refactor gradient text comp, cleanup uses
maxbbb 99a5e80
step indicator component cleanup
maxbbb b11f637
shiny coin drop shadow
maxbbb 5fd9846
fix skia background alignment, finish integrating step graphics
maxbbb 60a8a9b
change enableSwipeToGoForward smooth pager api
maxbbb 5e06885
move sunrays component, cleanup, translations
maxbbb d07ace1
cleanup
maxbbb b2e347d
Merge branch 'develop' into @kane/prince-of-hill
maxbbb 36e4694
change separator color to match other black screens, add shadow to ex…
maxbbb dcba8ec
Merge branch 'develop' into @kane/prince-of-hill
maxbbb 55a61ee
fix info & star icon center, fix section header easing gradient
maxbbb 847b624
fix no favorite button spacing logic
maxbbb b555546
Update src/components/Discover/DiscoverHome.tsx
maxbbb 0af9ac4
add android explain sheet route, fix clipped gradient text properly f…
maxbbb 539a045
fix gradient text implementation, remove text shadow on explain sheet…
maxbbb 7dddc07
file name typo
maxbbb 5a40e5a
cleanup
maxbbb 427439a
use correct size type for increased line height
maxbbb daa5574
nits
maxbbb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,18 @@ | ||
| import React, { useCallback, useEffect, useMemo, useState } from 'react'; | ||
| import { InteractionManager, View } from 'react-native'; | ||
| import { Dimensions, InteractionManager, View } from 'react-native'; | ||
| 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 { useAccountSettings, useSearchCurrencyList, usePrevious, useHardwareBackOnFocus, useDimensions } 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 { ethereumUtils } from '@/utils'; | ||
| import { getPoapAndOpenSheetWithQRHash, getPoapAndOpenSheetWithSecretWord } from '@/utils/poaps'; | ||
| import { navigateToMintCollection } from '@/resources/reservoir/mints'; | ||
| import { TAB_BAR_HEIGHT } from '@/navigation/SwipeNavigator'; | ||
|
|
@@ -26,10 +24,7 @@ import { useBackendNetworksStore } from '@/state/backendNetworks/backendNetworks | |
| 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%', | ||
| }); | ||
| import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
|
||
| type EnsResult = { | ||
| address: string; | ||
|
|
@@ -52,6 +47,7 @@ export default function DiscoverSearch() { | |
| const { navigate } = useNavigation(); | ||
| const { accountAddress } = useAccountSettings(); | ||
| const { colors } = useTheme(); | ||
| const safeAreaInsets = useSafeAreaInsets(); | ||
|
|
||
| const [isFetchingEns, setIsFetchingEns] = useState(false); | ||
| const { cancelSearch, searchInputRef, sectionListRef } = useDiscoverScreenContext(); | ||
|
|
@@ -71,8 +67,8 @@ export default function DiscoverSearch() { | |
| const { swapCurrencyList, swapCurrencyListLoading } = useSearchCurrencyList(); | ||
|
|
||
| const profilesEnabled = useExperimentalFlag(PROFILES); | ||
| const marginBottom = TAB_BAR_HEIGHT + safeAreaInsetValues.bottom + 16; | ||
| const TOP_OFFSET = safeAreaInsetValues.top + navbarHeight; | ||
| const MARGIN_BOTTOM = TAB_BAR_HEIGHT; | ||
|
||
| const TOP_OFFSET = safeAreaInsets.top + navbarHeight; | ||
|
|
||
| const currencyList = useMemo(() => { | ||
| // order: | ||
|
|
@@ -263,24 +259,22 @@ export default function DiscoverSearch() { | |
| return ( | ||
| <View | ||
| key={currencyListDataKey} | ||
| style={{ height: deviceUtils.dimensions.height - TOP_OFFSET - marginBottom }} | ||
| style={{ height: deviceUtils.dimensions.height - TOP_OFFSET - MARGIN_BOTTOM }} | ||
| 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> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused