Skip to content

Commit 867e438

Browse files
fix(perps): remove hardcoded color in RefreshControl (#21916)
## **Description** This PR removes custom color styling from RefreshControl components in the Perps feature area. The colors prop (or tintColor prop) was previously set to theme.colors.icon.default, which could cause visual inconsistencies when the user uses dark theme. By removing this custom color configuration, the RefreshControl now uses the native system defaults ## **Changelog** CHANGELOG entry: Fixed RefreshControl color styling in Perps views to use native system defaults ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1568 ## **Manual testing steps** ```gherkin Feature: RefreshControl styling in Perps views Scenario: user performs pull-to-refresh on Perps Market Details Given user is on the Perps Market Details view And the user is using dark mode on Android When user performs a pull-to-refresh gesture Then the refresh indicator should display with native system colors And the refresh indicator should be visible and properly styled And data should refresh successfully ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="270" height="605" alt="Capture d’écran 2025-09-16 à 12 23 17" src="https://github.com/user-attachments/assets/71b5d8be-ce47-4787-85cc-3532086fc340" /> ### **After** <img width="1080" height="2400" alt="Screenshot_1761822745" src="https://github.com/user-attachments/assets/2194a426-f6aa-4cfc-9c19-f8234ccd1ec7" /> ## **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] > Removes theme-based color overrides from `RefreshControl` in Perps Market Details and drops the now-unused `theme` from `useStyles`. > > - **Perps Market Details (`app/components/UI/Perps/Views/PerpsMarketDetailsView/PerpsMarketDetailsView.tsx`)**: > - **RefreshControl**: Removed `tintColor`/`colors` theme overrides; now uses system defaults via `<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />`. > - **Styles hook**: Dropped unused `theme` from `useStyles` destructure (`const { styles } = useStyles(createStyles, {});`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 95ae927. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
1 parent b120a69 commit 867e438

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/components/UI/Perps/Views/PerpsMarketDetailsView/PerpsMarketDetailsView.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
590590
);
591591

592592
// Simplified styles - no complex calculations needed
593-
const { styles, theme } = useStyles(createStyles, {});
593+
const { styles } = useStyles(createStyles, {});
594594

595595
if (!market) {
596596
return (
@@ -631,12 +631,7 @@ const PerpsMarketDetailsView: React.FC<PerpsMarketDetailsViewProps> = () => {
631631
showsVerticalScrollIndicator={false}
632632
testID={PerpsMarketDetailsViewSelectorsIDs.SCROLL_VIEW}
633633
refreshControl={
634-
<RefreshControl
635-
refreshing={refreshing}
636-
onRefresh={handleRefresh}
637-
tintColor={theme.colors.icon.default}
638-
colors={[theme.colors.icon.default]} // Android
639-
/>
634+
<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
640635
}
641636
>
642637
{/* TradingView Chart Section */}

0 commit comments

Comments
 (0)