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
5 changes: 0 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ enableScripts: false
nodeLinker: node-modules

npmAuditIgnoreAdvisories:
### Advisories:
# Issue: Regular Expression Denial of Service (ReDoS) in cross-spawn
# URL - https://github.com/advisories/GHSA-3xgq-45jj-v275
# The affected versions <6.0.6, is only present in wdio which is a dev dependency
- 1104663

yarnPath: .yarn/releases/yarn-4.10.3.cjs

Expand Down
38 changes: 23 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.57.1]

### Fixed

- fix: show edit account bottomsheet on android when its behind the keyboard ([#21477](https://github.com/MetaMask/metamask-mobile/pull/21477))
- fix: Patch touchable issue in React Native ([#21568](https://github.com/MetaMask/metamask-mobile/pull/21568))

## [7.57.0]

### Added
Expand Down Expand Up @@ -403,35 +410,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [7.56.5]

### Fixed
- fix: use SharedDeeplinkManager to parse instead of Linking API ([#20960](https://github.com/MetaMask/metamask-mobile/pull/20960))
* fix: use SharedDeeplinkManager to parse instead of Linking API ([#20960](https://github.com/MetaMask/metamask-mobile/pull/20960))

## [7.56.4]

### Fixed
- fix: address feature flag config issue
* fix: address feature flag config issue

## [7.56.3]

### Fixed
- fix: remove unintended metrics from transaction finalised event ([#20733](https://github.com/MetaMask/metamask-mobile/pull/20733))
- fix: force rendering on token list when order changes ([#20771](https://github.com/MetaMask/metamask-mobile/pull/20771))
- fix: add contentful max version number segmentation ([#20769](https://github.com/MetaMask/metamask-mobile/pull/20769))
* fix: remove unintended metrics from transaction finalised event ([#20733](https://github.com/MetaMask/metamask-mobile/pull/20733))
* fix: force rendering on token list when order changes ([#20771](https://github.com/MetaMask/metamask-mobile/pull/20771))
* fix: add contentful max version number segmentation ([#20769](https://github.com/MetaMask/metamask-mobile/pull/20769))

## [7.56.2]

### Fixed
- fix: address feature flag config issue
* fix: address feature flag config issue

## [7.56.1]

### Fixed
- fix: in recipient validations for internal accounts ([#20694](https://github.com/MetaMask/metamask-mobile/pull/20694))
- feat: iOS Rehydration Flow Update to release/7.56.1 ([#20681](https://github.com/MetaMask/metamask-mobile/pull/20681))
- feat: social login success screen added for social login users and ios platform. ([#20679](https://github.com/MetaMask/metamask-mobile/pull/20679))
- fix: Returned Scrollview to Perps and Defi tab cp-7.56.1 ([#20650](https://github.com/MetaMask/metamask-mobile/pull/20650))
- fix: missing transactions in activity after perps deposit (\#20507) ([09ef7e5](https://github.com/MetaMask/metamask-mobile/commit/09ef7e5f5111d0d3592b5e6d60499f31dc22f013))
- fix: cp-7.56.1 Temp Revert page-level scroll for Wallet (#20579) ([#20616](https://github.com/MetaMask/metamask-mobile/pull/20616))
- fix: Temp Revert page-level scroll for Wallet (\#20579) ([9022244](https://github.com/MetaMask/metamask-mobile/commit/902224410fbdf37250b990c75986eb7a948fb5ec))
* fix: in recipient validations for internal accounts ([#20694](https://github.com/MetaMask/metamask-mobile/pull/20694))
* feat: iOS Rehydration Flow Update to release/7.56.1 ([#20681](https://github.com/MetaMask/metamask-mobile/pull/20681))
* feat: social login success screen added for social login users and ios platform. ([#20679](https://github.com/MetaMask/metamask-mobile/pull/20679))
* fix: Returned Scrollview to Perps and Defi tab cp-7.56.1 ([#20650](https://github.com/MetaMask/metamask-mobile/pull/20650))
* fix: missing transactions in activity after perps deposit (\#20507) ([09ef7e5](https://github.com/MetaMask/metamask-mobile/commit/09ef7e5f5111d0d3592b5e6d60499f31dc22f013))
* fix: cp-7.56.1 Temp Revert page-level scroll for Wallet (#20579) ([#20616](https://github.com/MetaMask/metamask-mobile/pull/20616))
* fix: Temp Revert page-level scroll for Wallet (\#20579) ([9022244](https://github.com/MetaMask/metamask-mobile/commit/902224410fbdf37250b990c75986eb7a948fb5ec))

## [7.56.0]

Expand Down Expand Up @@ -2498,7 +2505,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- feat: add InlineAlert component ([#13709](https://github.com/MetaMask/metamask-mobile/pull/13709))
- feat: add MultipleAlertModal component ([#13683](https://github.com/MetaMask/metamask-mobile/pull/13683))
- feat: Add Snaps UI `Selector` component ([#13747](https://github.com/MetaMask/metamask-mobile/pull/13747))
- feat: added mocks to sonar.coverage.exclusions ([#13787](https://github.com/MetaMask/metamask-mobile/pull/13787))
- feat: added **/**mocks**/** to sonar.coverage.exclusions ([#13787](https://github.com/MetaMask/metamask-mobile/pull/13787))
- feat: add `GeneralAlertBanner` component ([#13627](https://github.com/MetaMask/metamask-mobile/pull/13627))

### Fixed
Expand Down Expand Up @@ -7632,7 +7639,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#957](https://github.com/MetaMask/metamask-mobile/pull/957): fix timeouts (#957)
- [#954](https://github.com/MetaMask/metamask-mobile/pull/954): Bugfix: onboarding navigation (#954)

[Unreleased]: https://github.com/MetaMask/metamask-mobile/compare/v7.57.0...HEAD
[Unreleased]: https://github.com/MetaMask/metamask-mobile/compare/v7.57.1...HEAD
[7.57.1]: https://github.com/MetaMask/metamask-mobile/compare/v7.57.0...v7.57.1
[7.57.0]: https://github.com/MetaMask/metamask-mobile/compare/v7.56.5...v7.57.0
[7.56.5]: https://github.com/MetaMask/metamask-mobile/compare/v7.56.4...v7.56.5
[7.56.4]: https://github.com/MetaMask/metamask-mobile/compare/v7.56.3...v7.56.4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import React from 'react';
import { render } from '@testing-library/react-native';
import { Text, View } from 'react-native';
import ConditionalScrollView from './ConditionalScrollView';

describe('ConditionalScrollView', () => {
const testContent = (
<View>
<Text>Test Content</Text>
</View>
);

describe('when isScrollEnabled is true', () => {
it('wraps children in ScrollView and renders content', () => {
const { getByTestId, getByText } = render(
<ConditionalScrollView
isScrollEnabled
scrollViewProps={{ testID: 'scroll-container' }}
>
{testContent}
</ConditionalScrollView>,
);

expect(getByTestId('scroll-container')).toBeDefined();
expect(getByText('Test Content')).toBeDefined();
});

it('passes scrollViewProps to ScrollView', () => {
const testID = 'test-scroll-view';
const { getByTestId } = render(
<ConditionalScrollView
isScrollEnabled
scrollViewProps={{
testID,
showsVerticalScrollIndicator: false,
bounces: false,
}}
>
{testContent}
</ConditionalScrollView>,
);

const scrollView = getByTestId(testID);
expect(scrollView.props.showsVerticalScrollIndicator).toBe(false);
expect(scrollView.props.bounces).toBe(false);
});
});

describe('when isScrollEnabled is false', () => {
it('renders children without ScrollView wrapper', () => {
const { getByText, queryByTestId } = render(
<ConditionalScrollView
isScrollEnabled={false}
scrollViewProps={{ testID: 'should-not-exist' }}
>
{testContent}
</ConditionalScrollView>,
);

expect(queryByTestId('should-not-exist')).toBeNull();
expect(getByText('Test Content')).toBeDefined();
});
});

describe('dynamic behavior', () => {
it('switches between ScrollView and direct rendering when isScrollEnabled changes', () => {
const result = render(
<ConditionalScrollView
isScrollEnabled
scrollViewProps={{ testID: 'scroll-view' }}
>
{testContent}
</ConditionalScrollView>,
);

expect(result.getByTestId('scroll-view')).toBeDefined();

result.rerender(
<ConditionalScrollView
isScrollEnabled={false}
scrollViewProps={{ testID: 'scroll-view' }}
>
{testContent}
</ConditionalScrollView>,
);

expect(result.queryByTestId('scroll-view')).toBeNull();

result.rerender(
<ConditionalScrollView
isScrollEnabled
scrollViewProps={{ testID: 'scroll-view' }}
>
{testContent}
</ConditionalScrollView>,
);

expect(result.getByTestId('scroll-view')).toBeDefined();
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { ScrollView } from 'react-native';
import { ConditionalScrollViewProps } from './ConditionalScrollView.types';

/**
* ConditionalScrollView renders either a ScrollView or content directly based on isScrollEnabled prop.
* This is useful for homepage redesign where we want to remove nested scroll views in favor of a global scroll container.
*/
const ConditionalScrollView: React.FC<ConditionalScrollViewProps> = ({
children,
isScrollEnabled,
scrollViewProps,
}) =>
isScrollEnabled ? (
<ScrollView {...scrollViewProps}>{children}</ScrollView>
) : (
<>{children}</>
);

export default ConditionalScrollView;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ScrollViewProps } from 'react-native';

export interface ConditionalScrollViewProps {
/**
* Content to render inside the conditional scroll view
*/
children: React.ReactNode;
/**
* If true, wraps children in ScrollView. If false, renders children directly.
*/
isScrollEnabled: boolean;
/**
* Optional props to pass to ScrollView when isScrollEnabled is true
*/
scrollViewProps?: ScrollViewProps;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './ConditionalScrollView';
Loading
Loading