Skip to content

Commit d5cf9e4

Browse files
fix(ui-rewards): polish icon spacing and related test
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e25bbec commit d5cf9e4

2 files changed

Lines changed: 13 additions & 22 deletions

File tree

app/components/UI/Rewards/hooks/useRewardsToast.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ describe('useRewardsToast', () => {
414414
{ label: 'Winner title', isBold: true },
415415
]);
416416
expect(config.startAccessory).toBeDefined();
417-
const { getByTestId } = render(config.startAccessory as ReactElement);
418-
expect(getByTestId('rewards-nudge-start-accessory-box')).toBeDefined();
419417
config.linkButtonOptions?.onPress?.();
420418
config.closeButtonOptions?.onPress?.();
421419
expect(onCta).toHaveBeenCalledTimes(1);

app/components/UI/Rewards/hooks/useRewardsToast.tsx

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useCallback, useContext, useMemo } from 'react';
22
import { ActivityIndicator } from 'react-native';
3-
import { Box } from '@metamask/design-system-react-native';
43
import { ToastContext } from '../../../../component-library/components/Toast';
54
import {
65
ButtonIconVariant,
@@ -131,9 +130,7 @@ const useRewardsToast = (): {
131130
hasNoTimeout: true,
132131
hapticsType: NotificationMoment.Warning,
133132
startAccessory: (
134-
<Box twClassName="p-1 mr-2">
135-
<ActivityIndicator size="small" color={theme.colors.icon.default} />
136-
</Box>
133+
<ActivityIndicator size="small" color={theme.colors.icon.default} />
137134
),
138135
labelOptions: getRewardsToastLabels(title),
139136
descriptionOptions: getRewardsToastDescriptionLabels(subtitle),
@@ -189,14 +186,12 @@ const useRewardsToast = (): {
189186
hasNoTimeout: true,
190187
hapticsType: NotificationMoment.Warning,
191188
startAccessory: (
192-
<Box twClassName="p-1 mr-2">
193-
<RewardsNotificationIcon
194-
name="notification"
195-
width={24}
196-
height={24}
197-
color={theme.colors.warning.default}
198-
/>
199-
</Box>
189+
<RewardsNotificationIcon
190+
name="notification"
191+
width={24}
192+
height={24}
193+
color={theme.colors.warning.default}
194+
/>
200195
),
201196
labelOptions: getRewardsToastLabels(
202197
strings('rewards.notifications_nudge.title'),
@@ -225,14 +220,12 @@ const useRewardsToast = (): {
225220
hasNoTimeout: true,
226221
hapticsType: NotificationMoment.Success,
227222
startAccessory: (
228-
<Box twClassName="p-1 mr-2">
229-
<RewardsTrophyIcon
230-
name="trophy"
231-
width={24}
232-
height={24}
233-
color={theme.colors.success.default}
234-
/>
235-
</Box>
223+
<RewardsTrophyIcon
224+
name="trophy"
225+
width={24}
226+
height={24}
227+
color={theme.colors.success.default}
228+
/>
236229
),
237230
labelOptions: getRewardsToastLabels(title),
238231
descriptionOptions: { description },

0 commit comments

Comments
 (0)