Skip to content

Commit 51baae3

Browse files
authored
Merge branch 'main' into fix/direct-musd-vault-7702-mobile
2 parents bdb7e65 + d5edbfb commit 51baae3

27 files changed

Lines changed: 1458 additions & 404 deletions

File tree

app/components/Nav/App/App.test.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,10 +1008,6 @@ describe('App', () => {
10081008
expect(Routes.MODAL.NFT_AUTO_DETECTION_MODAL).toBeDefined();
10091009
});
10101010

1011-
it('has whats new route defined', () => {
1012-
expect(Routes.MODAL.WHATS_NEW).toBeDefined();
1013-
});
1014-
10151011
it('has multi rpc migration modal route defined', () => {
10161012
expect(Routes.MODAL.MULTI_RPC_MIGRATION_MODAL).toBeDefined();
10171013
});
@@ -1318,10 +1314,6 @@ describe('App', () => {
13181314
it('has tooltip modal route defined', () => {
13191315
expect(Routes.SHEET.TOOLTIP_MODAL).toBeDefined();
13201316
});
1321-
1322-
it('has whats new route defined', () => {
1323-
expect(Routes.MODAL.WHATS_NEW).toBeDefined();
1324-
});
13251317
});
13261318

13271319
describe('Multichain introduction screens', () => {
@@ -2245,14 +2237,6 @@ describe('App', () => {
22452237
});
22462238
});
22472239

2248-
it('renders WhatsNew modal', async () => {
2249-
const { toJSON } = renderAppWithModal(Routes.MODAL.WHATS_NEW);
2250-
2251-
await waitFor(() => {
2252-
expect(toJSON()).toBeTruthy();
2253-
});
2254-
});
2255-
22562240
it('renders TooltipModal sheet', async () => {
22572241
const { toJSON } = renderAppWithModal(Routes.SHEET.TOOLTIP_MODAL);
22582242

app/components/Nav/App/App.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ import OnboardingSecuritySettings from '../../Views/OnboardingSuccess/Onboarding
104104
import BasicFunctionalityModal from '../../UI/BasicFunctionality/BasicFunctionalityModal/BasicFunctionalityModal';
105105
import PermittedNetworksInfoSheet from '../../Views/AccountPermissions/PermittedNetworksInfoSheet/PermittedNetworksInfoSheet';
106106
import NFTAutoDetectionModal from '../../../../app/components/Views/NFTAutoDetectionModal/NFTAutoDetectionModal';
107-
import WhatsNewModal from '../../UI/WhatsNewModal';
108107
import NftOptions from '../../../components/Views/NftOptions';
109108
import ShowTokenIdSheet from '../../../components/Views/ShowTokenIdSheet';
110109
import OriginSpamModal from '../../Views/OriginSpamModal/OriginSpamModal';
@@ -634,10 +633,6 @@ const RootModalFlow = (props: RootModalFlowProps) => (
634633
name={Routes.MODAL.NFT_AUTO_DETECTION_MODAL}
635634
component={NFTAutoDetectionModal}
636635
/>
637-
<NativeStack.Screen
638-
name={Routes.MODAL.WHATS_NEW}
639-
component={WhatsNewModal}
640-
/>
641636
{isNetworkUiRedesignEnabled() ? (
642637
<NativeStack.Screen
643638
name={Routes.MODAL.MULTI_RPC_MIGRATION_MODAL}

app/components/UI/Assets/PriceAlerts/Views/CreatePriceAlertView/CreatePriceAlertView.test.tsx

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,41 +97,51 @@ describe('CreatePriceAlertView', () => {
9797
).toBeOnTheScreen();
9898
});
9999

100-
it('shows percentage pickers and hides Set button before any input', () => {
101-
const { getByTestId, queryByTestId } = renderWithToast();
100+
it('shows percentage pickers and Set button before any input', () => {
101+
const { getByTestId } = renderWithToast();
102102

103103
expect(
104104
getByTestId(`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-5`),
105105
).toBeOnTheScreen();
106-
expect(queryByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON)).toBeNull();
106+
expect(
107+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
108+
).toBeOnTheScreen();
109+
expect(
110+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
111+
).toBeDisabled();
107112
});
108113

109-
it('hides percentage pickers and shows Set button once user types a digit', () => {
110-
const { getByTestId, queryByTestId } = renderWithToast();
114+
it('keeps percentage pickers visible and enables Set button once user types a digit', () => {
115+
const { getByTestId } = renderWithToast();
111116

112117
fireEvent.press(getByTestId('keypad-key-1'));
113118

114119
expect(
115-
queryByTestId(`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-5`),
116-
).toBeNull();
120+
getByTestId(`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-5`),
121+
).toBeOnTheScreen();
117122
expect(
118123
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
119124
).toBeOnTheScreen();
125+
expect(
126+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
127+
).not.toBeDisabled();
120128
});
121129

122-
it('keeps percentage pickers and hides Set button for zero-valued keypad input like "0."', () => {
123-
const { getByTestId, getByText, queryByTestId } = renderWithToast();
130+
it('keeps percentage pickers visible and Set button disabled for zero-valued keypad input like "0."', () => {
131+
const { getByTestId, getByText } = renderWithToast();
124132

125133
fireEvent.press(getByTestId('keypad-key-dot'));
126134

127135
expect(getByText('$0.')).toBeOnTheScreen();
128136
expect(
129137
getByTestId(`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-5`),
130138
).toBeOnTheScreen();
131-
expect(queryByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON)).toBeNull();
139+
expect(
140+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
141+
).toBeDisabled();
132142
});
133143

134-
it('shows Set button after a quick-percentage pill is pressed', () => {
144+
it('enables Set button after a quick-percentage pill is pressed', () => {
135145
const { getByTestId } = renderWithToast();
136146

137147
fireEvent.press(
@@ -141,6 +151,9 @@ describe('CreatePriceAlertView', () => {
141151
expect(
142152
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
143153
).toBeOnTheScreen();
154+
expect(
155+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
156+
).not.toBeDisabled();
144157
});
145158

146159
it('shows under development message when price change is selected', () => {
@@ -190,7 +203,9 @@ describe('CreatePriceAlertView', () => {
190203
getByTestId(`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-5`),
191204
);
192205

193-
expect(getByText('5%')).toBeOnTheScreen();
206+
expect(getByTestId(CreatePriceAlertTestIds.PERCENT_DIFF)).toHaveTextContent(
207+
/5%/,
208+
);
194209
expect(getByText(/above current ETH price/)).toBeOnTheScreen();
195210
});
196211

@@ -413,7 +428,7 @@ describe('CreatePriceAlertView — tiny price token', () => {
413428
expect(getByText('$0.000000000000011')).toBeOnTheScreen();
414429
});
415430

416-
it('quick-percentage pill produces a non-zero value and reveals the Set button', () => {
431+
it('quick-percentage pill produces a non-zero value and enables the Set button', () => {
417432
const { getByTestId } = render(<CreatePriceAlertView />);
418433

419434
fireEvent.press(
@@ -423,6 +438,9 @@ describe('CreatePriceAlertView — tiny price token', () => {
423438
expect(
424439
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
425440
).toBeOnTheScreen();
441+
expect(
442+
getByTestId(CreatePriceAlertTestIds.SET_ALERT_BUTTON),
443+
).not.toBeDisabled();
426444
});
427445

428446
it('allows manual keypad entry beyond two decimal places for sub-cent tokens', () => {

app/components/UI/Assets/PriceAlerts/Views/CreatePriceAlertView/CreatePriceAlertView.tsx

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -427,47 +427,23 @@ const CreatePriceAlertView: React.FC = () => {
427427
/>
428428
</Box>
429429

430-
{/* Quick-percentage pickers → hidden once a positive target is set */}
431-
{hasValidTarget ? (
432-
<Button
433-
variant={ButtonVariant.Primary}
434-
onPress={handleSaveAlert}
435-
isLoading={isSubmitting}
436-
isDisabled={
437-
isSubmitting ||
438-
!hasValidTarget ||
439-
isDuplicateThreshold ||
440-
isUnchanged
441-
}
442-
testID={CreatePriceAlertTestIds.SET_ALERT_BUTTON}
443-
twClassName="mb-3 w-full"
444-
>
445-
{isDuplicateThreshold
446-
? strings('price_alerts.duplicate_threshold')
447-
: strings(
448-
isEditing
449-
? 'price_alerts.update_price_alert'
450-
: 'price_alerts.set_price_alert',
451-
)}
452-
</Button>
453-
) : (
454-
<Box
455-
flexDirection={BoxFlexDirection.Row}
456-
twClassName="mb-3 gap-2"
457-
>
458-
{PRICE_ALERT_QUICK_PERCENTAGES.map((percentage) => (
459-
<Button
460-
key={percentage}
461-
variant={ButtonVariant.Secondary}
462-
onPress={() => handleQuickPercentagePress(percentage)}
463-
testID={`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-${percentage}`}
464-
twClassName="flex-1"
465-
>
466-
{strings('price_alerts.quick_percentage', { percentage })}
467-
</Button>
468-
))}
469-
</Box>
470-
)}
430+
{/* Quick-percentage pickers — always visible */}
431+
<Box
432+
flexDirection={BoxFlexDirection.Row}
433+
twClassName="mb-3 gap-2"
434+
>
435+
{PRICE_ALERT_QUICK_PERCENTAGES.map((percentage) => (
436+
<Button
437+
key={percentage}
438+
variant={ButtonVariant.Secondary}
439+
onPress={() => handleQuickPercentagePress(percentage)}
440+
testID={`${CreatePriceAlertTestIds.QUICK_PERCENTAGE_PREFIX}-${percentage}`}
441+
twClassName="flex-1"
442+
>
443+
{strings('price_alerts.quick_percentage', { percentage })}
444+
</Button>
445+
))}
446+
</Box>
471447

472448
{/* "price_alert" is intentionally not in the Keypad CURRENCIES map —
473449
unknown codes fall through to the decimals-aware branch in useCurrency,
@@ -478,6 +454,29 @@ const CreatePriceAlertView: React.FC = () => {
478454
currency="price_alert"
479455
decimals={keypadDecimals}
480456
/>
457+
458+
{/* Save button — always visible, sits below the keypad */}
459+
<Button
460+
variant={ButtonVariant.Primary}
461+
onPress={handleSaveAlert}
462+
isLoading={isSubmitting}
463+
isDisabled={
464+
isSubmitting ||
465+
!hasValidTarget ||
466+
isDuplicateThreshold ||
467+
isUnchanged
468+
}
469+
testID={CreatePriceAlertTestIds.SET_ALERT_BUTTON}
470+
twClassName="mt-3 w-full"
471+
>
472+
{isDuplicateThreshold
473+
? strings('price_alerts.duplicate_threshold')
474+
: strings(
475+
isEditing
476+
? 'price_alerts.update_price_alert'
477+
: 'price_alerts.set_price_alert',
478+
)}
479+
</Button>
481480
</View>
482481
</>
483482
) : (

app/components/UI/Assets/PriceAlerts/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface PriceAlert {
3434
createdAt: string;
3535
}
3636

37-
export const PRICE_ALERT_QUICK_PERCENTAGES = [5, 10, 20, 30] as const;
37+
export const PRICE_ALERT_QUICK_PERCENTAGES = [-10, -5, 5, 10] as const;
3838

3939
export const CURRENCY_SYMBOLS: Record<string, string> = {
4040
usd: '$',

0 commit comments

Comments
 (0)