Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions app/components/Nav/Main/MainNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,9 @@ import {
PerpsScreenStack,
PerpsModalStack,
PerpsTutorialCarousel,
selectPerpsEnabledFlag,
} from '../../UI/Perps';
import {
PredictScreenStack,
PredictModalStack,
selectPredictEnabledFlag,
} from '../../UI/Predict';
import { PredictScreenStack, PredictModalStack } from '../../UI/Predict';
import { useFeatureFlag, FeatureFlagNames } from '../../hooks/useFeatureFlag';
import { selectAssetsTrendingTokensEnabled } from '../../../selectors/featureFlagController/assetsTrendingTokens';
import PerpsPositionTransactionView from '../../UI/Perps/Views/PerpsTransactionsView/PerpsPositionTransactionView';
import PerpsOrderTransactionView from '../../UI/Perps/Views/PerpsTransactionsView/PerpsOrderTransactionView';
Expand Down Expand Up @@ -921,11 +917,15 @@ const SampleFeatureFlow = () => (

const MainNavigator = () => {
// Get feature flag state for conditional Perps screen registration
const perpsEnabledFlag = useSelector(selectPerpsEnabledFlag);
const perpsEnabledFlag = useFeatureFlag(
FeatureFlagNames.perpsPerpTradingEnabled,
);
const isEvmSelected = useSelector(selectIsEvmNetworkSelected);
const isPerpsEnabled = useMemo(() => perpsEnabledFlag, [perpsEnabledFlag]);
// Get feature flag state for conditional Predict screen registration
const predictEnabledFlag = useSelector(selectPredictEnabledFlag);
const predictEnabledFlag = useFeatureFlag(
FeatureFlagNames.predictTradingEnabled,
);
const isPredictEnabled = useMemo(
() => predictEnabledFlag,
[predictEnabledFlag],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {
StyleSheet,
TextInputProps,
} from 'react-native';
import { Box, Text, TextVariant } from '@metamask/design-system-react-native';
import {
Box,
FontWeight,
Text,
TextVariant,
} from '@metamask/design-system-react-native';

import Icon, {
IconName,
Expand Down Expand Up @@ -608,14 +613,18 @@ const CardAuthentication = () => {
width={ButtonWidthTypes.Full}
disabled={isLoginDisabled || loading}
/>
<Button
variant={ButtonVariants.Secondary}
label={strings('card.card_authentication.signup_button')}
size={ButtonSize.Lg}
testID={CardAuthenticationSelectors.SIGNUP_BUTTON}
<TouchableOpacity
onPress={() => navigation.navigate(Routes.CARD.ONBOARDING.ROOT)}
width={ButtonWidthTypes.Full}
/>
>
<Text
testID={CardAuthenticationSelectors.SIGNUP_BUTTON}
variant={TextVariant.BodyMd}
fontWeight={FontWeight.Medium}
twClassName="text-default text-center p-4"
>
{strings('card.card_authentication.signup_button')}
</Text>
</TouchableOpacity>
</Box>
</Box>
</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,40 +838,29 @@ exports[`CardAuthentication Component Login Step - Component Rendering matches l
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "#3c4d9d0f",
"borderColor": "transparent",
"borderRadius": 12,
"borderWidth": 1,
"flexDirection": "row",
"height": 48,
"justifyContent": "center",
"overflow": "hidden",
"paddingHorizontal": 16,
}
}
testID="signup-button"
>
<Text
accessibilityRole="text"
style={
{
"color": "#121314",
"fontFamily": "Geist Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
[
{
"color": "#121314",
"fontFamily": "Geist Medium",
"fontSize": 16,
"fontWeight": 400,
"letterSpacing": 0,
"lineHeight": 24,
"paddingBottom": 16,
"paddingLeft": 16,
"paddingRight": 16,
"paddingTop": 16,
"textAlign": "center",
},
undefined,
]
}
testID="signup-button"
>
card.card_authentication.signup_button
</Text>
Expand Down
24 changes: 24 additions & 0 deletions app/components/UI/Card/Views/CardHome/CardHome.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,30 @@ describe('CardHome Component', () => {
).not.toBeOnTheScreen();
});

it('passes formatted balance to CardAssetItem', () => {
// Given: asset balances with formatted balance
mockUseAssetBalances.mockReturnValue(
createMockAssetBalancesMap({
balanceFiat: '$1,000.00',
asset: {
symbol: 'USDC',
image: 'usdc-image-url',
},
balanceFormatted: '1000.000000 USDC',
rawTokenBalance: 1000,
rawFiatNumber: 1000,
}),
);

// When: component renders
render();

// Then: CardAssetItem should be rendered with formatted balance
expect(
screen.queryByTestId(CardHomeSelectors.CARD_ASSET_ITEM_SKELETON),
).not.toBeOnTheScreen();
});

it('displays manage card section', () => {
// Given: default state
// When: component renders
Expand Down
6 changes: 5 additions & 1 deletion app/components/UI/Card/Views/CardHome/CardHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@ const CardHome = () => {
testID={CardHomeSelectors.CARD_ASSET_ITEM_SKELETON}
/>
) : (
<CardAssetItem asset={asset} privacyMode={privacyMode} />
<CardAssetItem
asset={asset}
privacyMode={privacyMode}
balanceFormatted={balanceFormatted}
/>
)}
</View>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const SpendingLimit = ({
// If not loading or we're explicitly allowing navigation, allow it
return;
}
Logger.log('Blocking back navigation while loading');

// Prevent default navigation behavior
e.preventDefault();
Expand Down
Loading
Loading