Skip to content

Commit

Permalink
Merge branch 'main' into release/7.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cal-L authored Feb 28, 2024
2 parents b3f356b + 672475e commit e7c3c4b
Show file tree
Hide file tree
Showing 80 changed files with 4,566 additions and 1,892 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ exports[`CustomSpendCap should match snapshot 1`] = `
</View>
</View>
<Text
accessibilityRole="text"
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down Expand Up @@ -220,7 +221,8 @@ exports[`CustomSpendCap should match snapshot 1`] = `
This allows the third party to spend all your token balance until it reaches the cap or you revoke the spending cap. If this is not intended, consider setting a lower spending cap.
<Text
accessibilityRole="text"
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ exports[`Banner should render correctly with a close button 1`] = `
Sample Banner Description
</Text>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down Expand Up @@ -385,6 +387,8 @@ exports[`Banner should render correctly with an action button 1`] = `
Sample Banner Description
</Text>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ exports[`BannerAlert should render BannerAlert 1`] = `
Sample Banner Alert Description
</Text>
<Text
accessibilityRole="text"
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ exports[`BannerTip should render default settings correctly 1`] = `
Sample Banner Tip Description
</Text>
<Text
accessibilityRole="text"
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(
isInteractable = true,
shouldNavigateBack = true,
isFullscreen = false,
customMarginTop,
...props
},
ref,
Expand Down Expand Up @@ -106,7 +105,6 @@ const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(
isInteractable={isInteractable}
onClose={onCloseCB}
onOpen={onOpenCB}
customMarginTop={customMarginTop}
ref={bottomSheetDialogRef}
isFullscreen={isFullscreen}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ Boolean that indicates if sheet is swippable. This affects whether or not tappin
| boolean | No | true |


### `customMarginTop`

Configure height of the modal by setting the distance between top of modal and top of screen.
| <span style="color:gray;font-size:14px">TYPE</span> | <span style="color:gray;font-size:14px">REQUIRED</span> | <span style="color:gray;font-size:14px">DEFAULT</span> |
| :-------------------------------------------------- | :------------------------------------------------------ | :----------------------------------------------------- |
| number | No | 250

### `children`

Content to wrap in sheet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ export const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION =
* This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.
*/
export const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;
/**
* Minimum spacing reserved for the overlay tappable area.
*/
export const DEFAULT_BOTTOMSHEETDIALOG_MARGINTOP = 250;
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,
DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD,
DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION,
DEFAULT_BOTTOMSHEETDIALOG_MARGINTOP,
} from './BottomSheetDialog.constants';
import styleSheet from './BottomSheetDialog.styles';
import {
Expand All @@ -60,7 +59,6 @@ const BottomSheetDialog = forwardRef<
isInteractable = true,
onClose,
onOpen,
customMarginTop,
...props
},
ref,
Expand All @@ -69,10 +67,7 @@ const BottomSheetDialog = forwardRef<
useSafeAreaInsets();
const { y: frameY } = useSafeAreaFrame();
const { height: screenHeight } = useWindowDimensions();
const marginTop = customMarginTop ?? DEFAULT_BOTTOMSHEETDIALOG_MARGINTOP;
const maxSheetHeight = isFullscreen
? screenHeight - screenTopPadding
: screenHeight - screenTopPadding - marginTop;
const maxSheetHeight = screenHeight - screenTopPadding;
const { styles } = useStyles(styleSheet, {
maxSheetHeight,
screenBottomPadding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export interface BottomSheetDialogProps extends ViewProps {
* Optional callback that gets triggered when sheet is opened.
*/
onOpen?: (hasPendingAction?: boolean) => void;
/**
* Customize the top margin of the sheet.
*/
customMarginTop?: number;
}

export interface BottomSheetDialogRef {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exports[`BottomSheetDialog should render correctly 1`] = `
"borderTopLeftRadius": 8,
"borderTopRightRadius": 8,
"borderWidth": 1,
"maxHeight": 1083,
"maxHeight": 1333,
"overflow": "hidden",
"paddingBottom": 3,
"shadowColor": "#0000001A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
testID="bottomsheetfooter"
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down Expand Up @@ -52,6 +54,8 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const ButtonBase = ({
activeOpacity={1}
onPress={onPress}
style={styles.base}
accessibilityRole="button"
accessible
{...props}
>
{startIconName && (
Expand All @@ -59,6 +61,7 @@ const ButtonBase = ({
<Text
variant={DEFAULT_BUTTONBASE_LABEL_TEXTVARIANT}
style={styles.label}
accessibilityRole="none"
>
{label}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

exports[`ButtonBase should render correctly 1`] = `
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
style={
Expand All @@ -28,6 +30,7 @@ exports[`ButtonBase should render correctly 1`] = `
}
/>
<Text
accessibilityRole="none"
style={
Object {
"color": "#24272A",
Expand All @@ -42,6 +45,8 @@ exports[`ButtonBase should render correctly 1`] = `

exports[`ButtonBase should render correctly when disabled 1`] = `
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
disabled={true}
onPress={[Function]}
Expand Down Expand Up @@ -70,6 +75,7 @@ exports[`ButtonBase should render correctly when disabled 1`] = `
}
/>
<Text
accessibilityRole="none"
style={
Object {
"color": "#24272A",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const ButtonLink: React.FC<ButtonLinkProps> = ({
onPressIn={triggerOnPressedIn}
onPressOut={triggerOnPressedOut}
accessibilityRole="link"
accessible
{...props}
>
{renderLabel()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`Link should render correctly 1`] = `
<Fragment>
<Text
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down
2 changes: 1 addition & 1 deletion app/component-library/components/Texts/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Text: React.FC<TextProps> = ({
}) => {
const { styles } = useStyles(styleSheet, { variant, style, color });
return (
<RNText {...props} style={styles.base} accessibilityRole="text">
<RNText accessibilityRole="text" {...props} style={styles.base}>
{children}
</RNText>
);
Expand Down
8 changes: 3 additions & 5 deletions app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import branch from 'react-native-branch';
import AppConstants from '../../../core/AppConstants';
import Logger from '../../../util/Logger';
import { routingInstrumentation } from '../../../util/sentry/utils';
import Analytics from '../../../core/Analytics/Analytics';
import { connect, useDispatch } from 'react-redux';
import {
CURRENT_APP_VERSION,
Expand Down Expand Up @@ -370,13 +369,12 @@ const App = ({ userLoggedIn }) => {
}, [dispatch, handleDeeplink, navigator, queueOfHandleDeeplinkFunctions]);

useEffect(() => {
const initAnalytics = async () => {
const initMetrics = async () => {
await MetaMetrics.getInstance().configure();
await Analytics.init();
};

initAnalytics().catch((err) => {
Logger.error(err, 'Error initializing analytics');
initMetrics().catch((err) => {
Logger.error(err, 'Error initializing MetaMetrics');
});
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ exports[`CollectibleModal should render correctly 1`] = `
}
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down
5 changes: 4 additions & 1 deletion app/components/UI/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ export function getTransactionsNavbarOptions(
*
* @param {string} title - Title in string format
* @param {Object} navigation - Navigation object required to push new views
* @param isFullScreenModal
* @param themeColors
* @param {IMetaMetricsEvent} navigationPopEvent
* @returns {Object} - Corresponding navbar options containing title and headerTitleStyle
*/
export function getNavigationOptionsTitle(
title,
navigation,
isFullScreenModal,
themeColors,
navigationPopEvent = undefined,
navigationPopEvent = null,
) {
const innerStyles = StyleSheet.create({
headerStyle: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ exports[`NetworkDetails renders correctly 1`] = `
testID="bottomsheetfooter"
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down Expand Up @@ -543,6 +545,8 @@ exports[`NetworkDetails renders correctly 1`] = `
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPress={[Function]}
onPressIn={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ exports[`NetworkVerificationInfo renders correctly 1`] = `
testID="bottomsheetfooter"
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down Expand Up @@ -501,6 +503,8 @@ exports[`NetworkVerificationInfo renders correctly 1`] = `
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
onPressIn={[Function]}
onPressOut={[Function]}
Expand Down
7 changes: 4 additions & 3 deletions app/components/UI/OptinMetrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import { connect } from 'react-redux';
import { clearOnboardingEvents } from '../../../actions/onboarding';
import { ONBOARDING_WIZARD } from '../../../constants/storage';
import AppConstants from '../../../core/AppConstants';
import { Analytics, MetaMetricsEvents } from '../../../core/Analytics';
import { withMetricsAwareness } from '../../hooks/useMetrics';
import {
MetaMetricsEvents,
withMetricsAwareness,
} from '../../hooks/useMetrics';

import DefaultPreference from 'react-native-default-preference';
import { ThemeContext } from '../../../util/theme';
Expand Down Expand Up @@ -272,7 +274,6 @@ class OptinMetrics extends PureComponent {
// and disable analytics
clearOnboardingEvents();
await metrics.enable(false);
Analytics.disableInstance();
}, 200);
this.continue();
};
Expand Down
Loading

0 comments on commit e7c3c4b

Please sign in to comment.