-
{metadata.title}
{metadata.description}
@@ -119,7 +100,7 @@ const CardBody = memo(({ metadata, className, ...rest }: CardBodyProps) => {
*/
export function DonationCard({ feed, actionIndex, className, ...rest }: DonationCardProps) {
const { verbose } = rest
- const { classes, cx } = useStyles()
+ const { classes } = useStyles()
const { classes: mdClasses } = useMarkdownStyles()
const [index, setIndex] = useState(0)
@@ -135,12 +116,7 @@ export function DonationCard({ feed, actionIndex, className, ...rest }: Donation
if (verbose) {
return (
-
+
-
{metadata!.description}
diff --git a/packages/plugins/RSS3/src/SiteAdaptor/components/FeedCard/TokenOperationCard.tsx b/packages/plugins/RSS3/src/SiteAdaptor/components/FeedCard/TokenOperationCard.tsx
index 85821bd6badc..66cd20e4f442 100644
--- a/packages/plugins/RSS3/src/SiteAdaptor/components/FeedCard/TokenOperationCard.tsx
+++ b/packages/plugins/RSS3/src/SiteAdaptor/components/FeedCard/TokenOperationCard.tsx
@@ -85,7 +85,7 @@ export function TokenOperationCard({ feed, ...rest }: TokenFeedCardProps) {
const t = useI18N()
const { classes, cx } = useStyles()
- const action = feed.actions[0]
+ const action = feed.actions.find((x) => x.address_from && x.address_to) || feed.actions[0]
const metadata = action.metadata
const owner = useFeedOwner()
@@ -94,8 +94,8 @@ export function TokenOperationCard({ feed, ...rest }: TokenFeedCardProps) {
const cardType = cardTypeMap[feed.type] || (isFromOwner ? CardType.TokenOut : CardType.TokenIn)
const context = contextMap[feed.type] || (isFromOwner ? 'send' : 'claim')
- const from = useAddressLabel(action.address_from!)
- const to = useAddressLabel(action.address_to!)
+ const from = useAddressLabel(action.address_from ?? '')
+ const to = useAddressLabel(action.address_to ?? '')
return (
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx
index 067251986431..dabf2abbcbdd 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketDialog.tsx
@@ -1,7 +1,6 @@
import { useCallback, useMemo, useState } from 'react'
-import { compact } from 'lodash-es'
import Web3Utils from 'web3-utils'
-import { DialogContent, Tab } from '@mui/material'
+import { DialogContent, Tab, useTheme } from '@mui/material'
import { TabContext, TabPanel } from '@mui/lab'
import { CrossIsolationMessages, NetworkPluginID, PluginID } from '@masknet/shared-base'
import { useChainContext, useGasPrice } from '@masknet/web3-hooks-base'
@@ -13,7 +12,11 @@ import { useActivatedPlugin } from '@masknet/plugin-infra/dom'
import { Icons } from '@masknet/icons'
import { Telemetry } from '@masknet/web3-telemetry'
import { EventID, EventType } from '@masknet/web3-telemetry/types'
-import { useCurrentVisitingIdentity, useLastRecognizedIdentity } from '@masknet/plugin-infra/content-script'
+import {
+ useCurrentVisitingIdentity,
+ useLastRecognizedIdentity,
+ useSiteThemeMode,
+} from '@masknet/plugin-infra/content-script'
import { Web3 } from '@masknet/web3-providers'
import { useI18N } from '../locales/index.js'
import { reduceUselessPayloadInfo } from './utils/reduceUselessPayloadInfo.js'
@@ -26,8 +29,13 @@ import { RedPacketERC20Form } from './RedPacketERC20Form.js'
import { RedPacketERC721Form } from './RedPacketERC721Form.js'
import { openComposition } from './openComposition.js'
-const useStyles = makeStyles<{ currentTab: 'tokens' | 'collectibles'; showHistory: boolean }>()(
- (theme, { currentTab, showHistory }) => ({
+const useStyles = makeStyles<{ currentTab: 'tokens' | 'collectibles'; showHistory: boolean; isDim: boolean }>()((
+ theme,
+ { currentTab, showHistory, isDim },
+) => {
+ // it's hard to set dynamic color, since the background color of the button is blended transparent
+ const darkBackgroundColor = isDim ? '#38414b' : '#292929'
+ return {
dialogContent: {
padding: 0,
'::-webkit-scrollbar': {
@@ -41,8 +49,11 @@ const useStyles = makeStyles<{ currentTab: 'tokens' | 'collectibles'; showHistor
width: '100%',
paddingBottom: theme.spacing(2),
},
- }),
-)
+ arrowButton: {
+ backgroundColor: theme.palette.mode === 'dark' ? darkBackgroundColor : undefined,
+ },
+ }
+})
enum CreateRedPacketPageStep {
NewRedPacketPage = 'new',
@@ -68,13 +79,13 @@ export default function RedPacketDialog(props: RedPacketDialogProps) {
const { account, chainId: _chainId } = useChainContext()
const approvalDefinition = useActivatedPlugin(PluginID.RedPacket, 'any')
const [currentTab, onChange, tabs] = useTabs('tokens', 'collectibles')
- const { classes } = useStyles({ currentTab, showHistory })
- const chainIdList = useMemo(() => {
- return compact(
- currentTab === tabs.tokens
- ? approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? []
- : [ChainId.Mainnet, ChainId.BSC, ChainId.Matic],
- )
+ const theme = useTheme()
+ const mode = useSiteThemeMode(theme)
+ const { classes } = useStyles({ currentTab, showHistory, isDim: mode === 'dim' })
+ const chainIdList: ChainId[] = useMemo(() => {
+ return currentTab === tabs.tokens
+ ? approvalDefinition?.enableRequirement.web3?.[NetworkPluginID.PLUGIN_EVM]?.supportedChainIds ?? []
+ : [ChainId.Mainnet, ChainId.BSC, ChainId.Matic]
}, [currentTab === tabs.tokens, approvalDefinition?.enableRequirement.web3])
const chainId = chainIdList.includes(_chainId) ? _chainId : ChainId.Mainnet
@@ -217,6 +228,7 @@ export default function RedPacketDialog(props: RedPacketDialogProps) {
chains={chainIdList}
hideArrowButton={currentTab === tabs.collectibles}
pluginID={NetworkPluginID.PLUGIN_EVM}
+ classes={{ arrowButton: classes.arrowButton }}
/>
) : null
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketERC20Form.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketERC20Form.tsx
index 783dc33a8e65..56ba64756c02 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketERC20Form.tsx
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketERC20Form.tsx
@@ -1,9 +1,8 @@
import { type ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react'
-import { Check as CheckIcon } from '@mui/icons-material'
import { useAsync } from 'react-use'
import { BigNumber } from 'bignumber.js'
import { omit } from 'lodash-es'
-import { makeStyles, ActionButton, MaskTextField } from '@masknet/theme'
+import { makeStyles, ActionButton, MaskTextField, RadioIndicator } from '@masknet/theme'
import { Box, InputBase, Typography, useTheme } from '@mui/material'
import {
type FungibleToken,
@@ -31,7 +30,7 @@ import {
} from '@masknet/shared'
import { Icons } from '@masknet/icons'
import { useCurrentVisitingIdentity } from '@masknet/plugin-infra/content-script'
-import { useChainContext, useWallet, useNativeTokenPrice, useNetworkContext } from '@masknet/web3-hooks-base'
+import { useChainContext, useWallet, useNativeTokenPrice, useEnvironmentContext } from '@masknet/web3-hooks-base'
import { ChainResolver, SmartPayBundler, Web3 } from '@masknet/web3-providers'
import { useI18N } from '../locales/index.js'
import { RED_PACKET_DEFAULT_SHARES, RED_PACKET_MAX_SHARES, RED_PACKET_MIN_SHARES } from '../constants.js'
@@ -68,28 +67,17 @@ const useStyles = makeStyles()((theme) => ({
display: 'flex',
width: '50%',
alignItems: 'center',
- },
- checkIcon: {
- width: 15,
- height: 15,
- color: theme.palette.maskColor.bottom,
+ color: theme.palette.maskColor.line,
},
checkIconWrapper: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
cursor: 'pointer',
- width: 17,
- height: 17,
- borderRadius: 999,
+ borderRadius: '50%',
marginRight: 5,
- border: `2px solid ${theme.palette.maskColor.secondaryLine}`,
backgroundColor: 'transparent',
},
- checked: {
- borderColor: `${theme.palette.maskColor.primary} !important`,
- backgroundColor: `${theme.palette.maskColor.primary} !important`,
- },
tokenValue: {
flexGrow: 1,
},
@@ -108,12 +96,12 @@ export interface RedPacketFormProps {
export function RedPacketERC20Form(props: RedPacketFormProps) {
const t = useI18N()
- const { classes, cx } = useStyles()
+ const { classes } = useStyles()
const theme = useTheme()
const { onChange, onNext, origin, gasOption, onGasOptionChange, expectedChainId } = props
// context
const wallet = useWallet()
- const { pluginID } = useNetworkContext()
+ const { pluginID } = useEnvironmentContext()
const { account, chainId } = useChainContext
({ chainId: expectedChainId })
const { HAPPY_RED_PACKET_ADDRESS_V4 } = useRedPacketConstants(chainId)
const { value: smartPayChainId } = useAsync(async () => SmartPayBundler.getSupportedChainId(), [])
@@ -283,10 +271,8 @@ export function RedPacketERC20Form(props: RedPacketFormProps) {
<>
-
setRandom(1)}>
-
+
+ setRandom(1)} checked={!!isRandom} size={20} />
-
setRandom(0)}>
-
+
+ setRandom(0)} checked={!isRandom} size={20} />
setMessage(e.target.value)}
placeholder={t.blessing_words()}
value={message}
+ inputProps={{
+ maxLength: 100,
+ }}
/>
@@ -386,6 +373,7 @@ export function RedPacketERC20Form(props: RedPacketFormProps) {
actualPluginID={pluginID}>
(undefined)
const { account, chainId } = useChainContext()
+ const { pluginID } = useEnvironmentContext()
const [collection, setCollection] = useState>()
const [manualSelectedTokenDetailedList, setExistTokenDetailedList] = useState(EMPTY_LIST)
const [onceAllSelectedTokenDetailedList, setAllTokenDetailedList] = useState(EMPTY_LIST)
@@ -497,7 +499,10 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) {
-
+
()((theme,
claimedTokenWrapper: {
position: 'absolute',
top: 80,
- right: 50,
+ right: 'clamp(10px, 5.6%, 30px)',
borderRadius: 9,
cursor: 'pointer',
},
@@ -181,7 +183,7 @@ const useStyles = makeStyles<{ claimed: boolean; outdated: boolean }>()((theme,
bottom: 8,
},
},
- NFTFallbackImageWrapper: {
+ fallbackImageWrapper: {
width: '100%',
height: 126,
background: theme.palette.common.white,
@@ -256,7 +258,7 @@ export function RedPacketNft({ payload }: RedPacketNftProps) {
})
}, [pluginID, payload.chainId, availability?.claimed_id, availability?.token_address])
- const { data: NFTDetailed, isLoading: loadingNFTDetailed } = useNonFungibleAsset<'all'>(
+ const { data: asset, isLoading: loadingAsset } = useNonFungibleAsset<'all'>(
NetworkPluginID.PLUGIN_EVM,
payload.contractAddress,
availability?.claimed_id,
@@ -316,31 +318,9 @@ export function RedPacketNft({ payload }: RedPacketNftProps) {
}
}, [claimCallback, retryAvailability])
- if (availabilityError)
- return (
-
- {t.go_wrong()}
-
-
- )
+ if (availabilityError) return
- if (!availability || loading)
- return (
-
-
- {t.loading()}
-
- )
+ if (!availability || loading) return
return (
@@ -352,9 +332,11 @@ export function RedPacketNft({ payload }: RedPacketNftProps) {
-
- {payload.message}
-
+
+
+ {payload.message}
+
+
- {loadingNFTDetailed ? null : (
+ {loadingAsset ? null : (
{NFTFallbackImage}
+ {NFTFallbackImage}
}
/>
)}
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketNftInPost.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketNftInPost.tsx
index ef355f8e6286..2de027f1ba89 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketNftInPost.tsx
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacketNftInPost.tsx
@@ -3,6 +3,8 @@ import { RedPacketRPC } from '../messages.js'
import type { RedPacketNftJSONPayload } from '@masknet/web3-providers/types'
import { DefaultWeb3ContextProvider } from '@masknet/web3-hooks-base'
import { RedPacketNft } from './RedPacketNft.js'
+import { ThemeProvider } from '@mui/material'
+import { MaskLightTheme } from '@masknet/theme'
export interface RedPacketNftInPostProps {
payload: RedPacketNftJSONPayload
@@ -19,7 +21,9 @@ export function RedPacketNftInPost({ payload }: RedPacketNftInPostProps) {
}, [payload])
return (
-
+
+
+
)
}
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedpacketMessagePanel.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedpacketMessagePanel.tsx
index 5876484b5303..95049ed82947 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/RedpacketMessagePanel.tsx
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedpacketMessagePanel.tsx
@@ -42,7 +42,7 @@ export function RedpacketMessagePanel(props: RedpacketMessagePanelProps) {
onChange(e.target.value)}
- inputProps={{ placeholder: t.best_wishes() }}
+ inputProps={{ maxLength: 100, placeholder: t.best_wishes() }}
value={message}
/>
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateCallback.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateCallback.tsx
index e614c7b07d8a..b69df2e009fc 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateCallback.tsx
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateCallback.tsx
@@ -163,7 +163,11 @@ export function useCreateCallback(
},
)
- const hash = await Web3.sendTransaction(tx, { paymentToken: gasOption?.gasCurrency, chainId })
+ const hash = await Web3.sendTransaction(tx, {
+ paymentToken: gasOption?.gasCurrency,
+ chainId,
+ gasOptionType: gasOption?.gasOptionType,
+ })
const receipt = await Web3.getTransactionReceipt(hash, { chainId })
if (receipt) {
const events = decodeEvents(redPacketContract.options.jsonInterface, receipt)
diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateNftRedpacketCallback.ts b/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateNftRedpacketCallback.ts
index f45148cad288..92dfb53da763 100644
--- a/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateNftRedpacketCallback.ts
+++ b/packages/plugins/RedPacket/src/SiteAdaptor/hooks/useCreateNftRedpacketCallback.ts
@@ -74,7 +74,10 @@ export function useCreateNftRedpacketCallback(
},
)
- const hash = await Web3.sendTransaction(tx, { paymentToken: gasOption?.gasCurrency })
+ const hash = await Web3.sendTransaction(tx, {
+ paymentToken: gasOption?.gasCurrency,
+ gasOptionType: gasOption?.gasOptionType,
+ })
const receipt = await Web3.getTransactionReceipt(hash)
if (receipt) {
const events = decodeEvents(nftRedPacketContract.options.jsonInterface, receipt)
diff --git a/packages/plugins/RedPacket/src/Worker/database.ts b/packages/plugins/RedPacket/src/Worker/database.ts
index 7b4a771ab24a..77ca2c13dff1 100644
--- a/packages/plugins/RedPacket/src/Worker/database.ts
+++ b/packages/plugins/RedPacket/src/Worker/database.ts
@@ -5,7 +5,6 @@ import type {
RedPacketNftRecordInDatabase,
} from '@masknet/web3-providers/types'
import type { Plugin } from '@masknet/plugin-infra'
-import { EMPTY_LIST } from '@masknet/shared-base'
export let RedPacketDatabase: Plugin.Worker.DatabaseStorage
@@ -14,7 +13,7 @@ export function setupDatabase(x: typeof RedPacketDatabase) {
}
export async function getAllRedpackets(ids: string[]) {
- const records: RedPacketRecord[] = EMPTY_LIST
+ const records: RedPacketRecord[] = []
for await (const record of RedPacketDatabase.iterate('red-packet')) {
if (ids.includes(record.value.id)) records.push(RedPacketRecordOutDB(record.value))
}
diff --git a/packages/plugins/RedPacket/src/base.ts b/packages/plugins/RedPacket/src/base.ts
index eb727982321e..8a018b22d54e 100644
--- a/packages/plugins/RedPacket/src/base.ts
+++ b/packages/plugins/RedPacket/src/base.ts
@@ -34,6 +34,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Aurora,
ChainId.Conflux,
ChainId.Astar,
+ ChainId.Scroll,
],
},
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] },
diff --git a/packages/plugins/Savings/src/SiteAdaptor/SavingsDialog.tsx b/packages/plugins/Savings/src/SiteAdaptor/SavingsDialog.tsx
index 715c9bd08c73..d9260101dd39 100644
--- a/packages/plugins/Savings/src/SiteAdaptor/SavingsDialog.tsx
+++ b/packages/plugins/Savings/src/SiteAdaptor/SavingsDialog.tsx
@@ -8,7 +8,6 @@ import {
Web3ContextProvider,
useFungibleTokens,
RevokeChainContextProvider,
- useNetworkContext,
ChainContextProvider,
useChainContext,
} from '@masknet/web3-hooks-base'
@@ -65,7 +64,6 @@ const chains = [ChainId.Mainnet]
export function SavingsDialog({ open, onClose }: SavingsDialogProps) {
const t = useI18N()
const { classes } = useStyles()
- const { pluginID } = useNetworkContext()
const { chainId } = useChainContext({ chainId: ChainId.Mainnet })
const [selectedProtocol, setSelectedProtocol] = useState(null)
diff --git a/packages/plugins/Savings/src/SiteAdaptor/SavingsForm.tsx b/packages/plugins/Savings/src/SiteAdaptor/SavingsForm.tsx
index f5ca7db466c4..b16ceb8e3e7e 100644
--- a/packages/plugins/Savings/src/SiteAdaptor/SavingsForm.tsx
+++ b/packages/plugins/Savings/src/SiteAdaptor/SavingsForm.tsx
@@ -147,7 +147,7 @@ export function SavingsFormDialog({ chainId, protocol, tab, onClose }: SavingsFo
)
} catch {
// do nothing
- console.log('Failed to estimate gas')
+ console.error('Failed to estimate gas')
}
}, [chainId, isDeposit, protocol, tokenAmount])
// #endregion
diff --git a/packages/plugins/ScamSniffer/src/constants.ts b/packages/plugins/ScamSniffer/src/constants.ts
index 33dd30df34b1..a84c05678c5f 100644
--- a/packages/plugins/ScamSniffer/src/constants.ts
+++ b/packages/plugins/ScamSniffer/src/constants.ts
@@ -1,5 +1,5 @@
import { PluginID } from '@masknet/shared-base'
export const PLUGIN_ID = PluginID.ScamSniffer
-export const PLUGIN_DESCRIPTION = 'Help people fight against crypto scammers'
+export const PLUGIN_DESCRIPTION = 'Help people fight against crypto scammers.'
export const PLUGIN_NAME = 'Scam Sniffer'
diff --git a/packages/plugins/SmartPay/src/SiteAdaptor/components/SmartPayContent.tsx b/packages/plugins/SmartPay/src/SiteAdaptor/components/SmartPayContent.tsx
index 31b6828078dc..6a507792166f 100644
--- a/packages/plugins/SmartPay/src/SiteAdaptor/components/SmartPayContent.tsx
+++ b/packages/plugins/SmartPay/src/SiteAdaptor/components/SmartPayContent.tsx
@@ -212,7 +212,7 @@ export const SmartPayContent = memo(() => {
const { data: maskToken } = useFungibleToken(NetworkPluginID.PLUGIN_EVM, maskAddress, undefined, { chainId })
const { PAYMASTER_MASK_CONTRACT_ADDRESS } = useSmartPayConstants(chainId)
- const { value: allowance = '0' } = useERC20TokenAllowance(maskAddress, PAYMASTER_MASK_CONTRACT_ADDRESS, {
+ const { data: allowance = '0' } = useERC20TokenAllowance(maskAddress, PAYMASTER_MASK_CONTRACT_ADDRESS, {
chainId,
})
diff --git a/packages/plugins/Snapshot/src/SiteAdaptor/ProfileView.tsx b/packages/plugins/Snapshot/src/SiteAdaptor/ProfileView.tsx
index 1fe5d4c97096..39a0b6a09c9d 100644
--- a/packages/plugins/Snapshot/src/SiteAdaptor/ProfileView.tsx
+++ b/packages/plugins/Snapshot/src/SiteAdaptor/ProfileView.tsx
@@ -1,28 +1,20 @@
import { useMemo, useState, useTransition } from 'react'
-import { useAsyncFn } from 'react-use'
-import {
- ActionButton,
- LoadingBase,
- MaskDarkTheme,
- MaskLightTheme,
- MaskTabList,
- makeStyles,
- useTabs,
-} from '@masknet/theme'
+import { LoadingBase, MaskDarkTheme, MaskLightTheme, MaskTabList, makeStyles, useTabs } from '@masknet/theme'
import { CardContent, Stack, Tab, ThemeProvider, Typography, useTheme } from '@mui/material'
-import { ProfileCard, type ProfileCardProps } from './ProfileCard.js'
+import { PluginCardFrameMini, PluginEnableBoundary } from '@masknet/shared'
import type { DAOResult } from '@masknet/web3-shared-base'
import type { ChainId } from '@masknet/web3-shared-evm'
import { TabContext } from '@mui/lab'
import { Icons } from '@masknet/icons'
import { PluginID } from '@masknet/shared-base'
-import { useIsMinimalMode, useSiteAdaptorContext } from '@masknet/plugin-infra/content-script'
+import { useIsMinimalMode } from '@masknet/plugin-infra/content-script'
import { PluginDescriptor } from './PluginDescriptor.js'
import { ProfileSpaceHeader } from './ProfileSpaceHeader.js'
import { ContentTabs } from '../types.js'
import { useProposalList } from './hooks/useProposalList.js'
-import { ProfileProposalList } from './ProfileProposalList.js'
import { useSpace } from './hooks/useSpace.js'
+import { ProfileCard, type ProfileCardProps } from './ProfileCard.js'
+import { ProfileProposalList } from './ProfileProposalList.js'
import { useI18N } from '../locales/index.js'
const useStyles = makeStyles()((theme) => ({
@@ -38,29 +30,13 @@ const useStyles = makeStyles()((theme) => ({
paddingBottom: 0,
borderBottom: `1px solid ${theme.palette.maskColor.line}`,
},
- minimalContent: {
- height: 148,
- paddingTop: 0,
- paddingBottom: 0,
- '&:last-child': {
- paddingBottom: 16,
- },
- },
- minimalText: {
- color: theme.palette.maskColor.dark,
- whiteSpace: 'nowrap',
- },
tabListRoot: {
marginTop: '10px !important',
flexGrow: 0,
},
-
- enableButton: {
- display: 'inline-flex',
- justifyContent: 'center',
- borderRadius: 20,
- width: 254,
- height: 40,
+ iconSnapshot: {
+ marginRight: 6,
+ marginTop: 2,
},
}))
@@ -93,10 +69,6 @@ export function ProfileView(props: ProfileViewProps) {
currentSpace.spaceId,
currentSpace.strategyName ?? space?.symbol,
)
- const { setPluginMinimalModeEnabled } = useSiteAdaptorContext()
- const [{ loading: loadingModeEnabled }, onEnablePlugin] = useAsyncFn(async () => {
- await setPluginMinimalModeEnabled?.(PluginID.Snapshot, false)
- }, [setPluginMinimalModeEnabled])
const [isPending, startTransition] = useTransition()
const filteredProposalList = useMemo(() => {
@@ -108,31 +80,15 @@ export function ProfileView(props: ProfileViewProps) {
if (isMinimalMode) {
return (
-
-
-
+ }>
+
+
-
-
-
-
- {t.enable_plugin_boundary_description()}
-
-
- }
- className={classes.enableButton}
- color="primary"
- onClick={onEnablePlugin}
- sx={{ mt: 6 }}>
- {t.enable_plugin_boundary()}
-
-
-
-
-
-
+
+
+
)
}
diff --git a/packages/plugins/Snapshot/src/SiteAdaptor/Snapshot.tsx b/packages/plugins/Snapshot/src/SiteAdaptor/Snapshot.tsx
index 007e6f71be67..5d460f7d1390 100644
--- a/packages/plugins/Snapshot/src/SiteAdaptor/Snapshot.tsx
+++ b/packages/plugins/Snapshot/src/SiteAdaptor/Snapshot.tsx
@@ -1,17 +1,24 @@
-import { useContext } from 'react'
import Color from 'color'
-import { Box, Tab, Avatar, Typography, Chip } from '@mui/material'
-import { makeStyles, MaskTabList, ShadowRootTooltip, TextOverflowTooltip, useTabs } from '@masknet/theme'
-import { SnapshotContext } from '../context.js'
-import { useProposal } from './hooks/useProposal.js'
-import { ProposalTab } from './ProposalTab.js'
-import { ProgressTab } from './ProgressTab.js'
+import { useContext } from 'react'
import { ChainBoundary } from '@masknet/shared'
-import { useChainContext } from '@masknet/web3-hooks-base'
import { NetworkPluginID } from '@masknet/shared-base'
+import {
+ MaskLightTheme,
+ MaskTabList,
+ ShadowRootTooltip,
+ TextOverflowTooltip,
+ makeStyles,
+ useTabs,
+} from '@masknet/theme'
+import { useChainContext } from '@masknet/web3-hooks-base'
import { resolveIPFS_URL } from '@masknet/web3-shared-base'
import { TabContext, TabPanel } from '@mui/lab'
+import { Avatar, Box, Chip, Tab, ThemeProvider, Typography } from '@mui/material'
+import { SnapshotContext } from '../context.js'
import { useI18N } from '../locales/index.js'
+import { ProgressTab } from './ProgressTab.js'
+import { ProposalTab } from './ProposalTab.js'
+import { useProposal } from './hooks/useProposal.js'
const useStyles = makeStyles()((theme) => {
return {
@@ -101,57 +108,63 @@ export function Snapshot() {
-
-
-
+
+
+
+ {proposal.space.name}
+
+ }
+ placement="top"
+ classes={{ tooltip: classes.tooltip, arrow: classes.arrow }}
+ arrow>
+
+ {proposal.space.name}
+
+
+
+
+ by
+
+
+ {proposal.space.id}
+
+
+
+
+
- {proposal.space.name}
-
- }
+ title={{proposal.title}}
placement="top"
classes={{ tooltip: classes.tooltip, arrow: classes.arrow }}
arrow>
-
- {proposal.space.name}
-
-
-
- by
-
-
- {proposal.space.id}
+ fontWeight="700"
+ color={theme.palette.maskColor.publicSecond}
+ sx={{ width: 300, whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }}>
+ {proposal.title}
-
+
-
- {proposal.title}}
- placement="top"
- classes={{ tooltip: classes.tooltip, arrow: classes.arrow }}
- arrow>
-
- {proposal.title}
-
-
-
+
}>
- {votes.map(function voteItemIter(v) {
+ {votes?.map(function voteItemIter(v) {
const isAverageWeight = v.choices?.every((c) => c.weight === 1)
const fullChoiceText =
v.totalWeight && v.choices
diff --git a/packages/plugins/Snapshot/src/locales/en-US.json b/packages/plugins/Snapshot/src/locales/en-US.json
index 1bc57789a6ab..375df0a2a7ed 100644
--- a/packages/plugins/Snapshot/src/locales/en-US.json
+++ b/packages/plugins/Snapshot/src/locales/en-US.json
@@ -35,7 +35,5 @@
"plugin_snapshot_vote_confirm_dialog_warning": "This action cannot be undone.",
"plugin_snapshot_current_result_title": "Current results",
"plugin_snapshot_download_report": "Download report",
- "enable_plugin_boundary": "Enable plugin",
- "loading": "Loading",
- "enable_plugin_boundary_description": "This function has been turned off in the App settings. Enable plug-ins to fully access."
+ "loading": "Loading"
}
diff --git a/packages/plugins/Snapshot/src/locales/qya-AA.json b/packages/plugins/Snapshot/src/locales/qya-AA.json
index bdf4bb2857be..e4ae4c54ce22 100644
--- a/packages/plugins/Snapshot/src/locales/qya-AA.json
+++ b/packages/plugins/Snapshot/src/locales/qya-AA.json
@@ -35,7 +35,5 @@
"plugin_snapshot_vote_confirm_dialog_warning": "crwdns21453:0crwdne21453:0",
"plugin_snapshot_current_result_title": "crwdns21455:0crwdne21455:0",
"plugin_snapshot_download_report": "crwdns21457:0crwdne21457:0",
- "enable_plugin_boundary": "crwdns21459:0crwdne21459:0",
- "loading": "crwdns21461:0crwdne21461:0",
- "enable_plugin_boundary_description": "crwdns21463:0crwdne21463:0"
+ "loading": "crwdns21461:0crwdne21461:0"
}
diff --git a/packages/plugins/Snapshot/src/locales/zh-CN.json b/packages/plugins/Snapshot/src/locales/zh-CN.json
index 15b57515ca99..b1f0b26bbd39 100644
--- a/packages/plugins/Snapshot/src/locales/zh-CN.json
+++ b/packages/plugins/Snapshot/src/locales/zh-CN.json
@@ -35,7 +35,5 @@
"plugin_snapshot_vote_confirm_dialog_warning": "此操作不可撤销。",
"plugin_snapshot_current_result_title": "当前结果",
"plugin_snapshot_download_report": "下载报告",
- "enable_plugin_boundary": "开启插件",
- "loading": "加载中",
- "enable_plugin_boundary_description": "此功能已在应用设置中被关闭。启用插件以完全访问。"
+ "loading": "加载中"
}
diff --git a/packages/plugins/SwitchLogo/package.json b/packages/plugins/SwitchLogo/package.json
index 658cfcf69c75..f7cdba567a69 100644
--- a/packages/plugins/SwitchLogo/package.json
+++ b/packages/plugins/SwitchLogo/package.json
@@ -19,6 +19,7 @@
"@masknet/shared-base": "workspace:^",
"@masknet/shared-base-ui": "workspace:^",
"@masknet/theme": "workspace:^",
+ "@masknet/web3-telemetry": "workspace:^",
"react-use": "^17.4.0",
"use-subscription": "^1.8.0"
}
diff --git a/packages/plugins/SwitchLogo/src/SiteAdaptor/SwitchLogoButton.tsx b/packages/plugins/SwitchLogo/src/SiteAdaptor/SwitchLogoButton.tsx
index 3fa9194ad29a..203c3dbd53b0 100644
--- a/packages/plugins/SwitchLogo/src/SiteAdaptor/SwitchLogoButton.tsx
+++ b/packages/plugins/SwitchLogo/src/SiteAdaptor/SwitchLogoButton.tsx
@@ -1,11 +1,11 @@
/* cspell: disable */
import { useCallback, useLayoutEffect } from 'react'
-import { CrossIsolationMessages, PluginID, SwitchLogoType, switchLogoSettings } from '@masknet/shared-base'
-import { useValueRef } from '@masknet/shared-base-ui'
-import { useIsMinimalMode, useLastRecognizedIdentity } from '@masknet/plugin-infra/content-script'
-import { makeStyles } from '@masknet/theme'
import { LiveSelector } from '@dimensiondev/holoflows-kit'
import { Icons } from '@masknet/icons'
+import { makeStyles } from '@masknet/theme'
+import { useValueRef } from '@masknet/shared-base-ui'
+import { CrossIsolationMessages, PluginID, SwitchLogoType, switchLogoSettings } from '@masknet/shared-base'
+import { useIsMinimalMode, useLastRecognizedIdentity } from '@masknet/plugin-infra/content-script'
const BlueBirdHTML = `