Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/mask/shared-ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"reload": "Reload",
"load": "Load",
"load_all": "Load All",
"supported_by": "Supported by",
"no_data": "No Data",
"tip": "Tip",
"tags": "Tags",
Expand Down Expand Up @@ -258,7 +257,6 @@
"relative_time_seconds_ago": "{{seconds}} seconds ago",
"relative_time_years_ago": "{{years}} years ago",
"plugin_chain_not_supported": "Not supported on {{chain}} yet.",
"plugin_powered_by": "Powered by",
"plugin_wallet_snackbar_wait_for_confirming": "Confirm this transaction in your wallet",
"plugin_wallet_snackbar_hash": "Transaction Submitted",
"plugin_wallet_snackbar_confirmed": "Transaction Confirmed",
Expand Down Expand Up @@ -777,7 +775,6 @@
"plugin_find_truman_buy_nft_tip": "At least {{count}} copy of this NFT is required.",
"plugin_find_truman_connect_wallet_tip": "Please connect to a wallet.",
"plugin_find_truman_no_participation_tip": "You have not participated in any vote yet.",
"plugin_dhedge_dhedge": "dHEDGE",
"plugin_dhedge_managed_by": "Managed by <manager>{{managerName}}</manager>",
"plugin_dhedge_manager_share": "Holds <share>{{managerShare}}%</share> of the pool",
"plugin_dhedge_manager_share_more_than_50": "Holds more than 50% of the pool",
Expand Down Expand Up @@ -884,7 +881,6 @@
"plugin_unlockprotocol_submit_post": "Submit Post",
"plugin_unlockprotocol_title": "Unlock Protocol",
"plugin_unlockprotocol_server_error": "Some Server error occured, Please try again later.",
"plugin_furucombo_name": "Furucombo",
"plugin_furucombo_tab_pool": "Pool",
"plugin_furucombo_tab_investments": "All investments",
"plugin_furucombo_liquidity": "Liquidity",
Expand Down
4 changes: 0 additions & 4 deletions packages/mask/shared-ui/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"reload": "다시 로드",
"load": "로드",
"load_all": "모두 로드하기",
"supported_by": "Supported by",
"no_data": "데이터 없음",
"tip": "팁",
"tags": "태그",
Expand Down Expand Up @@ -215,7 +214,6 @@
"relative_time_months_ago": "{{months}} 월 전",
"relative_time_seconds_ago": "{{seconds}} 초 전",
"relative_time_years_ago": "{{years}} 년 전",
"plugin_powered_by": "기술 지원",
"plugin_wallet_collections": "컬렉션",
"plugin_wallet_select_a_token": "토큰을 선택하기",
"plugin_wallet_select_a_nft_contract": "NFT 컨트렉트를 선택하세요.",
Expand Down Expand Up @@ -628,7 +626,6 @@
"plugin_snapshot_current_result_title": "현재 결과",
"plugin_snapshot_download_report": "다운로드 리포트",
"plugin_find_truman_no_participation_tip": "아직 아무 투표에 참여하지 않았습니다.",
"plugin_dhedge_dhedge": "dHEDGE",
"plugin_dhedge_managed_by": "관리자: <manager>{{managerName}}</manager>",
"plugin_dhedge_manager_share": "풀의 <share>{{managerShare}}%</share> 홀드합니다.",
"plugin_dhedge_manager_share_more_than_50": "이 풀의 50% 이상을 보유합니다",
Expand Down Expand Up @@ -733,7 +730,6 @@
"plugin_unlockprotocol_submit_post": "포스트 제출",
"plugin_unlockprotocol_title": "언락 프로토콜",
"plugin_unlockprotocol_server_error": "서버 오류 발생했습니다. 다시 시도 하세요.",
"plugin_furucombo_name": "Furucombo",
"plugin_furucombo_tab_pool": "풀",
"plugin_furucombo_tab_investments": "전체 투자",
"plugin_furucombo_liquidity": "유동성",
Expand Down
4 changes: 0 additions & 4 deletions packages/mask/shared-ui/locales/qya-AA.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"reload": "crwdns10087:0crwdne10087:0",
"load": "crwdns10089:0crwdne10089:0",
"load_all": "crwdns10093:0crwdne10093:0",
"supported_by": "crwdns10095:0crwdne10095:0",
"no_data": "crwdns10097:0crwdne10097:0",
"tip": "crwdns10105:0crwdne10105:0",
"tags": "crwdns10107:0crwdne10107:0",
Expand Down Expand Up @@ -258,7 +257,6 @@
"relative_time_seconds_ago": "crwdns4583:0{{seconds}}crwdne4583:0",
"relative_time_years_ago": "crwdns4585:0{{years}}crwdne4585:0",
"plugin_chain_not_supported": "crwdns10689:0{{chain}}crwdne10689:0",
"plugin_powered_by": "crwdns4587:0crwdne4587:0",
"plugin_wallet_snackbar_wait_for_confirming": "crwdns10629:0crwdne10629:0",
"plugin_wallet_snackbar_hash": "crwdns10631:0crwdne10631:0",
"plugin_wallet_snackbar_confirmed": "crwdns10633:0crwdne10633:0",
Expand Down Expand Up @@ -777,7 +775,6 @@
"plugin_find_truman_buy_nft_tip": "crwdns10407:0{{count}}crwdne10407:0",
"plugin_find_truman_connect_wallet_tip": "crwdns10411:0crwdne10411:0",
"plugin_find_truman_no_participation_tip": "crwdns10413:0crwdne10413:0",
"plugin_dhedge_dhedge": "crwdns10251:0crwdne10251:0",
"plugin_dhedge_managed_by": "crwdns5393:0{{managerName}}crwdne5393:0",
"plugin_dhedge_manager_share": "crwdns5395:0{{managerShare}}crwdne5395:0",
"plugin_dhedge_manager_share_more_than_50": "crwdns5397:0crwdne5397:0",
Expand Down Expand Up @@ -884,7 +881,6 @@
"plugin_unlockprotocol_submit_post": "crwdns7987:0crwdne7987:0",
"plugin_unlockprotocol_title": "crwdns7989:0crwdne7989:0",
"plugin_unlockprotocol_server_error": "crwdns7991:0crwdne7991:0",
"plugin_furucombo_name": "crwdns10263:0crwdne10263:0",
"plugin_furucombo_tab_pool": "crwdns9113:0crwdne9113:0",
"plugin_furucombo_tab_investments": "crwdns9115:0crwdne9115:0",
"plugin_furucombo_liquidity": "crwdns9117:0crwdne9117:0",
Expand Down
2 changes: 0 additions & 2 deletions packages/mask/shared-ui/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"reload": "重新加载",
"load": "加载",
"load_all": "加载全部",
"supported_by": "技术支持:",
"no_data": "暂无数据",
"tip": "小费",
"tags": "标签",
Expand Down Expand Up @@ -256,7 +255,6 @@
"relative_time_seconds_ago": "{{seconds}} 秒前",
"relative_time_years_ago": "{{years}} 年前",
"plugin_chain_not_supported": "尚未在 {{chain}} 上支持。",
"plugin_powered_by": "技术支持:",
"plugin_wallet_snackbar_wait_for_confirming": "请在您的钱包中确认这笔交易",
"plugin_wallet_snackbar_hash": "交易已提交",
"plugin_wallet_snackbar_confirmed": "交易已确认",
Expand Down
1 change: 0 additions & 1 deletion packages/mask/shared-ui/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
"relative_time_months_ago": "{{months}} 月前",
"relative_time_seconds_ago": "{{seconds}} 秒前",
"relative_time_years_ago": "{{years}} 年前",
"plugin_powered_by": "提供者為 ",
"plugin_wallet_guiding_step_1": "1. 選擇網路",
"plugin_wallet_guiding_step_2": "2. 選擇錢包",
"plugin_wallet_collections": "收藏",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useActivatedPluginsSNSAdaptor, Plugin } from '@masknet/plugin-infra'
import { useActivatedPluginsSNSAdaptor, Plugin, usePluginI18NField } from '@masknet/plugin-infra'
import { makeStyles } from '@masknet/theme'
import type { TypedMessage } from '@masknet/shared-base'
import { Box, Chip } from '@mui/material'
import { usePluginI18NField } from '../../plugin-infra/I18NFieldRender'
import { ShadowRootTooltip, useI18N } from '../../utils'

const useStyles = makeStyles()((theme) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import {
useActivatedPluginSNSAdaptor_Web3Supported,
useActivatedPluginsSNSAdaptor,
Plugin,
PluginI18NFieldRender,
usePluginI18NField,
} from '@masknet/plugin-infra'
import { ErrorBoundary } from '@masknet/shared'
import { Result } from 'ts-results'
import { PluginI18NFieldRender, usePluginI18NField } from '../../plugin-infra/I18NFieldRender'
import { RedPacketPluginID } from '../../plugins/RedPacket/constants'
import { ITO_PluginID } from '../../plugins/ITO/constants'
import { ClickableChip } from '../shared/SelectRecipients/ClickableChip'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AdditionalContent } from '../AdditionalPostContent'
import { DecryptFailedReason } from '../../../utils/constants'
import type { ProfileIdentifier } from '@masknet/shared-base'
import { wrapAuthorDifferentMessage } from './authorDifferentMessage'
import MaskPluginWrapper from '../../../plugins/MaskPluginWrapper'
import MaskPostExtraInfoWrapper from '../../../plugins/MaskPluginWrapper'

export interface DecryptPostFailedProps {
error: Error
Expand All @@ -18,7 +18,7 @@ export const DecryptPostFailed = memo(function DecryptPostFailed(props: DecryptP
const { t } = useI18N()

if (error?.message === DecryptFailedReason.MyCryptoKeyNotFound) {
return <MaskPluginWrapper pluginName="" />
return <MaskPostExtraInfoWrapper title="" />
}
return (
<AdditionalContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import {
useDisabledPluginSuggestionFromPost,
PossiblePluginSuggestionUI,
} from '../DisabledPluginSuggestion'
import { MaskPostExtraPluginWrapper } from '../../../plugins/MaskPluginWrapper'

const PluginRenderer = createInjectHooksRenderer(
useActivatedPluginsSNSAdaptor.visibility.useNotMinimalMode,
(x) => x.DecryptedInspector,
MaskPostExtraPluginWrapper,
)
function PluginRendererWithSuggestion(props: MetadataRendererProps) {
const a = useDisabledPluginSuggestionFromMeta(props.metadata || new Map())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
usePostInfoDetails,
Option,
Plugin,
usePluginI18NField,
} from '@masknet/plugin-infra'
import { extractTextFromTypedMessage } from '@masknet/shared-base'
import { Switch } from '@mui/material'
import Services from '../../extension/service'
import MaskPluginWrapper from '../../plugins/MaskPluginWrapper'
import MaskPostExtraInfoWrapper from '../../plugins/MaskPluginWrapper'
import { useI18N } from '../../utils'

function useDisabledPlugins() {
Expand Down Expand Up @@ -51,14 +52,15 @@ export function PossiblePluginSuggestionPostInspector() {
}
export function PossiblePluginSuggestionUI(props: { plugins: Plugin.DeferredDefinition[] }) {
const { t } = useI18N()
const t2 = usePluginI18NField()
const { plugins } = props
if (!plugins.length) return null
return (
<>
{plugins.map((x) => (
<MaskPluginWrapper
<MaskPostExtraInfoWrapper
key={x.ID}
pluginName={t('plugin_not_enabled', { plugin: x.name.fallback })}
title={t('plugin_not_enabled', { plugin: t2(x.ID, x.name) })}
action={
<Switch
sx={{ marginRight: '-12px' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ import { usePostInfoDetails } from '../DataSource/usePostInfo'
import { decodePublicKeyUI } from '../../social-network/utils/text-payload-ui'
import { createInjectHooksRenderer, useActivatedPluginsSNSAdaptor } from '@masknet/plugin-infra'
import { PossiblePluginSuggestionPostInspector } from './DisabledPluginSuggestion'
import { MaskPostExtraPluginWrapper } from '../../plugins/MaskPluginWrapper'

const PluginHooksRenderer = createInjectHooksRenderer(
useActivatedPluginsSNSAdaptor.visibility.useNotMinimalMode,
(plugin) => plugin.PostInspector,
MaskPostExtraPluginWrapper,
)

export interface PostInspectorProps {
Expand Down
33 changes: 4 additions & 29 deletions packages/mask/src/plugins/Collectible/SNSAdaptor/Collectible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { CollectibleState } from '../hooks/useCollectibleState'
import { CollectibleCard } from './CollectibleCard'
import { CollectibleProviderIcon } from './CollectibleProviderIcon'
import { CollectibleTab } from '../types'
import { MaskTextIcon } from '../../../resources/MaskIcon'
import { resolveAssetLinkOnCurrentProvider, resolveCollectibleProviderName } from '../pipes'
import { ActionBar } from './ActionBar'
import { NonFungibleAssetProvider, useChainId } from '@masknet/web3-shared-evm'
Expand All @@ -35,6 +34,7 @@ const useStyles = makeStyles()((theme) => {
width: '100%',
border: `solid 1px ${theme.palette.divider}`,
padding: 0,
marginBottom: 12,
},
content: {
width: '100%',
Expand Down Expand Up @@ -87,17 +87,6 @@ const useStyles = makeStyles()((theme) => {
fontWeight: 300,
},
},
footnote: {
fontSize: 10,
marginRight: theme.spacing(1),
},
footLink: {
cursor: 'pointer',
marginRight: theme.spacing(0.5),
'&:last-child': {
marginRight: 0,
},
},
footMenu: {
color: theme.palette.text.secondary,
fontSize: 10,
Expand All @@ -107,10 +96,6 @@ const useStyles = makeStyles()((theme) => {
footName: {
marginLeft: theme.spacing(0.5),
},
mask: {
width: 40,
height: 10,
},
countdown: {
fontSize: 12,
borderRadius: 8,
Expand Down Expand Up @@ -200,7 +185,7 @@ export function Collectible(props: CollectibleProps) {
const endDate = _asset.end_time
return (
<>
<CollectibleCard classes={classes}>
<CollectibleCard classes={{ root: classes.root }}>
<CardHeader
avatar={
<LinkingAvatar
Expand Down Expand Up @@ -287,18 +272,8 @@ export function Collectible(props: CollectibleProps) {
</Paper>
</CardContent>
<CardActions className={classes.footer}>
<Typography className={classes.footnote} variant="subtitle2">
<span>{t('plugin_powered_by')} </span>
<Link
className={classes.footLink}
color="textSecondary"
target="_blank"
rel="noopener noreferrer"
title="Mask"
href="https://mask.io">
<MaskTextIcon classes={{ root: classes.mask }} viewBox="0 0 80 20" />
</Link>
</Typography>
{/* flex to make foot menu right */}
<div />
<div className={classes.footMenu}>
<FootnoteMenu
options={collectibleProviderOptions.map((x) => ({
Expand Down
21 changes: 6 additions & 15 deletions packages/mask/src/plugins/Collectible/SNSAdaptor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { uniq, first } from 'lodash-unified'
import { Plugin, usePostInfoDetails } from '@masknet/plugin-infra'
import MaskPluginWrapper from '../../MaskPluginWrapper'
import { Plugin, usePostInfoDetails, usePluginWrapper } from '@masknet/plugin-infra'
import { PostInspector } from './PostInspector'
import { base } from '../base'
import type { CollectibleJSON_Payload } from '../types'
import { checkUrl, getAssetInfoFromURL, getRelevantUrl } from '../utils'
import { PLUGIN_NAME, PLUGIN_ID } from '../constants'
import { PLUGIN_ID } from '../constants'
import { getTypedMessageContent } from '../../../protocols/typed-message'
import { NFTPage } from './NFTPage'
import { AddressName, AddressNameType } from '@masknet/web3-shared-evm'
Expand All @@ -17,13 +15,14 @@ const sns: Plugin.SNSAdaptor.Definition = {
const links = usePostInfoDetails.mentionedLinks()
const link = uniq(links).find(checkUrl)
const asset = getAssetInfoFromURL(link)

return asset ? renderPostInspector(asset) : null
usePluginWrapper(!!asset)
return asset ? <PostInspector payload={asset} /> : null
},
DecryptedInspector: function Component(props) {
const collectibleUrl = getRelevantUrl(getTypedMessageContent(props.message))
const asset = getAssetInfoFromURL(collectibleUrl)
return asset ? renderPostInspector(asset) : null
usePluginWrapper(!!asset)
return asset ? <PostInspector payload={asset} /> : null
},
ProfileTabs: [
{
Expand Down Expand Up @@ -69,11 +68,3 @@ const sns: Plugin.SNSAdaptor.Definition = {
}

export default sns

function renderPostInspector(payload: CollectibleJSON_Payload) {
return (
<MaskPluginWrapper pluginName={PLUGIN_NAME}>
<PostInspector payload={payload} />
</MaskPluginWrapper>
)
}
Loading