Skip to content

Commit 1a22eb4

Browse files
authored
fix(TMCU-513): update View More card styling and Perps routing (#27078)
## **Description** Updates the shared "View more" card in the homepage carousels to match the updated design, and changes the Perps "View more" entrypoint to route to the market list page instead of the main Perps home. Changes: - Added `rounded-xl bg-background-muted` background to the ViewMoreCard outer Box - Removed the circular bubble wrapper around the ArrowRight icon - Made Predictions ViewMoreCard use `flex-1` and default `BodyMd` text size to match Perps - Split Perps navigation: section title still goes to Perps home, View more card now goes to the market list page ## **Changelog** CHANGELOG entry: Updated View more card styling with background color and updated Perps View more to navigate to market list ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-513 ## **Manual testing steps** ```gherkin Feature: View more card styling and routing Scenario: View more cards display with background Given user is on the homepage And Perps or Predictions sections show a carousel with a View more card When the user views the View more card Then it has a rounded grey background (bg-background-muted) And the arrow icon has no circular bubble around it Scenario: Perps View more navigates to market list Given user is on the homepage with Perps section visible When user taps the View more card in the Perps carousel Then the app navigates to the Perps market list page Scenario: Perps section title navigates to Perps home Given user is on the homepage with Perps section visible When user taps the Perpetuals section title Then the app navigates to the Perps home page ``` ## **Screenshots/Recordings** Verified on device -- both Perps and Predictions View more cards now show consistent styling. ### **Before** View more card had no background and a circular bubble around the arrow icon. ### **After** <img width="300" src="https://github.com/user-attachments/assets/23c07566-2996-4f26-9717-481a07ba783e" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk UI and navigation tweak limited to homepage carousels; main risk is an incorrect route/params causing the Perps "View more" CTA to land on the wrong screen. > > **Overview** > Updates the shared homepage `ViewMoreCard` to match new design by moving the muted background and rounded corners to the outer card and removing the circular icon bubble. > > Changes the Perps homepage carousel "View more" CTA to navigate to `Routes.PERPS.MARKET_LIST` (while the section title still routes to `Routes.PERPS.PERPS_HOME`) and updates the Perps unit test accordingly. Aligns the Predictions carousel `ViewMoreCard` sizing/typography usage with Perps by using `flex-1` and default text variant. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a2cb634. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 0ce62c3 commit 1a22eb4

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

app/components/Views/Homepage/Sections/Perpetuals/PerpsSection.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ describe('PerpsSection', () => {
811811
fireEvent.press(screen.getByTestId('perps-view-more-card'));
812812

813813
expect(mockNavigate).toHaveBeenCalledWith(Routes.PERPS.ROOT, {
814-
screen: Routes.PERPS.PERPS_HOME,
814+
screen: Routes.PERPS.MARKET_LIST,
815815
params: { source: 'home_section' },
816816
});
817817
});

app/components/Views/Homepage/Sections/Perpetuals/PerpsSection.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ const PerpsSection = forwardRef<SectionRefreshHandle, PerpsSectionProps>(
212212
});
213213
}, [navigation]);
214214

215+
const handleViewMorePerps = useCallback(() => {
216+
navigation.navigate(Routes.PERPS.ROOT, {
217+
screen: Routes.PERPS.MARKET_LIST,
218+
params: { source: PERPS_EVENT_VALUE.SOURCE.HOME_SECTION },
219+
});
220+
}, [navigation]);
221+
215222
const handlePositionPress = useCallback(
216223
(position: Position) => {
217224
track(MetaMetricsEvents.PERPS_UI_INTERACTION, {
@@ -330,7 +337,7 @@ const PerpsSection = forwardRef<SectionRefreshHandle, PerpsSectionProps>(
330337
/>
331338
))}
332339
<ViewMoreCard
333-
onPress={handleViewAllPerps}
340+
onPress={handleViewMorePerps}
334341
twClassName="w-[180px] flex-1"
335342
testID="perps-view-more-card"
336343
/>

app/components/Views/Homepage/Sections/Predictions/PredictionsSection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ScrollView, View } from 'react-native';
88
import { useNavigation, NavigationProp } from '@react-navigation/native';
99
import { useSelector } from 'react-redux';
1010
import { useTailwind } from '@metamask/design-system-twrnc-preset';
11-
import { Box, TextVariant } from '@metamask/design-system-react-native';
11+
import { Box } from '@metamask/design-system-react-native';
1212
import SectionTitle from '../../components/SectionTitle';
1313
import ErrorState from '../../components/ErrorState';
1414
import FadingScrollContainer from '../../components/FadingScrollContainer';
@@ -276,8 +276,7 @@ const PredictionsSection = forwardRef<
276276
))}
277277
<ViewMoreCard
278278
onPress={handleViewAllPredictions}
279-
twClassName="w-[180px] h-[180px]"
280-
textVariant={TextVariant.BodyLg}
279+
twClassName="w-[180px] flex-1"
281280
/>
282281
</>
283282
)}

app/components/Views/Homepage/components/ViewMoreCard/ViewMoreCard.tsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface ViewMoreCardProps {
2626

2727
/**
2828
* Shared "View more" card shown at the end of a horizontal carousel.
29-
* Renders a circular ArrowRight icon above a label, blending with the background.
29+
* Renders an ArrowRight icon above a label on a muted background.
3030
*/
3131
const ViewMoreCard: React.FC<ViewMoreCardProps> = ({
3232
onPress,
@@ -41,22 +41,16 @@ const ViewMoreCard: React.FC<ViewMoreCardProps> = ({
4141
testID={testID}
4242
>
4343
<Box
44-
twClassName={twClassName}
44+
twClassName={`rounded-xl bg-background-muted ${twClassName}`}
4545
alignItems={BoxAlignItems.Center}
4646
justifyContent={BoxJustifyContent.Center}
4747
gap={2}
4848
>
49-
<Box
50-
twClassName="w-8 h-8 rounded-full bg-background-muted"
51-
alignItems={BoxAlignItems.Center}
52-
justifyContent={BoxJustifyContent.Center}
53-
>
54-
<Icon
55-
name={IconName.ArrowRight}
56-
size={IconSize.Md}
57-
color={IconColor.IconDefault}
58-
/>
59-
</Box>
49+
<Icon
50+
name={IconName.ArrowRight}
51+
size={IconSize.Md}
52+
color={IconColor.IconDefault}
53+
/>
6054
<Text
6155
variant={textVariant}
6256
fontWeight={FontWeight.Medium}

0 commit comments

Comments
 (0)