Skip to content

Commit

Permalink
feat(suite-native): remove tracker subtitle from closed switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
vytick committed May 23, 2024
1 parent 226d1dc commit 1cee154
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type DeviceItemContentProps = {
headerTextVariant?: TypographyStyle;
variant?: DeviceItemContentVariant;
isCompact?: boolean;
isSubHeaderForceHidden?: boolean;
};

const contentWrapperStyle = prepareNativeStyle<{ height: number }>((utils, { height }) => ({
Expand All @@ -50,6 +51,7 @@ export const DeviceItemContent = ({
headerTextVariant = 'body',
variant = 'simple',
isCompact = true,
isSubHeaderForceHidden = false,
}: DeviceItemContentProps) => {
const { translate } = useTranslate();
const { applyStyle } = useNativeStyles();
Expand Down Expand Up @@ -90,6 +92,7 @@ export const DeviceItemContent = ({
headerTextVariant={headerTextVariant}
header={deviceHeader}
isPortfolioTrackerDevice={isPortfolioTrackerDevice}
isSubHeaderForceHidden={isSubHeaderForceHidden}
/>
) : (
<WalletDetailDeviceItemContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type SimpleDeviceItemContentProps = {
headerTextVariant?: TypographyStyle;
header: ReactNode;
isPortfolioTrackerDevice: boolean;
isSubHeaderForceHidden: boolean;
};

const headerStyle = prepareNativeStyle(_ => ({
Expand All @@ -31,6 +32,7 @@ export const SimpleDeviceItemContent = ({
headerTextVariant,
header,
isPortfolioTrackerDevice,
isSubHeaderForceHidden,
}: SimpleDeviceItemContentProps) => {
const { applyStyle } = useNativeStyles();
const device = useSelector((state: DeviceRootState) => selectDeviceByState(state, deviceState));
Expand All @@ -43,7 +45,9 @@ export const SimpleDeviceItemContent = ({
}

const isPortfolioTrackerSubHeaderVisible =
isPortfolioTrackerDevice && !areAllDevicesDisconnectedOrAccountless;
isPortfolioTrackerDevice &&
!areAllDevicesDisconnectedOrAccountless &&
!isSubHeaderForceHidden;

const isConnectionStateVisible =
!isPortfolioTrackerDevice && !areAllDevicesDisconnectedOrAccountless;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const DeviceSwitch = () => {
deviceState={deviceState}
headerTextVariant="highlight"
variant={wallets.length > 1 ? 'walletDetail' : 'simple'}
isSubHeaderForceHidden={true}
/>
)}
<Icon name="chevronUpAndDown" color="iconDefault" />
Expand Down

0 comments on commit 1cee154

Please sign in to comment.