Skip to content

Commit

Permalink
Merge branch 'main' into feat-3800-settings-drawer-redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyhoward authored Jan 9, 2025
2 parents 5c99484 + cacbd20 commit e3ea4e9
Show file tree
Hide file tree
Showing 145 changed files with 3,493 additions and 1,058 deletions.
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
16 changes: 9 additions & 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ exports[`BasicFunctionalityModal 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 Expand Up @@ -312,9 +312,9 @@ exports[`BasicFunctionalityModal should render 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 @@ -216,9 +216,9 @@ exports[`CollectibleModal 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 @@ -328,9 +328,9 @@ exports[`ConfirmAddAsset render matches previous 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 @@ -368,9 +368,9 @@ exports[`ConfirmAddAsset 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
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = `
style={
{
"color": "#ffffff",
"fontFamily": "EuclidCircularB-Regular",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "400",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
Expand Down Expand Up @@ -514,9 +514,9 @@ exports[`EnableAutomaticSecurityChecksModal 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
Loading

0 comments on commit e3ea4e9

Please sign in to comment.