Skip to content
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

fix(suite-native): always show portfolio graph during discovery #15461

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(suite-native): always show portfolio graph during discovery
vytick committed Nov 19, 2024
commit d5fe2f42199ade6a3583e1e005872680471a38dc
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ import { useIsDiscoveryDurationTooLong } from '@suite-native/discovery';
import { CryptoIcon } from '@suite-native/icons';
import { Translation } from '@suite-native/intl';
import { prepareNativeStyle, useNativeStyles } from '@trezor/styles';
import { selectHasDeviceDiscovery } from '@suite-common/wallet-core';

import { PortfolioHeader } from './PortfolioHeader';
import { referencePointAtom, selectedPointAtom } from '../portfolioGraphAtoms';
@@ -58,6 +59,7 @@ const IgnoredNetworksBanner = () => {
export const PortfolioGraph = forwardRef<PortfolioGraphRef>((_props, ref) => {
const fiatCurrencyCode = useSelector(selectFiatCurrencyCode);
const hasDeviceHistoryEnabledAccounts = useSelector(selectHasDeviceHistoryEnabledAccounts);
const hasDeviceDiscovery = useSelector(selectHasDeviceDiscovery);
const loadingTakesLongerThanExpected = useIsDiscoveryDurationTooLong();

const {
@@ -95,11 +97,13 @@ export const PortfolioGraph = forwardRef<PortfolioGraphRef>((_props, ref) => {
[refetch],
);

const showGraph = hasDeviceHistoryEnabledAccounts || hasDeviceDiscovery;

return (
<VStack spacing="sp24" testID="@home/portfolio/graph">
{isAnyMainnetAccountPresent ? <PortfolioHeader /> : null}

{hasDeviceHistoryEnabledAccounts && (
{showGraph && (
<Graph
points={graphPoints}
loading={isLoading}
@@ -111,7 +115,7 @@ export const PortfolioGraph = forwardRef<PortfolioGraphRef>((_props, ref) => {
/>
)}
<IgnoredNetworksBanner />
{hasDeviceHistoryEnabledAccounts && (
{showGraph && (
<TimeSwitch selectedTimeFrame={timeframe} onSelectTimeFrame={onSelectTimeFrame} />
)}
</VStack>

Unchanged files with check annotations Beta

import { useStakeCompose } from './form/useStakeCompose';
import { useFormDraft } from './useFormDraft';
import { useFees } from './form/useFees';

Check warning on line 40 in packages/suite/src/hooks/wallet/useUnstakeEthForm.ts

GitHub Actions / Linting and formatting

There should be at least one empty line between import groups
import { BigNumber } from '@trezor/utils';

Check warning on line 41 in packages/suite/src/hooks/wallet/useUnstakeEthForm.ts

GitHub Actions / Linting and formatting

`@trezor/utils` import should occur before import of `src/hooks/suite`
type UnstakeOptions = 'all' | 'rewards' | 'other';
import { A } from '@mobily/ts-belt';

Check warning on line 1 in suite-native/graph/src/selectors.ts

GitHub Actions / Linting and formatting

There should be at least one empty line between import groups
import { AccountItem } from '@suite-common/graph';
import { isIgnoredBalanceHistoryCoin } from '@suite-common/graph/src/constants';
import {