diff --git a/packages/icons/general/Plugin.tsx b/packages/icons/general/Plugin.tsx new file mode 100644 index 000000000000..98c5b861bc0e --- /dev/null +++ b/packages/icons/general/Plugin.tsx @@ -0,0 +1,12 @@ +import { createIcon } from '../utils' + +export const PluginIcon = createIcon( + 'PluginIcon', + + + , + '0 0 19 18', +) diff --git a/packages/icons/general/Provider.tsx b/packages/icons/general/Provider.tsx new file mode 100644 index 000000000000..3524f1decfe2 --- /dev/null +++ b/packages/icons/general/Provider.tsx @@ -0,0 +1,14 @@ +import { createIcon } from '../utils' + +export const ProviderByIcon = createIcon( + 'ProviderByIcon', + + + , + '0 0 17 16', +) diff --git a/packages/icons/general/index.ts b/packages/icons/general/index.ts index d30eda75b638..24df574b958f 100644 --- a/packages/icons/general/index.ts +++ b/packages/icons/general/index.ts @@ -116,6 +116,8 @@ export * from './MindsRound' export * from './CircleLoading' export * from './AddUser' export * from './PopupRestore' +export * from './Provider' +export * from './Plugin' export * from './Direct' export * from './SearchEmpty' export * from './WarningTriangle' diff --git a/packages/icons/plugins/CyberConnect.tsx b/packages/icons/plugins/CyberConnect.tsx index d2dada033e36..6aafbe3351fe 100644 --- a/packages/icons/plugins/CyberConnect.tsx +++ b/packages/icons/plugins/CyberConnect.tsx @@ -15,7 +15,7 @@ export const CyberConnectIcon: typeof SvgIcon = createPaletteAwareIcon( fillRule="evenodd" clipRule="evenodd" d="M20.8194 14.1385L29.6618 23.2918C29.768 23.4001 29.8525 23.529 29.9105 23.6712C29.9685 23.8133 29.9989 23.9659 30 24.1202C30.001 24.2745 29.9727 24.4275 29.9165 24.5705C29.8604 24.7135 29.7777 24.8436 29.673 24.9535L29.0242 25.6228C28.8418 25.8206 28.601 25.9497 28.3397 25.9897C28.1672 26.0136 27.9917 25.9958 27.8269 25.9377C27.6621 25.8797 27.5126 25.7829 27.3899 25.6551L16.5922 14.4778C16.4045 14.2838 16.2556 14.0534 16.1539 13.7997C16.0523 13.5461 16 13.2742 16 12.9996C16 12.725 16.0523 12.4531 16.1539 12.1994C16.2556 11.9458 16.4045 11.7153 16.5922 11.5213L27.3899 0.344062C27.4951 0.234991 27.62 0.148459 27.7576 0.0894208C27.8951 0.0303825 28.0425 0 28.1914 0C28.3403 0 28.4877 0.0303825 28.6253 0.0894208C28.7628 0.148459 28.8878 0.234991 28.993 0.344062L29.6618 1.04798C29.7672 1.15687 29.8508 1.2862 29.9078 1.42856C29.9648 1.57093 29.9942 1.72354 29.9942 1.87767C29.9942 2.03179 29.9648 2.1844 29.9078 2.32677C29.8508 2.46914 29.7672 2.59848 29.6618 2.70738L20.8194 11.8629C20.5294 12.1655 20.3667 12.5745 20.3667 13.0007C20.3667 13.427 20.5294 13.8359 20.8194 14.1385ZM9.18017 11.8726L0.341223 2.71698C0.233969 2.60853 0.148579 2.47911 0.0900066 2.33622C0.0314345 2.19333 0.000846678 2.03982 1.73677e-05 1.88459C-0.000811943 1.72936 0.0281358 1.5755 0.0851776 1.43194C0.142219 1.28839 0.226225 1.158 0.332313 1.04833L0.978629 0.376712C1.16268 0.180155 1.40373 0.0512975 1.66506 0.00975571C1.83749 -0.0133774 2.01275 0.00476068 2.17734 0.0627778C2.34194 0.120795 2.49149 0.217133 2.61448 0.344398L13.408 11.5218C13.5957 11.7158 13.7445 11.9463 13.8461 12.1999C13.9477 12.4536 14 12.7255 14 13.0001C14 13.2747 13.9477 13.5466 13.8461 13.8002C13.7445 14.0539 13.5957 14.2843 13.408 14.4783L2.61448 25.6557C2.50913 25.7649 2.38405 25.8515 2.24639 25.9105C2.10872 25.9696 1.96117 26 1.81215 26C1.66314 26 1.51558 25.9696 1.37792 25.9105C1.24025 25.8515 1.11517 25.7649 1.00983 25.6557L0.341223 24.9634C0.235829 24.8543 0.152224 24.7247 0.0951825 24.5822C0.038141 24.4396 0.00878436 24.2868 0.00878436 24.1325C0.00878436 23.9782 0.038141 23.8254 0.0951825 23.6828C0.152224 23.5402 0.235829 23.4107 0.341223 23.3016L9.18017 14.1483C9.47006 13.8457 9.63272 13.4367 9.63272 13.0104C9.63272 12.5842 9.47006 12.1752 9.18017 11.8726Z" - fill="white" + fill="black" />, undefined, '-8 -10 44 44', diff --git a/packages/icons/plugins/MarketsClaim.tsx b/packages/icons/plugins/MarketsClaim.tsx index f94a2736ade3..1e82b939ee43 100644 --- a/packages/icons/plugins/MarketsClaim.tsx +++ b/packages/icons/plugins/MarketsClaim.tsx @@ -1,7 +1,6 @@ import { createIcon } from '../utils' -import type { SvgIcon } from '@mui/material' -export const MarketsClaimIcon: typeof SvgIcon = createIcon( +export const MarketsClaimIcon = createIcon( 'Markets', <> diff --git a/packages/icons/plugins/connect.tsx b/packages/icons/plugins/connect.tsx new file mode 100644 index 000000000000..291662e4980f --- /dev/null +++ b/packages/icons/plugins/connect.tsx @@ -0,0 +1,31 @@ +import { createIcon } from '@masknet/icons' +export const PluginWalletConnectIcon = createIcon( + 'PluginWalletConnectIcon', + + + + + + , + '0 0 17 16', +) diff --git a/packages/icons/plugins/index.ts b/packages/icons/plugins/index.ts index 996563638215..042cbb8b08a1 100644 --- a/packages/icons/plugins/index.ts +++ b/packages/icons/plugins/index.ts @@ -24,3 +24,5 @@ export * from './DHEDGEIcon' export * from './PoolTogetherIcon' export * from './SecurityChecker' export * from './ArtBlocks' +export * from './connect' +export * from './shared' diff --git a/packages/icons/plugins/shared.tsx b/packages/icons/plugins/shared.tsx new file mode 100644 index 000000000000..fa880e3d3136 --- /dev/null +++ b/packages/icons/plugins/shared.tsx @@ -0,0 +1,20 @@ +import { createIcon } from '@masknet/icons' +export const SharedIcon = createIcon( + 'SharedIcon', + + + + + + + + + + , + '0 0 19 18', +) diff --git a/packages/mask/shared-ui/locales/en-US.json b/packages/mask/shared-ui/locales/en-US.json index c97bf81ed945..5fee71e29b8f 100644 --- a/packages/mask/shared-ui/locales/en-US.json +++ b/packages/mask/shared-ui/locales/en-US.json @@ -65,7 +65,6 @@ "compose_encrypt_visible_to_private": "Private", "compose_encrypt_visible_to_private_sub": "Just Me", "compose_shared_friends": "1 friend", - "compose_shared_friends_other": "{{count}} friends", "compose_encrypt_visible_to_share": "Share with", "compose_encrypt_visible_to_share_sub": "Just Selected Contacts", "compose_encrypt_share_dialog_empty": "No encrypted friends, you can try searching.", @@ -133,10 +132,6 @@ "user_guide_tip_2": "Connect and switch your wallet.", "user_guide_tip_3": "Browse the Web 3 footprints of your Twitter friends, enjoy the freedom of Web 3.", "user_guide_tip_4": "Click here to have a quick start.", - "create_persona": "Create persona", - "connect_persona": "Connect persona", - "please_create_persona": "Please create persona", - "please_connect_persona": "Please connect persona", "mask_network": "Mask Network", "import": "Import", "no_search_result": "No result", @@ -197,7 +192,6 @@ "wallet_search_no_result": "No results.", "wallet_confirm_with_password": "Confirm with password", "wallet_airdrop_nft_unclaimed_title": "NFT Airdrop Unclaimed:", - "plugin_not_enabled": "{{plugin}} (Not Enabled)", "plugin_external_unknown_plugin": "New unknown Mask plugins found. Do you want to load them?", "plugin_external_loader_search_holder": "Search for an external plugin", "plugin_external_loader_search_button": "Search for plugin", @@ -298,7 +292,7 @@ "plugin_wallet_nft_approving_all": "Unlocking {{symbol}}...", "plugin_wallet_approve_all_nft": "Unlock {{symbol}}", "plugin_wallet_approve_all_nft_successfully": "Unlock {{symbol}} successfully", - "plugin_wallet_connect_a_wallet": "Connect a Wallet", + "plugin_wallet_connect_a_wallet": "Connect wallet", "plugin_wallet_confirm_risk_warning": "Confirm Risk Warning", "plugin_wallet_no_gas_fee": "No Gas Fee", "plugin_wallet_update_gas_fee": "Updating Gas Fee…", @@ -332,11 +326,13 @@ "plugin_wallet_on_connect_in_firefox": "Connect", "plugin_wallet_return_mobile_wallet_options": "Return to Mobile Wallet Options", "plugin_wallet_view_qr_code": "View QR Code", - "plugin_wallet_switch_network": "Switch to {{network}} Network", - "plugin_wallet_switch_network_under_going": "Switching to {{network}} Network…", + "plugin_wallet_switch_network": "Switch to {{network}}", + "plugin_wallet_switch_network_under_going": "Switching to {{network}}", + "plugin_wallet_connect_tips": "You’re connected to a walletConnect\nwallet. Please switch network in that wallet, \nor switch to another wallet.", + "plugin_wallet_connect_network": "Connect {{network}} wallet", + "plugin_wallet_connect_network_under_going": "Connect {{network}} wallet", "plugin_wallet_not_available_on": "Not available on {{network}} Network.", - "plugin_wallet_connect_wallet": "Connect Wallet", - "plugin_wallet_connect_wallet_tip": "Please connect to a wallet.", + "plugin_wallet_connect_wallet": "Connect wallet", "plugin_wallet_name_placeholder": "Enter 1-12 characters", "plugin_wallet_fail_to_sign": "Failed to sign password.", "plugin_wallet_cancel_sign": "Signature canceled.", @@ -608,14 +604,14 @@ "plugin_ito_list_table_got": "Balance", "plugin_ito_list_button_send": "Send", "plugin_ito_withdraw": "Withdraw", - "plugin_ito_qualification_loading": "Verify qualification…", - "plugin_ito_qualification_failed": "The wallet address isn't on the list.", "plugin_ito_withdrawn": "Withdrawn", "plugin_ito_your_swapped_amount": "You swapped {{amount}} {{symbol}}", "plugin_ito_your_claimed_amount": "You claimed {{amount}} {{symbol}}", "plugin_ito_your_refund_amount": "return {{amount}} {{symbol}}.", "plugin_ito_unlock_in_advance": "Unlock in Advance", "plugin_ito_swapped_status": "{{remain}} / {{total}} {{token}} Swapped", + "plugin_ito_qualification_loading": "Verify qualification…", + "plugin_ito_qualification_failed": "The wallet address isn't on the list.", "plugin_ito_congratulations": "Congratulations!", "plugin_ito_out_of_stock_hit": "Better luck next time", "plugin_ito_claim_success_share": "I just attended @{{user}}'s #ITO with @{{account}} to swap ${{symbol}}. Install mask.io and start your own Initial Twitter Offering! \n {{link}}", @@ -817,7 +813,6 @@ "plugin_dhedge_buy_token": "GET {{symbol}}", "plugin_dhedge_enter_an_amount": "Enter an amount", "plugin_dhedge_insufficient_balance": "Insufficient {{symbol}} balance", - "plugin_dhedge_loading": "Loading...", "plugin_dhedge_pool_not_found": "Invalid pool address.", "plugin_dhedge_smt_wrong": "Something went wrong!", "plugin_pooltogether_tab_pools": "Pools", @@ -916,7 +911,8 @@ "plugin_furucombo_rewards": "Rewards", "plugin_furucombo_invest": "Invest", "plugin_furucombo_pool_not_found": "Invalid pool address.", - "plugin_furucombo_smt_wrong": "Something went wrong!", + "plugin_furucombo_load_failed": "Load failed", + "plugin_furucombo_reload": "Reload", "plugin_furucombo_head_pools": "Pools", "plugin_furucombo_head_action": "Action", "plugin_pets_dialog_title": "Non-Fungible Friends", @@ -1124,5 +1120,8 @@ "plugin_transak_name": "Fiat On-Ramp", "plugin_transak_description": "Fiat On-Ramp Aggregator on Twitter. Buy crypto in 60+ countries with Transak support.", "plugin_valuables_name": "Valuables", - "plugin_valuables_description": "Buy & sell tweets autographed by their original creators." + "plugin_valuables_description": "Buy & sell tweets autographed by their original creators.", + "plugin_default_title": "Default", + "plugin_provider_by": "Provided by", + "plugin_enables": "Enable plugins" } diff --git a/packages/mask/shared-ui/locales/ja-JP.json b/packages/mask/shared-ui/locales/ja-JP.json index e66fd9af6238..22e985b3dab6 100644 --- a/packages/mask/shared-ui/locales/ja-JP.json +++ b/packages/mask/shared-ui/locales/ja-JP.json @@ -246,8 +246,6 @@ "plugin_ito_list_table_got": "バランス", "plugin_ito_list_button_send": "送る", "plugin_ito_withdraw": "取り消す", - "plugin_ito_qualification_loading": "資格認証中…", - "plugin_ito_qualification_failed": "ウォレットアドレスがリストにありません。", "plugin_ito_withdrawn": "取り消しました", "plugin_ito_your_swapped_amount": "あなたは {{amount}} {{symbol}} を獲得しました", "plugin_ito_your_claimed_amount": "あなたは {{amount}} {{symbol}} を請求しました", @@ -384,7 +382,6 @@ "plugin_dhedge_buy_token": "{{symbol}} を得る", "plugin_dhedge_enter_an_amount": "量を入力", "plugin_dhedge_insufficient_balance": "{{symbol}} の残高が不十分です", - "plugin_dhedge_loading": "ロード中…", "plugin_dhedge_pool_not_found": "無効なプールアドレスです!", "plugin_dhedge_smt_wrong": "何か間違いが発生しました!" } diff --git a/packages/mask/shared-ui/locales/ko-KR.json b/packages/mask/shared-ui/locales/ko-KR.json index 39b48625493f..309f9b81d1b8 100644 --- a/packages/mask/shared-ui/locales/ko-KR.json +++ b/packages/mask/shared-ui/locales/ko-KR.json @@ -80,8 +80,6 @@ "user_guide_tip_connected": "해당 계정에 성공적으로 연결되었습니다.", "user_guide_tip_1": "클릭하여 메인 기능을 확인하세요.", "user_guide_tip_2": "여기서 월렛을 연결하세요. 여기서 네트워크나 월렛을 바꿀 수 있습니다.", - "create_persona": "페르소나 만들기", - "connect_persona": "페로소나 연결하기", "mask_network": "Mask Network", "import": "불러오기", "no_search_result": "결과 없음", @@ -219,7 +217,6 @@ "plugin_wallet_switch_network_under_going": "{{network}} 네트워크로 바꾸는 중...", "plugin_wallet_not_available_on": "{{network}} 에서는 사용할 수 없습니다.", "plugin_wallet_connect_wallet": "월렛 연결", - "plugin_wallet_connect_wallet_tip": "월렛을 연결하세요.", "plugin_wallet_name_placeholder": "1-12 자 입력하세요", "plugin_wallet_fail_to_sign": "비밀번호 사인 실패합니다.", "plugin_wallet_cancel_sign": "서명이 실패되었습니다.", @@ -437,8 +434,6 @@ "plugin_ito_list_table_got": "잔액", "plugin_ito_list_button_send": "발송", "plugin_ito_withdraw": "철회", - "plugin_ito_qualification_loading": "자격 인증...", - "plugin_ito_qualification_failed": "이 월렛 주소는 리스트에 없습니다.", "plugin_ito_withdrawn": "철회됨", "plugin_ito_your_swapped_amount": "{{amount}} {{symbol}} 스왑되었습니다.", "plugin_ito_your_claimed_amount": "{{amount}} {{symbol}} 수령되었습니다.", @@ -597,7 +592,6 @@ "plugin_dhedge_buy_token": "{{symbol}} 획득", "plugin_dhedge_enter_an_amount": "수액 입력", "plugin_dhedge_insufficient_balance": "{{symbol}} 잔액 부족", - "plugin_dhedge_loading": "로딩 중", "plugin_dhedge_pool_not_found": "무효한 풀 주소!", "plugin_dhedge_smt_wrong": "오류가 발생합니다.", "plugin_pooltogether_tab_pools": "풀(Pools)", diff --git a/packages/mask/shared-ui/locales/qya-AA.json b/packages/mask/shared-ui/locales/qya-AA.json index 624be4a5c13d..fdc9e3bb9cd5 100644 --- a/packages/mask/shared-ui/locales/qya-AA.json +++ b/packages/mask/shared-ui/locales/qya-AA.json @@ -175,7 +175,6 @@ "wallet_search_no_result": "crwdns8139:0crwdne8139:0", "wallet_confirm_with_password": "crwdns10141:0crwdne10141:0", "wallet_airdrop_nft_unclaimed_title": "crwdns8093:0crwdne8093:0", - "plugin_not_enabled": "crwdns10811:0{{plugin}}crwdne10811:0", "plugin_external_unknown_plugin": "crwdns10143:0crwdne10143:0", "plugin_external_loader_search_holder": "crwdns10145:0crwdne10145:0", "plugin_external_loader_search_button": "crwdns10147:0crwdne10147:0", @@ -314,7 +313,6 @@ "plugin_wallet_switch_network_under_going": "crwdns4689:0{{network}}crwdne4689:0", "plugin_wallet_not_available_on": "crwdns7913:0{{network}}crwdne7913:0", "plugin_wallet_connect_wallet": "crwdns4693:0crwdne4693:0", - "plugin_wallet_connect_wallet_tip": "crwdns4695:0crwdne4695:0", "plugin_wallet_name_placeholder": "crwdns4705:0crwdne4705:0", "plugin_wallet_fail_to_sign": "crwdns4707:0crwdne4707:0", "plugin_wallet_cancel_sign": "crwdns4709:0crwdne4709:0", @@ -586,8 +584,6 @@ "plugin_ito_list_table_got": "crwdns5131:0crwdne5131:0", "plugin_ito_list_button_send": "crwdns5133:0crwdne5133:0", "plugin_ito_withdraw": "crwdns5135:0crwdne5135:0", - "plugin_ito_qualification_loading": "crwdns5137:0crwdne5137:0", - "plugin_ito_qualification_failed": "crwdns5139:0crwdne5139:0", "plugin_ito_withdrawn": "crwdns5141:0crwdne5141:0", "plugin_ito_your_swapped_amount": "crwdns5143:0{{amount}}crwdnd5143:0{{symbol}}crwdne5143:0", "plugin_ito_your_claimed_amount": "crwdns5145:0{{amount}}crwdnd5145:0{{symbol}}crwdne5145:0", @@ -795,7 +791,6 @@ "plugin_dhedge_buy_token": "crwdns5423:0{{symbol}}crwdne5423:0", "plugin_dhedge_enter_an_amount": "crwdns5425:0crwdne5425:0", "plugin_dhedge_insufficient_balance": "crwdns5427:0{{symbol}}crwdne5427:0", - "plugin_dhedge_loading": "crwdns5429:0crwdne5429:0", "plugin_dhedge_pool_not_found": "crwdns5431:0crwdne5431:0", "plugin_dhedge_smt_wrong": "crwdns5433:0crwdne5433:0", "plugin_pooltogether_tab_pools": "crwdns5435:0crwdne5435:0", diff --git a/packages/mask/shared-ui/locales/zh-CN.json b/packages/mask/shared-ui/locales/zh-CN.json index 2e983f733945..8794b0935615 100644 --- a/packages/mask/shared-ui/locales/zh-CN.json +++ b/packages/mask/shared-ui/locales/zh-CN.json @@ -168,7 +168,6 @@ "wallet_search_no_result": "没有任何结果。", "wallet_confirm_with_password": "使用密码确认", "wallet_airdrop_nft_unclaimed_title": "未认领的NFT Airdrop:", - "plugin_not_enabled": "{{plugin}} (未启用)", "plugin_external_unknown_plugin": "发现新的未知Mask插件,您想要加载它们吗?", "plugin_external_loader_search_holder": "查找外部插件", "plugin_external_loader_search_button": "查找插件", @@ -299,7 +298,6 @@ "plugin_wallet_switch_network_under_going": "正在切换到 {{network}} 网络…", "plugin_wallet_not_available_on": "在 {{network}} 网络上不可用。", "plugin_wallet_connect_wallet": "连接钱包", - "plugin_wallet_connect_wallet_tip": "请连接钱包", "plugin_wallet_name_placeholder": "输入1-12 个字符", "plugin_wallet_fail_to_sign": "无法签名密码。", "plugin_wallet_cancel_sign": "签名已取消。", @@ -552,8 +550,6 @@ "plugin_ito_list_table_got": "余额", "plugin_ito_list_button_send": "发送", "plugin_ito_withdraw": "提取", - "plugin_ito_qualification_loading": "资格认证中…", - "plugin_ito_qualification_failed": "钱包地址不在列表内。", "plugin_ito_withdrawn": "已提取", "plugin_ito_your_swapped_amount": "你兑换了 {{amount}} {{symbol}}", "plugin_ito_your_claimed_amount": "你认领了 {{amount}} {{symbol}}", @@ -740,7 +736,6 @@ "plugin_dhedge_buy_token": "获得 {{symbol}}", "plugin_dhedge_enter_an_amount": "输入数额", "plugin_dhedge_insufficient_balance": "{{symbol}} 余额不足", - "plugin_dhedge_loading": "加载中...", "plugin_dhedge_pool_not_found": "无效的池子地址。", "plugin_dhedge_smt_wrong": "发生了一些错误!", "plugin_pooltogether_tab_pools": "池子", diff --git a/packages/mask/shared-ui/locales/zh-TW.json b/packages/mask/shared-ui/locales/zh-TW.json index fa3f8544fd20..5377ab10b6a7 100644 --- a/packages/mask/shared-ui/locales/zh-TW.json +++ b/packages/mask/shared-ui/locales/zh-TW.json @@ -203,7 +203,6 @@ "plugin_wallet_switch_network_under_going": "切換至 {{network}} 中", "plugin_wallet_not_available_on": "{{network}} 不可用", "plugin_wallet_connect_wallet": "連接錢包", - "plugin_wallet_connect_wallet_tip": "請連接你的錢包", "plugin_red_packet_display_name": "插件:紅包", "plugin_red_packet_claimed": "已認領", "plugin_red_packet_erc20_tab_title": "代幣", @@ -382,8 +381,6 @@ "plugin_ito_list_table_got": "餘額", "plugin_ito_list_button_send": "送出", "plugin_ito_withdraw": "提取", - "plugin_ito_qualification_loading": "驗證資格…", - "plugin_ito_qualification_failed": "錢包地址不在清單上。", "plugin_ito_withdrawn": "已提取", "plugin_ito_your_swapped_amount": "你交換了 {{amount}} {{symbol}}", "plugin_ito_your_claimed_amount": "你認領了 {{amount}} {{symbol}}", @@ -536,7 +533,6 @@ "plugin_dhedge_buy_token": "取得 {{symbol}}", "plugin_dhedge_enter_an_amount": "輸入一個金額", "plugin_dhedge_insufficient_balance": "{{symbol}} 餘額不足", - "plugin_dhedge_loading": "讀取中…", "plugin_dhedge_pool_not_found": "錯誤的池地址!", "plugin_dhedge_smt_wrong": "出錯了!" } diff --git a/packages/mask/src/components/InjectedComponents/DisabledPluginSuggestion.tsx b/packages/mask/src/components/InjectedComponents/DisabledPluginSuggestion.tsx index a018a42e6b65..68a9c33a14b4 100644 --- a/packages/mask/src/components/InjectedComponents/DisabledPluginSuggestion.tsx +++ b/packages/mask/src/components/InjectedComponents/DisabledPluginSuggestion.tsx @@ -4,12 +4,15 @@ import { registeredPlugins, usePostInfoDetails, Plugin, - usePluginI18NField, + PluginI18NFieldRender, } from '@masknet/plugin-infra/content-script' import { extractTextFromTypedMessage } from '@masknet/typed-message' -import { Switch } from '@mui/material' import Services from '../../extension/service' import MaskPostExtraInfoWrapper from '../../plugins/MaskPluginWrapper' +import { HTMLProps, useCallback } from 'react' +import { Button, Skeleton, useTheme } from '@mui/material' +import { PluginIcon } from '@masknet/icons' +import { makeStyles } from '@masknet/theme' import { useI18N } from '../../utils' function useDisabledPlugins() { @@ -52,25 +55,71 @@ export function PossiblePluginSuggestionPostInspector() { return } export function PossiblePluginSuggestionUI(props: { plugins: Plugin.DeferredDefinition[] }) { - const { t } = useI18N() - const t2 = usePluginI18NField() const { plugins } = props + const { t } = useI18N() + const theme = useTheme() + const onClick = useCallback((x: Plugin.DeferredDefinition) => { + Services.Settings.setPluginMinimalModeEnabled(x.ID, false) + }, []) + const _plugins = useActivatedPluginsSNSAdaptor('any') if (!plugins.length) return null + return ( <> {plugins.map((x) => ( } + publisher={ + x.publisher ? : undefined + } + publisherLink={x.publisher?.link} + wrapperProps={_plugins.find((y) => y.ID === x.ID)?.wrapperProps} action={ - Services.Settings.setPluginMinimalModeEnabled(x.ID, false)} - /> + } + content={} /> ))} ) } + +const useRectangleStyles = makeStyles()(() => ({ + rectangle: { + background: 'rgba(255, 255, 255, 0.5)', + }, +})) +interface RectangleProps extends HTMLProps {} + +export function Rectangle(props: RectangleProps) { + const { classes } = useRectangleStyles() + return ( +
+ + + +
+ ) +} diff --git a/packages/mask/src/components/InjectedComponents/SearchResultBox.tsx b/packages/mask/src/components/InjectedComponents/SearchResultBox.tsx index c917be2bf891..5d09af03a749 100644 --- a/packages/mask/src/components/InjectedComponents/SearchResultBox.tsx +++ b/packages/mask/src/components/InjectedComponents/SearchResultBox.tsx @@ -1,7 +1,7 @@ import { createInjectHooksRenderer, useActivatedPluginsSNSAdaptor } from '@masknet/plugin-infra/content-script' const PluginRenderer = createInjectHooksRenderer( - useActivatedPluginsSNSAdaptor.visibility.useNotMinimalMode, + useActivatedPluginsSNSAdaptor.visibility.useAnyMode, (x) => x.SearchResultBox, ) diff --git a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx index c0a8bd58ef41..7a227a1f65d2 100644 --- a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx +++ b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/ActionBar.tsx @@ -7,17 +7,12 @@ import type { Project } from '../types' const useStyles = makeStyles()((theme) => { return { - root: { - marginLeft: theme.spacing(-0.5), - marginRight: theme.spacing(-0.5), - marginTop: theme.spacing(1), - }, + root: {}, content: { padding: theme.spacing(0), }, button: { flex: 1, - margin: `${theme.spacing(0)} ${theme.spacing(0.5)}`, }, } }) diff --git a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/Collectible.tsx b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/Collectible.tsx index 581c3601a1bb..b1fe65404fac 100644 --- a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/Collectible.tsx +++ b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/Collectible.tsx @@ -1,14 +1,15 @@ import { useI18N } from '../../../utils' -import { Tab, Tabs, Paper, Card, CardHeader, CardContent, Link, Typography, Avatar } from '@mui/material' +import { Tab, Tabs, Paper, Card, CardHeader, CardContent, Link, Typography, Avatar, Box } from '@mui/material' import { useState } from 'react' import { makeStyles } from '@masknet/theme' import { CollectionView } from './CollectionView' import { DetailsView } from './DetailsView' -import { formatWeiToEther, useChainId } from '@masknet/web3-shared-evm' +import { ChainId, formatWeiToEther, useChainId } from '@masknet/web3-shared-evm' import { useFetchProject } from '../hooks/useProject' import { ActionBar } from './ActionBar' import { resolveProjectLinkOnArtBlocks, resolveUserLinkOnArtBlocks } from '../pipes' import { ArtBlocksLogoUrl } from '../constants' +import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' const useStyles = makeStyles()((theme) => { return { @@ -53,6 +54,7 @@ const useStyles = makeStyles()((theme) => { interface CollectibleProps { projectId: string + chainId?: ChainId } export function Collectible(props: CollectibleProps) { @@ -129,7 +131,11 @@ export function Collectible(props: CollectibleProps) { {pages[tabIndex]} - + + + + + ) } diff --git a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/index.tsx b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/index.tsx index d86872021181..a55e7c7bea67 100644 --- a/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/index.tsx +++ b/packages/mask/src/plugins/ArtBlocks/SNSAdaptor/index.tsx @@ -7,7 +7,6 @@ import { base } from '../base' import { extractTextFromTypedMessage } from '@masknet/typed-message' import { Collectible } from './Collectible' import type { ChainId } from '@masknet/web3-shared-evm' -import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' import { ArtBlocksIcon } from '@masknet/icons' const sns: Plugin.SNSAdaptor.Definition = { @@ -39,11 +38,7 @@ const sns: Plugin.SNSAdaptor.Definition = { function Renderer(props: React.PropsWithChildren<{ chainId: ChainId; projectId: string }>) { usePluginWrapper(true) - return ( - - - - ) + return } export default sns diff --git a/packages/mask/src/plugins/Collectible/SNSAdaptor/ActionBar.tsx b/packages/mask/src/plugins/Collectible/SNSAdaptor/ActionBar.tsx index a51866d7b24a..d17cb3043318 100644 --- a/packages/mask/src/plugins/Collectible/SNSAdaptor/ActionBar.tsx +++ b/packages/mask/src/plugins/Collectible/SNSAdaptor/ActionBar.tsx @@ -7,16 +7,21 @@ import { useControlledDialog } from '../../../utils/hooks/useControlledDialog' import { MakeOfferDialog } from './MakeOfferDialog' import { PostListingDialog } from './PostListingDialog' import { CheckoutDialog } from './CheckoutDialog' +import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' +import { useChainId } from '@masknet/web3-shared-evm' const useStyles = makeStyles()((theme) => { return { root: { - marginLeft: theme.spacing(-0.5), - marginRight: theme.spacing(-0.5), + width: 'calc(100% - 24px)', }, button: { flex: 1, - margin: `0 ${theme.spacing(0.5)}`, + backgroundColor: theme.palette.maskColor.dark, + '&:hover': { + backgroundColor: theme.palette.maskColor.dark, + }, + color: 'white', }, } }) @@ -28,6 +33,7 @@ export function ActionBar(props: ActionBarProps) { const { classes } = useStyles() const { asset, assetOrder } = CollectibleState.useContainer() const assets = asset.value + const chainId = useChainId() const { open: openCheckoutDialog, @@ -43,53 +49,55 @@ export function ActionBar(props: ActionBarProps) { if (!asset.value) return null return ( - - {!asset.value.isOwner && asset.value.is_auction && assetOrder.value ? ( - - {t('plugin_collectible_buy_now')} - - ) : null} - {!asset.value.isOwner && asset.value.is_auction ? ( - - {t('plugin_collectible_place_bid')} - - ) : null} + + + {!asset.value.isOwner && asset.value.is_auction && assetOrder.value ? ( + + {t('plugin_collectible_buy_now')} + + ) : null} + {!asset.value.isOwner && asset.value.is_auction ? ( + + {t('plugin_collectible_place_bid')} + + ) : null} - {!asset.value.isOwner && !asset.value.is_auction ? ( - - {t('plugin_collectible_make_offer')} - - ) : null} - {assets?.isOwner ? ( - - {t('plugin_collectible_sell')} - - ) : null} - - - + {!asset.value.isOwner && !asset.value.is_auction ? ( + + {t('plugin_collectible_make_offer')} + + ) : null} + {assets?.isOwner ? ( + + {t('plugin_collectible_sell')} + + ) : null} + + + + ) } diff --git a/packages/mask/src/plugins/Collectible/SNSAdaptor/Collectible.tsx b/packages/mask/src/plugins/Collectible/SNSAdaptor/Collectible.tsx index cb4d5b9afac0..eadb415fdc7a 100644 --- a/packages/mask/src/plugins/Collectible/SNSAdaptor/Collectible.tsx +++ b/packages/mask/src/plugins/Collectible/SNSAdaptor/Collectible.tsx @@ -1,6 +1,6 @@ import { ReactElement, useCallback } from 'react' import { Box, Button, CardActions, CardContent, CardHeader, Link, Paper, Tab, Tabs, Typography } from '@mui/material' -import { makeStyles } from '@masknet/theme' +import { makeStyles, MaskColorVar } from '@masknet/theme' import { Trans } from 'react-i18next' import { findIndex } from 'lodash-unified' import formatDateTime from 'date-fns/format' @@ -33,7 +33,6 @@ const useStyles = makeStyles()((theme) => { width: '100%', border: `solid 1px ${theme.palette.divider}`, padding: 0, - marginBottom: 12, }, content: { width: '100%', @@ -141,24 +140,35 @@ export function Collectible(props: CollectibleProps) { setProvider, getEnumAsArray(NonFungibleAssetProvider).map((x) => x.value), resolveCollectibleProviderName, + true, ) // #endregion if (!asset.value || !token) return ( - + Failed to load your collectible on {resolveCollectibleProviderName(provider)}. - {CollectibleProviderSwitcher} - + + {CollectibleProviderSwitcher} + + + + ) const tabs = [ diff --git a/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx b/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx index cd7c207be1eb..c87ac106b624 100644 --- a/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx +++ b/packages/mask/src/plugins/Collectible/SNSAdaptor/MakeOfferDialog.tsx @@ -13,14 +13,19 @@ import { import { makeStyles } from '@masknet/theme' import { first, uniqBy } from 'lodash-unified' import BigNumber from 'bignumber.js' -import { FungibleTokenDetailed, EthereumTokenType, useAccount, useFungibleTokenWatched } from '@masknet/web3-shared-evm' +import { + FungibleTokenDetailed, + EthereumTokenType, + useAccount, + useFungibleTokenWatched, + useChainId, +} from '@masknet/web3-shared-evm' import formatDateTime from 'date-fns/format' import { useI18N } from '../../../utils' import { InjectedDialog } from '@masknet/shared' import { useRemoteControlledDialog } from '@masknet/shared-base-ui' import { UnreviewedWarning } from './UnreviewedWarning' import ActionButton, { ActionButtonPromise } from '../../../extension/options-page/DashboardComponents/ActionButton' -import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' import { DateTimePanel } from '../../../web3/UI/DateTimePanel' import { PluginCollectibleRPC } from '../messages' import { toAsset } from '../helpers' @@ -32,6 +37,7 @@ import { rightShift, ZERO } from '@masknet/web3-shared-base' import type { Coin } from '../../Trader/types' import { SelectTokenListPanel } from './SelectTokenListPanel' import { isWyvernSchemaName } from '../utils' +import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' const useStyles = makeStyles()((theme) => { return { @@ -86,7 +92,7 @@ export function MakeOfferDialog(props: MakeOfferDialogProps) { const { classes } = useStyles() const account = useAccount() - + const chainId = useChainId() const [expirationDateTime, setExpirationDateTime] = useState(new Date()) const [unreviewedChecked, setUnreviewedChecked] = useState(false) const [ToS_Checked, setToS_Checked] = useState(false) @@ -236,7 +242,7 @@ export function MakeOfferDialog(props: MakeOfferDialogProps) { )} - + ) : null} - + diff --git a/packages/mask/src/plugins/Collectible/SNSAdaptor/PostInspector.tsx b/packages/mask/src/plugins/Collectible/SNSAdaptor/PostInspector.tsx index bad1491c86bd..0e66ed8a0044 100644 --- a/packages/mask/src/plugins/Collectible/SNSAdaptor/PostInspector.tsx +++ b/packages/mask/src/plugins/Collectible/SNSAdaptor/PostInspector.tsx @@ -1,7 +1,6 @@ import type { CollectibleJSON_Payload } from '../types' import { Collectible } from './Collectible' import { CollectibleState } from '../hooks/useCollectibleState' -import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' export interface PostInspectorProps { payload: CollectibleJSON_Payload @@ -11,15 +10,13 @@ export function PostInspector(props: PostInspectorProps) { const token = props.payload return ( - - - - - + + + ) } diff --git a/packages/mask/src/plugins/Collectible/hooks/useCollectibleState.ts b/packages/mask/src/plugins/Collectible/hooks/useCollectibleState.ts index 976962f468f9..f3f79d40d886 100644 --- a/packages/mask/src/plugins/Collectible/hooks/useCollectibleState.ts +++ b/packages/mask/src/plugins/Collectible/hooks/useCollectibleState.ts @@ -15,7 +15,6 @@ function useCollectibleState(token?: CollectibleToken) { const [provider, setProvider] = useState(NonFungibleAssetProvider.OPENSEA) const asset = useAsset(token?.contractAddress ?? '', token?.tokenId ?? '', provider) - // #region asset order from sdk const assetOrder = useAssetOrder(provider, token) // #endregion diff --git a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/ActionBar.tsx b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/ActionBar.tsx index f6dce0601a4b..ef9a9d9fccfd 100644 --- a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/ActionBar.tsx +++ b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/ActionBar.tsx @@ -10,13 +10,14 @@ import { CheckoutDialog } from './CheckoutDialog' const useStyles = makeStyles()((theme) => { return { - root: { - marginLeft: theme.spacing(-0.5), - marginRight: theme.spacing(-0.5), - }, + root: {}, button: { flex: 1, - margin: `0 ${theme.spacing(0.5)}`, + backgroundColor: theme.palette.maskColor.dark, + color: 'white', + '&:hover': { + backgroundColor: theme.palette.maskColor.dark, + }, }, } }) @@ -43,7 +44,7 @@ export function ActionBar(props: ActionBarProps) { if (!asset.value) return null return ( - + {!assetSource?.isSoldOut && !assetSource?.is_owner && assetSource?.is24Auction && diff --git a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx index 12718c75e0e1..40165f6de8cf 100644 --- a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx +++ b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/Collectible.tsx @@ -16,6 +16,7 @@ import { resolveAssetLinkOnCryptoartAI, resolveWebLinkOnCryptoartAI } from '../p import { Markdown } from '../../Snapshot/SNSAdaptor/Markdown' import { ActionBar } from './ActionBar' import { useChainId } from '@masknet/web3-shared-evm' +import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' const useStyles = makeStyles()((theme) => { return { @@ -77,7 +78,7 @@ export function Collectible(props: CollectibleProps) { const { t } = useI18N() const { classes } = useStyles() const chainId = useChainId() - const { asset, events, tabIndex, setTabIndex } = CollectibleState.useContainer() + const { asset, events, tabIndex, setTabIndex, chainId: expectChainId } = CollectibleState.useContainer() const assetSource = useMemo(() => { if (!asset.value || asset.error) return @@ -265,7 +266,11 @@ export function Collectible(props: CollectibleProps) { - + + + + + ) } diff --git a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/PostInspector.tsx b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/PostInspector.tsx index b611ed2f1710..745131e28932 100644 --- a/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/PostInspector.tsx +++ b/packages/mask/src/plugins/CryptoartAI/SNSAdaptor/PostInspector.tsx @@ -1,7 +1,6 @@ import type { PayloadType } from '../types' import { Collectible } from './Collectible' import { CollectibleState } from '../hooks/useCollectibleState' -import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' export interface PostInspectorProps { payload: PayloadType @@ -11,16 +10,14 @@ export function PostInspector(props: PostInspectorProps) { const token = props.payload return ( - - - - - + + + ) } diff --git a/packages/mask/src/plugins/CryptoartAI/hooks/useCollectibleState.ts b/packages/mask/src/plugins/CryptoartAI/hooks/useCollectibleState.ts index 282dd2f04f34..057f45b6c10e 100644 --- a/packages/mask/src/plugins/CryptoartAI/hooks/useCollectibleState.ts +++ b/packages/mask/src/plugins/CryptoartAI/hooks/useCollectibleState.ts @@ -20,6 +20,7 @@ function useCollectibleState(token?: Token) { setTabIndex, offers, events, + chainId: token?.chainId, } } diff --git a/packages/mask/src/plugins/EVM/hooks/useAsset.ts b/packages/mask/src/plugins/EVM/hooks/useAsset.ts index fbca7176d93e..4ee7eba31865 100644 --- a/packages/mask/src/plugins/EVM/hooks/useAsset.ts +++ b/packages/mask/src/plugins/EVM/hooks/useAsset.ts @@ -7,6 +7,7 @@ import { useChainId, useTokenConstants, resolveIPFSLinkFromURL, + ChainId, } from '@masknet/web3-shared-evm' import { EVM_RPC } from '../messages' import { resolveAvatarLinkOnCurrentProvider } from '../../Collectible/pipes' @@ -17,14 +18,24 @@ export function useAsset(address: string, tokenId: string, provider: NonFungible const { WNATIVE_ADDRESS } = useTokenConstants() return useAsyncRetry(async () => { - const asset = await EVM_RPC.getAsset({ address, tokenId, chainId, provider }) + const asset = await EVM_RPC.getAsset({ + address, + tokenId, + chainId: provider === NonFungibleAssetProvider.OPENSEA ? ChainId.Mainnet : chainId, + provider, + }) + if (!asset) return return { ...asset, image_url: resolveIPFSLinkFromURL(asset?.image_url ?? ''), isOrderWeth: isSameAddress(asset?.desktopOrder?.payment_token ?? '', WNATIVE_ADDRESS) ?? false, isCollectionWeth: asset?.collection?.payment_tokens?.some(currySameAddress(WNATIVE_ADDRESS)) ?? false, isOwner: asset?.top_ownerships.some((item) => isSameAddress(item.owner.address, account)) ?? false, - collectionLinkUrl: resolveAvatarLinkOnCurrentProvider(chainId, asset, provider), + collectionLinkUrl: resolveAvatarLinkOnCurrentProvider( + provider === NonFungibleAssetProvider.OPENSEA ? ChainId.Mainnet : chainId, + asset, + provider, + ), } }, [account, chainId, WNATIVE_ADDRESS, address, tokenId, provider]) } diff --git a/packages/mask/src/plugins/FindTruman/SNSAdaptor/FindTruman.tsx b/packages/mask/src/plugins/FindTruman/SNSAdaptor/FindTruman.tsx index 9ab793fd4f4a..fd870fe64ebf 100644 --- a/packages/mask/src/plugins/FindTruman/SNSAdaptor/FindTruman.tsx +++ b/packages/mask/src/plugins/FindTruman/SNSAdaptor/FindTruman.tsx @@ -1,7 +1,7 @@ import { useContext, useState } from 'react' import { makeStyles } from '@masknet/theme' import { FindTrumanContext } from '../context' -import { Alert, Avatar, Box, Card, CardHeader, CardMedia, Chip, Skeleton, Tooltip, Typography } from '@mui/material' +import { Avatar, Box, Card, CardHeader, CardMedia, Chip, Skeleton, Tooltip, Typography } from '@mui/material' import type { CompletionQuestionAnswer, PollResult, @@ -18,6 +18,10 @@ import Footer from './Footer' import StageCard from './StageCard' import EncryptionCard from './EncryptionCard' import CompletionCard from './CompletionCard' +import { PluginWalletConnectIcon } from '@masknet/icons' +import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' +import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' +import { useChainId } from '@masknet/web3-shared-evm' const useStyles = makeStyles()((theme) => { return { @@ -137,6 +141,7 @@ export function getPostTypeTitle(t: FindTrumanI18nFunction, postType: PostType) export function FindTruman(props: FindTrumanProps) { const { classes } = useStyles() const { address, t } = useContext(FindTrumanContext) + const chainId = useChainId() const { postType, clueId, @@ -182,74 +187,87 @@ export function FindTruman(props: FindTrumanProps) { } return ( - - {postType !== PostType.Encryption ? ( - <> - { - setLoadImg(false) - }} - alt="" - component="img" - height={140} - sx={{ - visibility: loadImg ? 'hidden' : 'unset', - }} - image={storyInfo?.img} - /> - {loadImg && ( - - - - )} - - - {storyInfo.name} - - - - - {isCritical && C} - {isNoncritical && N} - - - + <> + + {postType !== PostType.Encryption ? ( + <> + { + setLoadImg(false) + }} + alt="" + component="img" + height={140} + sx={{ + visibility: loadImg ? 'hidden' : 'unset', + }} + image={storyInfo?.img} + /> + {loadImg && ( + + + + )} + + + {storyInfo.name} + + + + + {isCritical && C} + {isNoncritical && ( + N + )} + + + + - - ) - } + ) + } + /> + {renderCard()} + + ) : ( + + )} + +