Skip to content

Commit

Permalink
Merge branch 'main' into feat/stake-829-create-key-value-row-component
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt561 authored Sep 18, 2024
2 parents 113513c + 20df5be commit 3a353a3
Show file tree
Hide file tree
Showing 22 changed files with 1,232 additions and 26 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/check-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ name: Check Attributions
on:
push:
branches: release/*
pull_request:
branches: release/*
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
check-attributions:
Expand Down
8 changes: 7 additions & 1 deletion .js.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@ export GOOGLE_SERVICES_B64=""
export FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN=
export FEATURES_ANNOUNCEMENTS_SPACE_ID=

#Multichain Feature flag
# Enables the Settings Page - Developer Options
export MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS="true"

# The endpoint used to submit errors and tracing data to Sentry for dev environment.
# export MM_SENTRY_DSN_DEV=

# Multichain Feature flag
export MULTICHAIN_V1=""
9 changes: 9 additions & 0 deletions app/components/Nav/Main/MainNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import NotificationsView from '../../Views/Notifications';
import NotificationsDetails from '../../Views/Notifications/Details';
import OptIn from '../../Views/Notifications/OptIn';
import AppInformation from '../../Views/Settings/AppInformation';
import DeveloperOptions from '../../Views/Settings/DeveloperOptions';
import Contacts from '../../Views/Settings/Contacts';
import Wallet from '../../Views/Wallet';
import Asset from '../../Views/Asset';
Expand Down Expand Up @@ -314,6 +315,14 @@ const SettingsFlow = () => (
component={AppInformation}
options={AppInformation.navigationOptions}
/>
{process.env.MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS === 'true' && (
<Stack.Screen
name={Routes.SETTINGS.DEVELOPER_OPTIONS}
component={DeveloperOptions}
options={DeveloperOptions.navigationOptions}
/>
)}

<Stack.Screen
name="ContactsSettings"
component={Contacts}
Expand Down
10 changes: 7 additions & 3 deletions app/components/UI/LedgerModals/Steps/SearchingForDeviceStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ import { getSystemVersion } from 'react-native-device-info';
import { strings } from '../../../../../locales/i18n';
import { LEDGER_SUPPORT_LINK } from '../../../../constants/urls';
import Device from '../../../../util/device';
import { useAssetFromTheme } from '../../../../util/theme';
import { useAssetFromTheme, useTheme } from '../../../../util/theme';
import Text, { TextVariant } from '../../../../component-library/components/Texts/Text';

import ledgerConnectDarkImage from '../../../../images/ledger-connect-dark.png';
import ledgerConnectLightImage from '../../../../images/ledger-connect-light.png';
import { SEARCHING_FOR_DEVICE_STEP } from './Steps.constants';
import { Colors } from '../../../../util/theme/models';

const createStyles = () =>
const createStyles = (colors: Colors) =>
StyleSheet.create({
modalTitle: {
marginTop: 30,
Expand Down Expand Up @@ -51,6 +52,8 @@ const createStyles = () =>
flexWrap: 'wrap',
marginLeft: 20,
marginRight: 20,
color: colors.primary.default,

},
lookingForDeviceContainer: {
flex: 1,
Expand All @@ -59,7 +62,8 @@ const createStyles = () =>
});

const SearchingForDeviceStep = () => {
const styles = useMemo(() => createStyles(), []);
const { colors } = useTheme();
const styles = useMemo(() => createStyles(colors), [colors]);
const navigation = useNavigation();

const deviceOSVersion = Number(getSystemVersion()) || 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android < 12 1`] = `
numberOfLines={2}
style={
{
"color": "#141618",
"color": "#0376c9",
"flex": 1,
"flexWrap": "wrap",
"fontFamily": "EuclidCircularB-Regular",
Expand Down Expand Up @@ -392,7 +392,7 @@ exports[`SearchingForDeviceStep matches snapshot for Android 12+ 1`] = `
numberOfLines={2}
style={
{
"color": "#141618",
"color": "#0376c9",
"flex": 1,
"flexWrap": "wrap",
"fontFamily": "EuclidCircularB-Regular",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ exports[`LedgerConfirmationModal render matches latest snapshot 1`] = `
numberOfLines={2}
style={
{
"color": "#141618",
"color": "#0376c9",
"flex": 1,
"flexWrap": "wrap",
"fontFamily": "EuclidCircularB-Regular",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ exports[`LedgerMessageSignModal should render correctly 1`] = `
numberOfLines={2}
style={
{
"color": "#141618",
"color": "#0376c9",
"flex": 1,
"flexWrap": "wrap",
"fontFamily": "EuclidCircularB-Regular",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { StyleSheet } from 'react-native';
import { Theme } from '../../../../util/theme/models';

const styleSheet = (params: { theme: Theme }) => {
const { theme } = params;
const { colors } = theme;
return StyleSheet.create({
wrapper: {
backgroundColor: colors.background.default,
flex: 1,
padding: 24,
paddingBottom: 48,
},
heading: {
marginTop: 16,
},
desc: {
marginTop: 8,
},
accessory: {
marginTop: 16,
},
});
};

export default styleSheet;
90 changes: 90 additions & 0 deletions app/components/Views/Settings/DeveloperOptions/SentryTest.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import React, { useCallback } from 'react';
import { strings } from '../../../../../locales/i18n';
import { useTheme } from '../../../../util/theme';
import Text, {
TextVariant,
TextColor,
} from '../../../../component-library/components/Texts/Text';
import Button, {
ButtonVariants,
ButtonSize,
ButtonWidthTypes,
} from '../../../../component-library/components/Buttons/Button';
import { trace, TraceName } from '../../../../util/trace';
import { sleep } from '../../../../util/testUtils';
import { useStyles } from '../../../../component-library/hooks';
import styleSheet from './DeveloperOptions.styles';

function GenerateTrace() {
const theme = useTheme();
const { styles } = useStyles(styleSheet, { theme });

const handleGenerateTraceTest = useCallback(async () => {
await trace(
{
name: TraceName.DeveloperTest,
data: { 'test.data.number': 123 },
tags: { 'test.tag.number': 123 },
},
async (context) => {
await trace(
{
name: TraceName.NestedTest1,
data: { 'test.data.boolean': true },
tags: { 'test.tag.boolean': true },
parentContext: context,
},
() => sleep(1000),
);

await trace(
{
name: TraceName.NestedTest2,
data: { 'test.data.string': 'test' },
tags: { 'test.tag.string': 'test' },
parentContext: context,
},
() => sleep(500),
);
},
);
}, []);

return (
<>
<Text
color={TextColor.Alternative}
variant={TextVariant.BodyMD}
style={styles.desc}
>
{strings('app_settings.developer_options.generate_trace_test_desc')}
</Text>
<Button
variant={ButtonVariants.Secondary}
size={ButtonSize.Lg}
label={strings('app_settings.developer_options.generate_trace_test')}
onPress={handleGenerateTraceTest}
width={ButtonWidthTypes.Full}
style={styles.accessory}
/>
</>
);
}

export default function SentryTest() {
const theme = useTheme();
const { styles } = useStyles(styleSheet, { theme });

return (
<>
<Text
color={TextColor.Default}
variant={TextVariant.HeadingLG}
style={styles.heading}
>
{'Sentry'}
</Text>
<GenerateTrace />
</>
);
}
Loading

0 comments on commit 3a353a3

Please sign in to comment.