diff --git a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx index 7a227a1f65d2..b44d1b4de614 100644 --- a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx +++ b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx @@ -7,12 +7,18 @@ import type { Project } from '../types' const useStyles = makeStyles()((theme) => { return { - root: {}, + root: { + flex: 1, + }, content: { padding: theme.spacing(0), }, button: { - flex: 1, + backgroundColor: theme.palette.maskColor.dark, + color: 'white', + '&:hover': { + backgroundColor: theme.palette.maskColor.dark, + }, }, } }) @@ -40,6 +46,7 @@ export function ActionBar(props: ActionBarProps) { } diff --git a/packages/mask/src/plugins/Gitcoin/SNSAdaptor/PreviewCard.tsx b/packages/mask/src/plugins/Gitcoin/SNSAdaptor/PreviewCard.tsx index 05c1e3d799ad..2ff3844d10a8 100644 --- a/packages/mask/src/plugins/Gitcoin/SNSAdaptor/PreviewCard.tsx +++ b/packages/mask/src/plugins/Gitcoin/SNSAdaptor/PreviewCard.tsx @@ -73,7 +73,11 @@ const useStyles = makeStyles()((theme) => ({ '-webkit-box-orient': 'vertical', }, button: { - color: theme.palette.mode === 'dark' ? 'white' : 'black', + backgroundColor: theme.palette.maskColor.dark, + color: 'white', + '&:hover': { + backgroundColor: theme.palette.maskColor.dark, + }, width: '100%', }, })) @@ -172,13 +176,8 @@ export function PreviewCard(props: PreviewCardProps) { diff --git a/packages/mask/src/web3/UI/EthereumChainBoundary.tsx b/packages/mask/src/web3/UI/EthereumChainBoundary.tsx index 03596762dc52..9626dece8fd5 100644 --- a/packages/mask/src/web3/UI/EthereumChainBoundary.tsx +++ b/packages/mask/src/web3/UI/EthereumChainBoundary.tsx @@ -1,4 +1,4 @@ -import React, { useCallback } from 'react' +import React, { useCallback, useMemo } from 'react' import { Box, Typography, Theme, useTheme } from '@mui/material' import { makeStyles, MaskColorVar, ShadowRootTooltip, useStylesExtends } from '@masknet/theme' import type { SxProps } from '@mui/system' @@ -59,13 +59,13 @@ export interface EthereumChainBoundaryProps extends withClasses<'switchButton'> switchButtonStyle?: SxProps children?: React.ReactNode isValidChainId?: (actualChainId: ChainId, expectedChainId: ChainId) => boolean + renderInTimeline?: boolean ActionButtonPromiseProps?: Partial } export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { const { t } = useI18N() const theme = useTheme() - const pluginID = useCurrentWeb3NetworkPluginID() const plugin = useActivatedPlugin(pluginID, 'any') @@ -162,6 +162,26 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { if (!isChainMatched) await switchToChain() }, [account, isAllowed, isChainMatched, isPluginMatched, providerType, expectedChainId]) + // TODO: will remove this and extract new boundary for timeline + const buttonProps = useMemo(() => { + return { + ...(props.renderInTimeline + ? { + variant: 'contained', + fullWidth: true, + sx: { + backgroundColor: theme.palette.maskColor.dark, + color: theme.palette.maskColor.white, + '&:hover': { + backgroundColor: theme.palette.maskColor.dark, + }, + }, + } + : {}), + ...props.ActionButtonPromiseProps, + } as Partial + }, [props.ActionButtonPromiseProps, props.renderInTimeline]) + const renderBox = (children?: React.ReactNode, tips?: string) => { return ( @@ -182,11 +202,13 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { <> {!props.hiddenConnectButton ? ( } + fullWidth + startIcon={} variant="contained" size={props.ActionButtonPromiseProps?.size} sx={{ marginTop: 1.5 }} - onClick={openSelectProviderDialog}> + onClick={openSelectProviderDialog} + {...buttonProps}> {t('plugin_wallet_connect_wallet')} ) : null} @@ -225,10 +247,10 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { } sx={props.switchButtonStyle} - style={{ borderRadius: 10 }} init={ {t('plugin_wallet_connect_network', { @@ -246,7 +268,8 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { executor={onSwitchChain} completeOnClick={onSwitchChain} failedOnClick="use executor" - {...props.ActionButtonPromiseProps} + fullWidth + {...buttonProps} /> ) : null} , @@ -274,7 +297,6 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { /> } sx={props.switchButtonStyle} - style={{ borderRadius: 10, paddingTop: 11, paddingBottom: 11 }} init={ {t('plugin_wallet_switch_network', { network: expectedNetwork.replace('Mainnet', '') })} @@ -288,7 +310,8 @@ export function EthereumChainBoundary(props: EthereumChainBoundaryProps) { executor={onSwitchChain} completeOnClick={onSwitchChain} failedOnClick="use executor" - {...props.ActionButtonPromiseProps} + fullWidth + {...buttonProps} /> ) : null} ,