Skip to content

Commit

Permalink
Merge branch 'main' into chore/10784_clean_events
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/core/Analytics/MetaMetrics.events.ts
  • Loading branch information
NicolasMassart committed Sep 24, 2024
2 parents 891fe78 + d2d4dee commit f0b7676
Show file tree
Hide file tree
Showing 83 changed files with 1,295 additions and 885 deletions.
2 changes: 2 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ignores:
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
# This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it
- cockatiel

Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ on:
pull_request:
merge_group:
types: [checks_requested]

jobs:
setup:
runs-on: ubuntu-20.04
check-diff:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 #v1
with:
ruby-version: '3.1.5'
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
- name: Determine whether the current PR is a draft
id: set-is-draft
if: github.event_name == 'pull_request' && github.event.pull_request.number
Expand All @@ -27,7 +33,7 @@ jobs:
run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc
env:
PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }}
- run: yarn setup --node
- run: yarn setup
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -39,7 +45,6 @@ jobs:
fi
dedupe:
runs-on: ubuntu-20.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -58,7 +63,6 @@ jobs:
fi
scripts:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
scripts:
Expand Down Expand Up @@ -86,7 +90,6 @@ jobs:
fi
unit-tests:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Expand Down Expand Up @@ -156,7 +159,6 @@ jobs:
js-bundle-size-check:
runs-on: ubuntu-20.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -270,7 +272,7 @@ jobs:
runs-on: ubuntu-20.04
needs:
[
setup,
check-diff,
dedupe,
scripts,
unit-tests,
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/crowdin_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
- main
schedule:
- cron: "0 */12 * * *"
merge_group:
types: [checks_requested]

jobs:
synchronize-with-crowdin:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ on:
branches: main
pull_request:


jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3

- uses: actions/checkout@v3

- name: Build and load
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: scripts/docker/Dockerfile
Expand Down
10 changes: 0 additions & 10 deletions Gemfile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, View } from 'react-native';
import { useTheme } from '../../util/theme';
import { Theme } from '@metamask/design-tokens';
import { colors as importedColors } from '../../styles/common';

const createStyles = (colors) =>
interface ModalDraggerProps {
borderless?: boolean;
}

const createStyles = (colors: Theme['colors']) =>
StyleSheet.create({
draggerWrapper: {
width: '100%',
Expand All @@ -25,7 +29,7 @@ const createStyles = (colors) =>
},
});

function ModalDragger({ borderless }) {
function ModalDragger({ borderless }: ModalDraggerProps) {
const { colors } = useTheme();
const styles = createStyles(colors);

Expand All @@ -36,8 +40,4 @@ function ModalDragger({ borderless }) {
);
}

ModalDragger.propTypes = {
borderless: PropTypes.bool,
};

export default ModalDragger;
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet, TouchableOpacity } from 'react-native';
import {
View,
StyleSheet,
TouchableOpacity,
TouchableOpacityProps,
GestureResponderEvent,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { useTheme } from '../../util/theme';
import { Theme } from '@metamask/design-tokens';

const createStyles = (colors) =>
interface SelectorButtonProps {
onPress: (event: GestureResponderEvent) => void;
disabled?: boolean;
children: React.ReactNode;
}

const createStyles = (colors: Theme['colors']) =>
StyleSheet.create({
container: {
backgroundColor: colors.background.alternative,
Expand All @@ -23,7 +35,12 @@ const createStyles = (colors) =>
},
});

function SelectorButton({ onPress, disabled, children, ...props }) {
const SelectorButton: React.FC<SelectorButtonProps & TouchableOpacityProps> = ({
onPress,
disabled,
children,
...props
}) => {
const { colors } = useTheme();
const styles = createStyles(colors);

Expand All @@ -35,12 +52,6 @@ function SelectorButton({ onPress, disabled, children, ...props }) {
</View>
</TouchableOpacity>
);
}

SelectorButton.propTypes = {
children: PropTypes.node,
onPress: PropTypes.func,
disabled: PropTypes.bool,
};

export default SelectorButton;
77 changes: 40 additions & 37 deletions app/components/Base/Summary.js → app/components/Base/Summary.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet } from 'react-native';
import { View, StyleSheet, ViewStyle, StyleProp } from 'react-native';
import { useTheme } from '../../util/theme';
import type { Theme as DesignTokenTheme } from '@metamask/design-tokens';

const createStyles = (colors) =>
const createStyles = (colors: DesignTokenTheme['colors']) =>
StyleSheet.create({
wrapper: {
borderWidth: 1,
Expand Down Expand Up @@ -40,11 +40,38 @@ const useGetStyles = () => {
return createStyles(colors);
};

const Summary = ({ style, ...props }) => {
interface SummaryProps {
style?: StyleProp<ViewStyle>;
}

interface SummaryRowProps extends SummaryProps {
end?: boolean;
last?: boolean;
}

interface SummaryColProps extends SummaryProps {
end?: boolean;
}

interface SummarySeparatorProps extends SummaryProps {}

interface SummaryComponent extends React.FC<SummaryProps> {
Row: React.FC<SummaryRowProps>;
Col: React.FC<SummaryColProps>;
Separator: React.FC<SummarySeparatorProps>;
}

const Summary: SummaryComponent = ({ style, ...props }) => {
const styles = useGetStyles();
return <View style={[styles.wrapper, style]} {...props} />;
};
const SummaryRow = ({ style, end, last, ...props }) => {

const SummaryRow: React.FC<SummaryRowProps> = ({
style,
end,
last,
...props
}) => {
const styles = useGetStyles();
return (
<View
Expand All @@ -53,46 +80,22 @@ const SummaryRow = ({ style, end, last, ...props }) => {
/>
);
};
const SummaryCol = ({ style, end, ...props }) => {

const SummaryCol: React.FC<SummaryColProps> = ({ style, end, ...props }) => {
const styles = useGetStyles();
return <View style={[styles.col, end && styles.rowEnd, style]} {...props} />;
};
const SummarySeparator = ({ style, ...props }) => {

const SummarySeparator: React.FC<SummarySeparatorProps> = ({
style,
...props
}) => {
const styles = useGetStyles();
return <View style={[styles.separator, style]} {...props} />;
};

Summary.Row = SummaryRow;
Summary.Col = SummaryCol;
Summary.Separator = SummarySeparator;
export default Summary;

/**
* Any other external style defined in props will be applied
*/
const stylePropType = PropTypes.oneOfType([PropTypes.object, PropTypes.array]);

Summary.propTypes = {
style: stylePropType,
};
SummaryRow.propTypes = {
style: stylePropType,
/**
* Aligns content to the end of the row
*/
end: PropTypes.bool,
/**
* Add style to the last row of the summary
*/
last: PropTypes.bool,
};
SummaryCol.propTypes = {
style: stylePropType,
/**
* Aligns content to the end of the row
*/
end: PropTypes.bool,
};
SummarySeparator.propTypes = {
style: stylePropType,
};
export default Summary;
File renamed without changes.
4 changes: 4 additions & 0 deletions app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import { SnapsExecutionWebView } from '../../../lib/snaps';
///: END:ONLY_INCLUDE_IF
import OptionsSheet from '../../UI/SelectOptionSheet/OptionsSheet';
import FoxLoader from '../../../components/UI/FoxLoader';
import { AppStateEventProcessor } from '../../../core/AppStateEventListener';

const clearStackNavigatorOptions = {
headerShown: false,
Expand Down Expand Up @@ -317,6 +318,7 @@ const App = (props) => {
const dispatch = useDispatch();
const sdkInit = useRef();
const [onboarded, setOnboarded] = useState(false);

const triggerSetCurrentRoute = (route) => {
dispatch(setCurrentRoute(route));
if (route === 'Wallet' || route === 'BrowserView') {
Expand Down Expand Up @@ -369,6 +371,7 @@ const App = (props) => {
const deeplink = params?.['+non_branch_link'] || uri || null;
try {
if (deeplink) {
AppStateEventProcessor.setCurrentDeeplink(deeplink);
SharedDeeplinkManager.parse(deeplink, {
origin: AppConstants.DEEPLINKS.ORIGIN_DEEPLINK,
});
Expand Down Expand Up @@ -406,6 +409,7 @@ const App = (props) => {
},
dispatch,
});

if (!prevNavigator.current) {
// Setup navigator with Sentry instrumentation
routingInstrumentation.registerNavigationContainer(navigator);
Expand Down
Loading

0 comments on commit f0b7676

Please sign in to comment.