Skip to content

Commit

Permalink
Merge branch 'main' into feat-permit-simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
digiwand committed Jan 11, 2025
2 parents 5852d87 + 8873337 commit fce5367
Show file tree
Hide file tree
Showing 194 changed files with 5,491 additions and 1,340 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
shell: bash
run: |
mv ./tests/coverage/coverage-final.json ./tests/coverage/coverage-${{ matrix.shard }}.json
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.shard }}
path: ./tests/coverage/coverage-${{ matrix.shard }}.json
Expand All @@ -131,7 +131,7 @@ jobs:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: tests/coverage/
- name: Gather partial coverage reports into one directory
Expand All @@ -140,7 +140,7 @@ jobs:
mv ./tests/coverage/coverage-*/* ./tests/coverage
- run: yarn test:merge-coverage
- run: yarn test:validate-coverage
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: coverage
path: ./tests/merged-coverage/lcov.info
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: coverage
path: coverage/
Expand Down
7 changes: 5 additions & 2 deletions .js.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Sign up and generate your own keys at pubnub.com
# Then rename this file to ".js.env" and rebuild the app
#
#
# In order for this feature to work properly, you need to
# build metamask-extension from source (https://github.com/MetaMask/metamask-extension)
# and set your the same values there.
#
#
# For more info take a look at https://github.com/MetaMask/metamask-extension/pull/5955

export MM_PUBNUB_SUB_KEY=""
Expand Down Expand Up @@ -107,3 +107,6 @@ export MM_MULTICHAIN_V1_ENABLED=""

# Permissions Settings feature flag specific to UI changes
export MM_PERMISSIONS_SETTINGS_V1_ENABLED=""

# Feature flag for Stablecoin Lending UI
export MM_STABLECOIN_LENDING_UI_ENABLED="true"
14 changes: 14 additions & 0 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,17 @@ export function setProposedNonce(proposedNonce) {
proposedNonce,
};
}

export function setMaxValueMode(maxValueMode) {
return {
type: 'SET_MAX_VALUE_MODE',
maxValueMode,
};
}

export function setTransactionValue(value) {
return {
type: 'SET_TRANSACTION_VALUE',
value,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down Expand Up @@ -249,9 +249,9 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ exports[`Banner should render correctly with a close button 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down Expand Up @@ -412,9 +412,9 @@ exports[`Banner should render correctly with an action button 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ exports[`BannerAlert should render BannerAlert 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ exports[`BannerTip should render default settings correctly 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down Expand Up @@ -81,9 +81,9 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
style={
{
"color": "#ffffff",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const DEFAULT_BUTTONBASE_LABEL_COLOR = TextColor.Default;
export const DEFAULT_BUTTONBASE_SIZE = ButtonSize.Md;
export const DEFAULT_BUTTONBASE_WIDTH = ButtonWidthTypes.Auto;
export const DEFAULT_BUTTONBASE_ICON_SIZE = IconSize.Sm;
export const DEFAULT_BUTTONBASE_LABEL_TEXTVARIANT = TextVariant.BodyMD;
export const DEFAULT_BUTTONBASE_LABEL_TEXTVARIANT = TextVariant.BodyMDMedium;

// Samples
export const SAMPLE_BUTTONBASE_PROPS: ButtonBaseProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`ButtonBase should render correctly 1`] = `
"color": "#141618",
}
}
variant="sBodyMD"
variant="sBodyMDMedium"
>
Click me!
</Text>
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`ButtonBase should render correctly when disabled 1`] = `
"color": "#141618",
}
}
variant="sBodyMD"
variant="sBodyMDMedium"
>
Click me!
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ exports[`ButtonLink should render correctly 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ exports[`ButtonPrimary render matches latest snapshot 1`] = `
style={
{
"color": "#ffffff",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ exports[`ButtonSecondary should render correctly 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Third party dependencies.
import { IconName } from '../../Icons/Icon';

import Device from '../../../../util/device';
// Internal dependencies.
import { IconByTabBarIconKey, TabBarIconKey } from './TabBar.types';

Expand All @@ -13,3 +13,5 @@ export const ICON_BY_TAB_BAR_ICON_KEY: IconByTabBarIconKey = {
[TabBarIconKey.Activity]: IconName.Activity,
[TabBarIconKey.Setting]: IconName.Setting,
};

export const TAB_BAR_HEIGHT = Device.isAndroid() ? 62 : 48;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Device from '../../../../util/device';

// Internal dependencies.
import { TabBarStyleSheetVars } from './TabBar.types';

import { TAB_BAR_HEIGHT } from './TabBar.constants';
/**
* Style sheet function for TabBar component.
*
Expand Down Expand Up @@ -39,7 +39,7 @@ const styleSheet = (params: { vars: TabBarStyleSheetVars; theme: Theme }) => {
base: {
flexDirection: 'row',
alignItems: 'center',
height: Device.isAndroid() ? 62 : 48,
height: TAB_BAR_HEIGHT,
paddingHorizontal: 16,
marginBottom: bottomInset,
backgroundColor: colors.background.default,
Expand Down
3 changes: 2 additions & 1 deletion app/component-library/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
import styles from './Toast.styles';
import { ToastSelectorsIDs } from '../../../../e2e/selectors/wallet/ToastModal.selectors';
import { ButtonProps } from '../Buttons/Button/Button.types';
import { TAB_BAR_HEIGHT } from '../Navigation/TabBar/TabBar.constants';

const visibilityDuration = 2750;
const animationDuration = 250;
Expand All @@ -53,7 +54,7 @@ const Toast = forwardRef((_, ref: React.ForwardedRef<ToastRef>) => {
const { bottom: bottomNotchSpacing } = useSafeAreaInsets();
const translateYProgress = useSharedValue(screenHeight);
const animatedStyle = useAnimatedStyle(() => ({
transform: [{ translateY: translateYProgress.value }],
transform: [{ translateY: translateYProgress.value - TAB_BAR_HEIGHT }],
}));
const baseStyle: StyleProp<Animated.AnimateStyle<StyleProp<ViewStyle>>> =
useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ exports[`AddCustomToken render matches previous snapshot 1`] = `
style={
{
"color": "#ffffff",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down
18 changes: 10 additions & 8 deletions app/components/UI/AssetOverview/AssetOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import AppConstants from '../../../core/AppConstants';
import Engine from '../../../core/Engine';
import {
selectChainId,
selectTicker,
selectNativeCurrencyByChainId,
selectSelectedNetworkClientId,
selectTicker,
} from '../../../selectors/networkController';
import {
selectConversionRate,
Expand Down Expand Up @@ -58,7 +59,7 @@ import Routes from '../../../constants/navigation/Routes';
import TokenDetails from './TokenDetails';
import { RootState } from '../../../reducers';
import useGoToBridge from '../Bridge/utils/useGoToBridge';
import SwapsController, { swapsUtils } from '@metamask/swaps-controller';
import { swapsUtils } from '@metamask/swaps-controller';
import { MetaMetricsEvents } from '../../../core/Analytics';
import {
getDecimalChainId,
Expand Down Expand Up @@ -114,6 +115,7 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
? (asset.chainId as Hex)
: selectedChainId;
const ticker = isPortfolioViewEnabled() ? nativeCurrency : selectedTicker;
const selectedNetworkClientId = useSelector(selectSelectedNetworkClientId);

let currentAddress: Hex;

Expand All @@ -136,12 +138,12 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
const dispatch = useDispatch();

useEffect(() => {
const { SwapsController: SwapsControllerFromEngine } = Engine.context as {
SwapsController: SwapsController;
};
const { SwapsController } = Engine.context;
const fetchTokenWithCache = async () => {
try {
await SwapsControllerFromEngine.fetchTokenWithCache();
await SwapsController.fetchTokenWithCache({
networkClientId: selectedNetworkClientId,
});
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
Expand All @@ -152,7 +154,7 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
}
};
fetchTokenWithCache();
}, []);
}, [selectedNetworkClientId]);

const onReceive = () => {
navigation.navigate(Routes.QR_TAB_SWITCHER, {
Expand Down Expand Up @@ -384,7 +386,7 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
}
} else {
mainBalance = `${balance} ${asset.isETH ? asset.ticker : asset.symbol}`;
secondaryBalance = exchangeRate ? asset.balanceFiat : '';
secondaryBalance = asset.balanceFiat || '';
}

let currentPrice = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,22 @@ exports[`AssetOverview should render correctly when portfolio view is enabled 1`
}
}
>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 16,
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 24,
}
}
testID="fiat-balance-test-id"
>
1500
</Text>
<Text
accessibilityRole="text"
style={
Expand Down
Loading

0 comments on commit fce5367

Please sign in to comment.