+ You are one of the top 100 Spice holders in BOB Fusion
+
+
+
+ As one of our most important community members, we would love the opportunity to gain your input on the
+ BOB ecosystem and our future plans.
+
+
+
+
+ BOB co-founder, Alexei Zamyatin, would like to invite you
+ to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please
+ click the button below to book a call at a time that suits you.
+
+
+
+
+
+
+
+
+ setIsCalendlyOpen(false)}
+ />
+ >
+ );
+};
+
+export { TopUserModal };
diff --git a/apps/evm/src/app/[lang]/fusion/components/TopUserModal/index.ts b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/index.ts
new file mode 100644
index 000000000..0500ddb6d
--- /dev/null
+++ b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/index.ts
@@ -0,0 +1 @@
+export { TopUserModal } from './TopUserModal';
diff --git a/apps/evm/src/app/[lang]/fusion/hooks/index.ts b/apps/evm/src/app/[lang]/fusion/hooks/index.ts
index 66bc75777..6b31d0fe5 100644
--- a/apps/evm/src/app/[lang]/fusion/hooks/index.ts
+++ b/apps/evm/src/app/[lang]/fusion/hooks/index.ts
@@ -1,2 +1,3 @@
export * from './useGetTokensInfo';
export * from './useGetQuests';
+export * from './useDismissTopUserModal';
diff --git a/apps/evm/src/app/[lang]/fusion/hooks/useDismissTopUserModal.tsx b/apps/evm/src/app/[lang]/fusion/hooks/useDismissTopUserModal.tsx
new file mode 100644
index 000000000..9f187d581
--- /dev/null
+++ b/apps/evm/src/app/[lang]/fusion/hooks/useDismissTopUserModal.tsx
@@ -0,0 +1,30 @@
+import { useMutation } from '@gobob/react-query';
+
+import { useGetUser } from '@/hooks';
+import { fusionKeys, queryClient } from '@/lib/react-query';
+import { apiClient, UserResponse } from '@/utils';
+
+const useDismissTopUserModal = () => {
+ const { data: user } = useGetUser();
+
+ return useMutation({
+ mutationKey: fusionKeys.topUserModal(user?.username),
+ mutationFn: () => apiClient.dismissTopUserModal(),
+ onSuccess() {
+ queryClient.setQueryData(
+ ['user'],
+ (oldData: UserResponse): UserResponse => ({
+ ...oldData,
+ notices: {
+ showIsFusionTopUser: false
+ }
+ })
+ );
+ },
+ onSettled() {
+ queryClient.refetchQueries({ queryKey: ['user'] });
+ }
+ });
+};
+
+export { useDismissTopUserModal };
diff --git a/apps/evm/src/lib/react-query/keys.ts b/apps/evm/src/lib/react-query/keys.ts
index 675d7a497..ed68c0845 100644
--- a/apps/evm/src/lib/react-query/keys.ts
+++ b/apps/evm/src/lib/react-query/keys.ts
@@ -75,7 +75,7 @@ export const appsKeys = {
apps: () => ['apps'],
appsVotes: (username: string | undefined) => [...appsKeys.apps(), 'votes', username],
appsResultVotes: () => [...appsKeys.apps(), 'result-votes'],
- vote: (address: Address | undefined) => [appsKeys.apps(), 'vote', address]
+ vote: (username: string | undefined) => [appsKeys.apps(), 'vote', username]
};
export const fusionKeys = {
@@ -85,6 +85,7 @@ export const fusionKeys = {
tokenInfo: () => [...fusionKeys.fusion(), 'token-info'],
quests: () => [...fusionKeys.fusion(), 'quests'],
tvlLevel: () => [...fusionKeys.fusion(), 'tvl-level'],
- lotteryStats: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-stats', username] as string[],
- lotteryRoll: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-roll', username] as string[]
+ lotteryStats: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-stats', username],
+ lotteryRoll: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-roll', username],
+ topUserModal: (username: string | undefined) => [...fusionKeys.fusion(), 'top-user-modal', username]
};
diff --git a/apps/evm/src/locales/en.po b/apps/evm/src/locales/en.po
index adf650fb5..6aadd7d61 100644
--- a/apps/evm/src/locales/en.po
+++ b/apps/evm/src/locales/en.po
@@ -120,7 +120,7 @@ msgstr "An Exclusive Bitcoin Staking and DeFi Campaign"
#~ msgid "An exclusive quest campaign."
#~ msgstr "An exclusive quest campaign."
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:266
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:259
msgid "and that you have read and understood our"
msgstr "and that you have read and understood our"
@@ -142,6 +142,10 @@ msgstr "Apps"
msgid "Apps Used"
msgstr "Apps Used"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:29
+msgid "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
+msgstr "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
+
#: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:62
#: src/app/[lang]/wallet/components/TokenTable/TokenTable.tsx:110
msgid "Asset"
@@ -194,12 +198,16 @@ msgstr "BOB"
msgid "BOB Bridge"
msgstr "BOB Bridge"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:35
+msgid "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
+msgstr "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
+
#: src/app/[lang]/(bridge)/components/BannerCarousel/OKXCryptopediaBanner.tsx:22
msgid "BOB Ecosystem on OKX Cryptopedia"
msgstr "BOB Ecosystem on OKX Cryptopedia"
#: src/app/[lang]/(bridge)/components/BannerCarousel/FusionBanner.tsx:22
-#: src/app/[lang]/fusion/Fusion.tsx:92
+#: src/app/[lang]/fusion/Fusion.tsx:96
msgid "BOB Fusion: The Final Season"
msgstr "BOB Fusion: The Final Season"
@@ -228,6 +236,10 @@ msgstr "BOB TVL Progress"
msgid "BOB Wallet"
msgstr "BOB Wallet"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:44
+msgid "Book Meeting"
+msgstr "Book Meeting"
+
#: src/app/[lang]/(bridge)/bridge/page.tsx:14
#: src/app/[lang]/page.tsx:15
#: src/app/[lang]/wallet/components/TokenTable/ButtonGroup.tsx:75
@@ -279,7 +291,7 @@ msgstr "BTC bridge is currently unavailable. This may be due to: {0}. Please try
msgid "BTC LST Lending"
msgstr "BTC LST Lending"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:258
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:251
msgid "By clicking ‘Connect’ you acknowledge and agree to the"
msgstr "By clicking ‘Connect’ you acknowledge and agree to the"
@@ -304,7 +316,8 @@ msgstr "Category"
msgid "Checking Allowance"
msgstr "Checking Allowance"
-#: src/connect-ui/component/ConnectModal/WalletList.tsx:116
+#: src/connect-ui/component/ConnectModal/BtcWalletList.tsx:39
+#: src/connect-ui/component/ConnectModal/EvmWalletList.tsx:76
msgid "choose available wallets"
msgstr "choose available wallets"
@@ -370,22 +383,22 @@ msgstr "Connect BTC Wallet"
msgid "Connect BTC wallet to access fee rate settings."
msgstr "Connect BTC wallet to access fee rate settings."
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:141
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:134
msgid "Connect request is already pending"
msgstr "Connect request is already pending"
#: src/app/[lang]/wallet/Wallet.tsx:77
#: src/connect-ui/component/AuthButton/AuthButton.tsx:63
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:220
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:213
#: src/connect-ui/component/ConnectWallet/ConnectWallet.tsx:35
msgid "Connect Wallet"
msgstr "Connect Wallet"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:302
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:295
msgid "Connect your Bitcoin Wallet (Optional)"
msgstr "Connect your Bitcoin Wallet (Optional)"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:287
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:280
msgid "Connect your EVM Wallet (Mandatory)"
msgstr "Connect your EVM Wallet (Mandatory)"
@@ -537,8 +550,8 @@ msgstr "Estimated within 30 minutes"
msgid "Estimated within the next block"
msgstr "Estimated within the next block"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:144
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:180
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:137
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:173
msgid "Failed to connect to {0}"
msgstr "Failed to connect to {0}"
@@ -600,7 +613,7 @@ msgid "Follow the steps of <0>this guide0> to provide liquity into a DEX pool
msgstr "Follow the steps of <0>this guide0> to provide liquity into a DEX pool on Oku."
#: src/app/[lang]/(bridge)/components/BannerCarousel/XBanner.tsx:18
-#: src/app/[lang]/fusion/Fusion.tsx:120
+#: src/app/[lang]/fusion/Fusion.tsx:124
msgid "Follow us on X"
msgstr "Follow us on X"
@@ -651,8 +664,8 @@ msgstr "Get ETH for transaction fees on BOB"
msgid "Get tickets"
msgstr "Get tickets"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:195
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:209
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:188
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:202
msgid "go back"
msgstr "go back"
@@ -688,7 +701,7 @@ msgstr "Harvest {pointsMissing} more Spice to play"
#~ msgid "Harvest {pointsMissing} more SPICE to your account to play"
#~ msgstr "Harvest {pointsMissing} more SPICE to your account to play"
-#: src/app/[lang]/fusion/Fusion.tsx:95
+#: src/app/[lang]/fusion/Fusion.tsx:99
msgid "Harvest Spice by depositing into BOB apps, voting, and solving quests. Keep an eye out for special events."
msgstr "Harvest Spice by depositing into BOB apps, voting, and solving quests. Keep an eye out for special events."
@@ -696,7 +709,7 @@ msgstr "Harvest Spice by depositing into BOB apps, voting, and solving quests. K
msgid "Here are your active referrals and the Spice they're currently earning for you. The more they earn, the more you benefit!"
msgstr "Here are your active referrals and the Spice they're currently earning for you. The more they earn, the more you benefit!"
-#: src/app/[lang]/fusion/Fusion.tsx:88
+#: src/app/[lang]/fusion/Fusion.tsx:92
msgid "Hero dots"
msgstr "Hero dots"
@@ -753,7 +766,7 @@ msgid "Leaderboard"
msgstr "Leaderboard"
#: src/app/[lang]/fusion/components/WelcomeBackModal/WelcomeBackModal.tsx:81
-#: src/app/[lang]/fusion/Fusion.tsx:105
+#: src/app/[lang]/fusion/Fusion.tsx:109
msgid "Learn More"
msgstr "Learn More"
@@ -946,6 +959,10 @@ msgstr "No bridging operations found"
msgid "No new goal at the moment. Stay tuned for updates!"
msgstr "No new goal at the moment. Stay tuned for updates!"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:47
+msgid "No Thanks"
+msgstr "No Thanks"
+
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:50
#~ msgid "Not enough spice"
#~ msgstr "Not enough spice"
@@ -970,7 +987,7 @@ msgstr "Not your lucky day... yet!"
msgid "OKX Cryptopedia"
msgstr "OKX Cryptopedia"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:252
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:245
msgid "On BOB, you have the option to link both your EVM and BTC wallets. For optimal functionality, it's advised to connect wallets from both networks."
msgstr "On BOB, you have the option to link both your EVM and BTC wallets. For optimal functionality, it's advised to connect wallets from both networks."
@@ -1033,7 +1050,7 @@ msgstr "POWERED BY BTC & ETH"
msgid "Preparing..."
msgstr "Preparing..."
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:272
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:265
msgid "Privacy policy"
msgstr "Privacy policy"
@@ -1162,11 +1179,11 @@ msgstr "Season 3 Harvested Spice"
msgid "Season Three"
msgstr "Season Three"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:217
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:210
msgid "Select Bitcoin Wallet"
msgstr "Select Bitcoin Wallet"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:203
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:196
msgid "Select EVM Wallet"
msgstr "Select EVM Wallet"
@@ -1409,7 +1426,7 @@ msgstr "T&Cs"
msgid "Take em home"
msgstr "Take em home"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:264
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:257
msgid "Terms of Service"
msgstr "Terms of Service"
@@ -1532,7 +1549,7 @@ msgid "To cast your vote, please log in"
msgstr "To cast your vote, please log in"
#: src/app/[lang]/(bridge)/components/BannerCarousel/XBanner.tsx:22
-#: src/app/[lang]/fusion/Fusion.tsx:123
+#: src/app/[lang]/fusion/Fusion.tsx:127
msgid "To stay up-to date with the BOB ecosystem follow @build_on_bob."
msgstr "To stay up-to date with the BOB ecosystem follow @build_on_bob."
@@ -1648,7 +1665,7 @@ msgstr "Use your Spice total to support your favourite BOB builders. Winners wil
#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:110
#: src/components/LoginButton/LoginButton.tsx:27
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:137
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:130
msgid "User rejected the request"
msgstr "User rejected the request"
@@ -1770,6 +1787,10 @@ msgstr "Yield Assets"
msgid "You"
msgstr "You"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:26
+msgid "You are one of the top 100 Spice holders in BOB Fusion"
+msgstr "You are one of the top 100 Spice holders in BOB Fusion"
+
#: src/app/[lang]/(bridge)/components/GatewayTransactionDetails/GatewayTransactionDetails.tsx:76
msgid "You are using a BTC address type (Taproot/P2TR) which we don't support yet. Change the BTC address type to Native SegWit in your wallet to continue."
msgstr "You are using a BTC address type (Taproot/P2TR) which we don't support yet. Change the BTC address type to Native SegWit in your wallet to continue."
diff --git a/apps/evm/src/locales/zh.po b/apps/evm/src/locales/zh.po
index 53d08f4d6..eb4b61db4 100644
--- a/apps/evm/src/locales/zh.po
+++ b/apps/evm/src/locales/zh.po
@@ -120,7 +120,7 @@ msgstr ""
#~ msgid "An exclusive quest campaign."
#~ msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:266
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:259
msgid "and that you have read and understood our"
msgstr ""
@@ -142,6 +142,10 @@ msgstr ""
msgid "Apps Used"
msgstr "已体验的应用"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:29
+msgid "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
+msgstr ""
+
#: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:62
#: src/app/[lang]/wallet/components/TokenTable/TokenTable.tsx:110
msgid "Asset"
@@ -194,12 +198,16 @@ msgstr ""
msgid "BOB Bridge"
msgstr ""
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:35
+msgid "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
+msgstr ""
+
#: src/app/[lang]/(bridge)/components/BannerCarousel/OKXCryptopediaBanner.tsx:22
msgid "BOB Ecosystem on OKX Cryptopedia"
msgstr ""
#: src/app/[lang]/(bridge)/components/BannerCarousel/FusionBanner.tsx:22
-#: src/app/[lang]/fusion/Fusion.tsx:92
+#: src/app/[lang]/fusion/Fusion.tsx:96
msgid "BOB Fusion: The Final Season"
msgstr "BOB Fusion:最终季"
@@ -228,6 +236,10 @@ msgstr "BOB TVL进度"
msgid "BOB Wallet"
msgstr "BOB 钱包"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:44
+msgid "Book Meeting"
+msgstr ""
+
#: src/app/[lang]/(bridge)/bridge/page.tsx:14
#: src/app/[lang]/page.tsx:15
#: src/app/[lang]/wallet/components/TokenTable/ButtonGroup.tsx:75
@@ -279,7 +291,7 @@ msgstr ""
msgid "BTC LST Lending"
msgstr "BTC LST借贷"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:258
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:251
msgid "By clicking ‘Connect’ you acknowledge and agree to the"
msgstr ""
@@ -304,7 +316,8 @@ msgstr ""
msgid "Checking Allowance"
msgstr ""
-#: src/connect-ui/component/ConnectModal/WalletList.tsx:116
+#: src/connect-ui/component/ConnectModal/BtcWalletList.tsx:39
+#: src/connect-ui/component/ConnectModal/EvmWalletList.tsx:76
msgid "choose available wallets"
msgstr ""
@@ -370,22 +383,22 @@ msgstr "连接比特币钱包"
msgid "Connect BTC wallet to access fee rate settings."
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:141
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:134
msgid "Connect request is already pending"
msgstr ""
#: src/app/[lang]/wallet/Wallet.tsx:77
#: src/connect-ui/component/AuthButton/AuthButton.tsx:63
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:220
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:213
#: src/connect-ui/component/ConnectWallet/ConnectWallet.tsx:35
msgid "Connect Wallet"
msgstr "连接钱包"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:302
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:295
msgid "Connect your Bitcoin Wallet (Optional)"
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:287
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:280
msgid "Connect your EVM Wallet (Mandatory)"
msgstr ""
@@ -537,8 +550,8 @@ msgstr ""
msgid "Estimated within the next block"
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:144
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:180
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:137
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:173
msgid "Failed to connect to {0}"
msgstr ""
@@ -600,7 +613,7 @@ msgid "Follow the steps of <0>this guide0> to provide liquity into a DEX pool
msgstr "按照 <0>本指南0> 的步骤为Oku上的DEX池提供流动性。"
#: src/app/[lang]/(bridge)/components/BannerCarousel/XBanner.tsx:18
-#: src/app/[lang]/fusion/Fusion.tsx:120
+#: src/app/[lang]/fusion/Fusion.tsx:124
msgid "Follow us on X"
msgstr ""
@@ -651,8 +664,8 @@ msgstr ""
msgid "Get tickets"
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:195
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:209
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:188
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:202
msgid "go back"
msgstr ""
@@ -688,7 +701,7 @@ msgstr ""
#~ msgid "Harvest {pointsMissing} more SPICE to your account to play"
#~ msgstr ""
-#: src/app/[lang]/fusion/Fusion.tsx:95
+#: src/app/[lang]/fusion/Fusion.tsx:99
msgid "Harvest Spice by depositing into BOB apps, voting, and solving quests. Keep an eye out for special events."
msgstr "通过存入BOB应用、投票和完成任务来收获Spice。密切关注特别活动"
@@ -696,7 +709,7 @@ msgstr "通过存入BOB应用、投票和完成任务来收获Spice。密切关
msgid "Here are your active referrals and the Spice they're currently earning for you. The more they earn, the more you benefit!"
msgstr "这里展示了你推荐的活跃用户及他们为你赚取的Spice。他们赚得越多,你获益越多!"
-#: src/app/[lang]/fusion/Fusion.tsx:88
+#: src/app/[lang]/fusion/Fusion.tsx:92
msgid "Hero dots"
msgstr ""
@@ -753,7 +766,7 @@ msgid "Leaderboard"
msgstr "排行榜"
#: src/app/[lang]/fusion/components/WelcomeBackModal/WelcomeBackModal.tsx:81
-#: src/app/[lang]/fusion/Fusion.tsx:105
+#: src/app/[lang]/fusion/Fusion.tsx:109
msgid "Learn More"
msgstr "了解更多"
@@ -946,6 +959,10 @@ msgstr ""
msgid "No new goal at the moment. Stay tuned for updates!"
msgstr "目前暂无新目标。请保持关注更新!"
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:47
+msgid "No Thanks"
+msgstr ""
+
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:50
#~ msgid "Not enough spice"
#~ msgstr ""
@@ -970,7 +987,7 @@ msgstr ""
msgid "OKX Cryptopedia"
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:252
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:245
msgid "On BOB, you have the option to link both your EVM and BTC wallets. For optimal functionality, it's advised to connect wallets from both networks."
msgstr ""
@@ -1033,7 +1050,7 @@ msgstr "比特币 + 以太坊共同驱动"
msgid "Preparing..."
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:272
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:265
msgid "Privacy policy"
msgstr ""
@@ -1162,11 +1179,11 @@ msgstr "第3季收获的Spice"
msgid "Season Three"
msgstr "第三季"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:217
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:210
msgid "Select Bitcoin Wallet"
msgstr ""
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:203
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:196
msgid "Select EVM Wallet"
msgstr ""
@@ -1409,7 +1426,7 @@ msgstr "条款与条件"
msgid "Take em home"
msgstr "回到主页"
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:264
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:257
msgid "Terms of Service"
msgstr ""
@@ -1528,7 +1545,7 @@ msgid "To cast your vote, please log in"
msgstr ""
#: src/app/[lang]/(bridge)/components/BannerCarousel/XBanner.tsx:22
-#: src/app/[lang]/fusion/Fusion.tsx:123
+#: src/app/[lang]/fusion/Fusion.tsx:127
msgid "To stay up-to date with the BOB ecosystem follow @build_on_bob."
msgstr ""
@@ -1644,7 +1661,7 @@ msgstr "用你的Spice总数来支持你最喜爱的BOB构建者。获胜者将
#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:110
#: src/components/LoginButton/LoginButton.tsx:27
-#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:137
+#: src/connect-ui/component/ConnectModal/ConnectModal.tsx:130
msgid "User rejected the request"
msgstr ""
@@ -1766,6 +1783,10 @@ msgstr "收益资产"
msgid "You"
msgstr ""
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:26
+msgid "You are one of the top 100 Spice holders in BOB Fusion"
+msgstr ""
+
#: src/app/[lang]/(bridge)/components/GatewayTransactionDetails/GatewayTransactionDetails.tsx:76
msgid "You are using a BTC address type (Taproot/P2TR) which we don't support yet. Change the BTC address type to Native SegWit in your wallet to continue."
msgstr ""
diff --git a/apps/evm/src/utils/api-client.ts b/apps/evm/src/utils/api-client.ts
index 099838df7..ef87c8f5a 100644
--- a/apps/evm/src/utils/api-client.ts
+++ b/apps/evm/src/utils/api-client.ts
@@ -128,6 +128,9 @@ export type UserResponse = {
quests_breakdown: Record;
total_quest_points: string;
season3Data: Season3Data;
+ notices: {
+ showIsFusionTopUser: boolean;
+ };
};
type LeaderboardResponse = {
@@ -560,6 +563,15 @@ class ApiClient {
return response.json();
}
+ async dismissTopUserModal(): Promise {
+ const response = await fetch(`${this.baseUrl}/me/dismiss-fusion-top-user-notice`, {
+ method: 'POST',
+ credentials: 'include'
+ });
+
+ return response.json();
+ }
+
async getLastVotingResults(): Promise {
const response = await fetch(`${this.baseUrl}/finalized-voting-round/latest/results`);
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4fb06f9bd..7031978af 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -427,6 +427,9 @@ importers:
react:
specifier: ^18.2.0
version: 18.3.1
+ react-calendly:
+ specifier: ^4.3.1
+ version: 4.3.1(react-dom@18.3.1)(react@18.3.1)
react-dom:
specifier: ^18.2.0
version: 18.3.1(react@18.3.1)
@@ -22111,6 +22114,17 @@ packages:
unpipe: 1.0.0
dev: true
+ /react-calendly@4.3.1(react-dom@18.3.1)(react@18.3.1):
+ resolution: {integrity: sha512-poyUH3NOUOlsotr8ho5WzbsbPuRAppaY+Jvu+C/PkwTP6WT807pNFI8+HrbbuRknXZbd75zpzysOJQvcu3P8Pg==}
+ engines: {node: '>=8', npm: '>=5'}
+ peerDependencies:
+ react: ^18.2.0
+ react-dom: ^18.2.0
+ dependencies:
+ react: 18.3.1
+ react-dom: 18.3.1(react@18.3.1)
+ dev: false
+
/react-clientside-effect@1.2.6(react@18.3.1):
resolution: {integrity: sha512-XGGGRQAKY+q25Lz9a/4EPqom7WRjz3z9R2k4jhVKA/puQFH/5Nt27vFZYql4m4NVNdUvX8PS3O7r/Zzm7cjUlg==}
peerDependencies:
From 6d64514a3a3519e2120898c566938ccd9bce3337 Mon Sep 17 00:00:00 2001
From: Slava
Date: Thu, 14 Nov 2024 11:23:25 +0300
Subject: [PATCH 02/17] chore: cast to string[]
---
apps/evm/src/lib/react-query/keys.ts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apps/evm/src/lib/react-query/keys.ts b/apps/evm/src/lib/react-query/keys.ts
index ed68c0845..47892a9eb 100644
--- a/apps/evm/src/lib/react-query/keys.ts
+++ b/apps/evm/src/lib/react-query/keys.ts
@@ -75,7 +75,7 @@ export const appsKeys = {
apps: () => ['apps'],
appsVotes: (username: string | undefined) => [...appsKeys.apps(), 'votes', username],
appsResultVotes: () => [...appsKeys.apps(), 'result-votes'],
- vote: (username: string | undefined) => [appsKeys.apps(), 'vote', username]
+ vote: (username: string | undefined) => [appsKeys.apps(), 'vote', username] as string[]
};
export const fusionKeys = {
@@ -85,7 +85,7 @@ export const fusionKeys = {
tokenInfo: () => [...fusionKeys.fusion(), 'token-info'],
quests: () => [...fusionKeys.fusion(), 'quests'],
tvlLevel: () => [...fusionKeys.fusion(), 'tvl-level'],
- lotteryStats: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-stats', username],
- lotteryRoll: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-roll', username],
- topUserModal: (username: string | undefined) => [...fusionKeys.fusion(), 'top-user-modal', username]
+ lotteryStats: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-stats', username] as string[],
+ lotteryRoll: (username: string | undefined) => [...fusionKeys.fusion(), 'lottery-roll', username] as string[],
+ topUserModal: (username: string | undefined) => [...fusionKeys.fusion(), 'top-user-modal', username] as string[]
};
From fc41a85beae82d26ecd1075cfc036011b764456c Mon Sep 17 00:00:00 2001
From: Slava
Date: Thu, 14 Nov 2024 13:06:51 +0300
Subject: [PATCH 03/17] chore: refetch lottery draw time every hour
---
.../LotteryModal/LotteryModal.tsx | 8 ++++----
.../LotterySections/LotterySections.tsx | 10 +++-------
.../components/LotterySections/constants.ts | 5 -----
.../components/LotterySections/hooks/index.ts | 1 +
.../LotterySections/hooks/useTimeToNextDraw.ts | 18 ++++++++++++++++++
5 files changed, 26 insertions(+), 16 deletions(-)
delete mode 100644 apps/evm/src/app/[lang]/fusion/components/LotterySections/constants.ts
create mode 100644 apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/index.ts
create mode 100644 apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx b/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx
index 6e845e7d9..56114ac20 100644
--- a/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx
+++ b/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx
@@ -17,12 +17,11 @@ import {
useLocale
} from '@gobob/ui';
import { Plural, Trans } from '@lingui/macro';
-import { formatDistanceToNow } from 'date-fns';
import { useParams } from 'next/navigation';
-import { ROUND_END_TIME } from '../constants';
import { Ticket } from '../icons';
import confettiAnimationData from '../lotties/confettie.json';
+import { useTimeToNextDraw } from '../hooks';
import { StyledButton, StyledLottie, StyledPoints } from './LotteryModal.style';
@@ -50,6 +49,7 @@ const LotteryModal = ({
const { lang } = useParams();
const { locale } = useLocale();
const { data: user } = useGetUser();
+ const { data: timeToNextDraw } = useTimeToNextDraw();
const {
data: lotteryRollData,
isIdle,
@@ -67,7 +67,7 @@ const LotteryModal = ({
}>
- new tickets drop in {formatDistanceToNow(ROUND_END_TIME)}
+ new tickets drop in {timeToNextDraw}
@@ -160,7 +160,7 @@ const LotteryModal = ({
}>
- new tickets drop in {formatDistanceToNow(ROUND_END_TIME)}
+ new tickets drop in {timeToNextDraw}
{getHeaderText()}
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx b/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx
index f563af07b..4b71f90cc 100644
--- a/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx
+++ b/apps/evm/src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx
@@ -1,7 +1,6 @@
import { Chip, Flex, H2, P, SolidClock, Span, Skeleton } from '@gobob/ui';
import { useAccount } from '@gobob/wagmi';
import { Plural, t, Trans } from '@lingui/macro';
-import { formatDistanceToNow } from 'date-fns';
import { useState } from 'react';
import Image from 'next/image';
import { useIsClient } from 'usehooks-ts';
@@ -10,7 +9,7 @@ import lottery from '@public/assets/lottery.png';
import { LotteryModal } from './LotteryModal';
import { StyledButton, StyledCard } from './LotterySections.style';
-import { ROUND_END_TIME } from './constants';
+import { useTimeToNextDraw } from './hooks';
import { useGetUser, useLotteryStats } from '@/hooks';
@@ -21,6 +20,7 @@ const LotterySection = () => {
const { data: user } = useGetUser();
const { data: lotteryStatsData, isError, isLoading } = useLotteryStats();
const { i18n } = useLingui();
+ const { data: timeToNextDraw } = useTimeToNextDraw();
return (
<>
@@ -46,11 +46,7 @@ const LotterySection = () => {
}>
- {isClient ? (
- {formatDistanceToNow(ROUND_END_TIME)} until next draw
- ) : (
-
- )}
+ {isClient ? {timeToNextDraw} until next draw : }
{!isClient || (!address && isClient) || !user || isError || isLoading ? (
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/constants.ts b/apps/evm/src/app/[lang]/fusion/components/LotterySections/constants.ts
deleted file mode 100644
index 614df1859..000000000
--- a/apps/evm/src/app/[lang]/fusion/components/LotterySections/constants.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-const date = new Date();
-
-date.setUTCHours(24, 0, 0, 0);
-
-export const ROUND_END_TIME = date;
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/index.ts b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/index.ts
new file mode 100644
index 000000000..7b3fa89d1
--- /dev/null
+++ b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/index.ts
@@ -0,0 +1 @@
+export { useTimeToNextDraw } from './useTimeToNextDraw';
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
new file mode 100644
index 000000000..3643f5172
--- /dev/null
+++ b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
@@ -0,0 +1,18 @@
+import { INTERVAL, useQuery } from '@gobob/react-query';
+import { formatDistanceToNow } from 'date-fns';
+
+const useTimeToNextDraw = () => {
+ return useQuery({
+ queryKey: ['lottery-time-to-next-draw'],
+ queryFn: () => {
+ const date = new Date();
+
+ date.setUTCHours(24, 0, 0, 0);
+
+ return formatDistanceToNow(date);
+ },
+ refetchInterval: INTERVAL.HOUR
+ });
+};
+
+export { useTimeToNextDraw };
From 474d67f7c5bdcedd018478216cddd46245a6cb37 Mon Sep 17 00:00:00 2001
From: Slava
Date: Mon, 18 Nov 2024 14:39:21 +0300
Subject: [PATCH 04/17] chore: improve color scheme for modal
---
.../[lang]/fusion/components/TopUserModal/TopUserModal.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
index 01ed022a7..b9eaddda6 100644
--- a/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
+++ b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
@@ -1,4 +1,5 @@
import { Button, H3, Link, Modal, ModalBody, ModalFooter, ModalProps, P } from '@gobob/ui';
+import { colors } from '@gobob/ui/src/theme/themes/bob/colors';
import { Trans } from '@lingui/macro';
import { useState } from 'react';
import { PopupModal, useCalendlyEventListener } from 'react-calendly';
@@ -50,6 +51,11 @@ const TopUserModal = ({ onClose, isOpen, ...props }: TopUserModalProps): JSX.Ele
setIsCalendlyOpen(false)}
From 2b08c55462db00fca18bec86b3b0eb3ae0ac26db Mon Sep 17 00:00:00 2001
From: Slava
Date: Mon, 18 Nov 2024 22:47:21 +0300
Subject: [PATCH 05/17] chore: off color scheme
---
apps/evm/src/app/[lang]/index.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/evm/src/app/[lang]/index.css b/apps/evm/src/app/[lang]/index.css
index efc40e805..0a23e7a5f 100644
--- a/apps/evm/src/app/[lang]/index.css
+++ b/apps/evm/src/app/[lang]/index.css
@@ -9,7 +9,7 @@
font-weight: 400;
color: #ffffff;
- color-scheme: light dark;
+ /* color-scheme: light dark; */
font-synthesis: none;
text-rendering: optimizeLegibility;
From f34245746897b24de91ac59a4dad706891112f01 Mon Sep 17 00:00:00 2001
From: Slava
Date: Wed, 20 Nov 2024 16:32:19 +0300
Subject: [PATCH 06/17] chore: set update time to minute
---
.../components/LotterySections/hooks/useTimeToNextDraw.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
index 3643f5172..9cf4a99ac 100644
--- a/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
+++ b/apps/evm/src/app/[lang]/fusion/components/LotterySections/hooks/useTimeToNextDraw.ts
@@ -11,7 +11,7 @@ const useTimeToNextDraw = () => {
return formatDistanceToNow(date);
},
- refetchInterval: INTERVAL.HOUR
+ refetchInterval: INTERVAL.MINUTE
});
};
From 93f894be1903c4c3ea288cdd68d219a6ef765dd7 Mon Sep 17 00:00:00 2001
From: Slava
Date: Wed, 20 Nov 2024 17:21:09 +0300
Subject: [PATCH 07/17] chore: send gtm event on iframe events
---
.../[lang]/fusion/components/TopUserModal/TopUserModal.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
index b9eaddda6..7fff3a8fe 100644
--- a/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
+++ b/apps/evm/src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx
@@ -3,6 +3,7 @@ import { colors } from '@gobob/ui/src/theme/themes/bob/colors';
import { Trans } from '@lingui/macro';
import { useState } from 'react';
import { PopupModal, useCalendlyEventListener } from 'react-calendly';
+// import { sendGTMEvent } from '@next/third-parties/google';
type Props = {
onClose: () => void;
@@ -16,7 +17,10 @@ const TopUserModal = ({ onClose, isOpen, ...props }: TopUserModalProps): JSX.Ele
const [isCalendlyOpen, setIsCalendlyOpen] = useState(false);
useCalendlyEventListener({
- onEventScheduled: onClose
+ onEventScheduled: () => {
+ // sendGTMEvent(e.data); // send `.event` and `.payload`
+ onClose();
+ }
});
return (
From 79c9b783a8edbdb26308c404f964db877255db6f Mon Sep 17 00:00:00 2001
From: Slava
Date: Wed, 20 Nov 2024 17:54:01 +0300
Subject: [PATCH 08/17] chore: extract messages
---
apps/evm/src/locales/en.po | 37 +++++++++++++++++++++++--------------
apps/evm/src/locales/zh.po | 35 ++++++++++++++++++++++-------------
2 files changed, 45 insertions(+), 27 deletions(-)
diff --git a/apps/evm/src/locales/en.po b/apps/evm/src/locales/en.po
index 6aadd7d61..f804fb211 100644
--- a/apps/evm/src/locales/en.po
+++ b/apps/evm/src/locales/en.po
@@ -31,8 +31,8 @@ msgid "{0} remaining"
msgstr "{0} remaining"
#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:50
-msgid "{0} until next draw"
-msgstr "{0} until next draw"
+#~ msgid "{0} until next draw"
+#~ msgstr "{0} until next draw"
#: src/app/[lang]/fusion/components/Quest/Quest.tsx:40
msgid "{0} until quest ends"
@@ -42,6 +42,10 @@ msgstr "{0} until quest ends"
msgid "{0} until voting round ends"
msgstr "{0} until voting round ends"
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:49
+msgid "{timeToNextDraw} until next draw"
+msgstr "{timeToNextDraw} until next draw"
+
#: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:226
msgid "* The multipliers displayed are subject to change based on the payout structure of the respective projects."
msgstr "* The multipliers displayed are subject to change based on the payout structure of the respective projects."
@@ -50,7 +54,7 @@ msgstr "* The multipliers displayed are subject to change based on the payout st
msgid "< 1 minute"
msgstr "< 1 minute"
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:59
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:55
msgid "<0>{0} {1, plural, one {Ticket} other {Tickets}} 0>Remaining"
msgstr "<0>{0} {1, plural, one {Ticket} other {Tickets}} 0>Remaining"
@@ -142,7 +146,7 @@ msgstr "Apps"
msgid "Apps Used"
msgstr "Apps Used"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:29
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:34
msgid "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
msgstr "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
@@ -198,7 +202,7 @@ msgstr "BOB"
msgid "BOB Bridge"
msgstr "BOB Bridge"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:35
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:40
msgid "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
msgstr "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
@@ -236,7 +240,7 @@ msgstr "BOB TVL Progress"
msgid "BOB Wallet"
msgstr "BOB Wallet"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:44
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:49
msgid "Book Meeting"
msgstr "Book Meeting"
@@ -588,7 +592,7 @@ msgstr "Featured Assets"
msgid "Fee"
msgstr "Fee"
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:69
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:65
msgid "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day."
msgstr "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day."
@@ -825,7 +829,7 @@ msgstr "Log in"
msgid "Log in to View Dashboard"
msgstr "Log in to View Dashboard"
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:81
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:77
msgid "Login to play"
msgstr "Login to play"
@@ -834,7 +838,7 @@ msgid "Login with wallet"
msgstr "Login with wallet"
#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:36
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:57
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:53
msgid "Lottery"
msgstr "Lottery"
@@ -944,8 +948,13 @@ msgstr "New Quests Coming Soon"
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:70
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:163
-msgid "new tickets drop in {0}"
-msgstr "new tickets drop in {0}"
+#~ msgid "new tickets drop in {0}"
+#~ msgstr "new tickets drop in {0}"
+
+#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:70
+#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:163
+msgid "new tickets drop in {timeToNextDraw}"
+msgstr "new tickets drop in {timeToNextDraw}"
#: src/app/[lang]/wallet/Wallet.tsx:70
msgid "No assets shown"
@@ -959,7 +968,7 @@ msgstr "No bridging operations found"
msgid "No new goal at the moment. Stay tuned for updates!"
msgstr "No new goal at the moment. Stay tuned for updates!"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:47
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:52
msgid "No Thanks"
msgstr "No Thanks"
@@ -1017,7 +1026,7 @@ msgid "Pending"
msgstr "Pending"
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:208
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:81
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:77
msgid "Play"
msgstr "Play"
@@ -1787,7 +1796,7 @@ msgstr "Yield Assets"
msgid "You"
msgstr "You"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:26
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:31
msgid "You are one of the top 100 Spice holders in BOB Fusion"
msgstr "You are one of the top 100 Spice holders in BOB Fusion"
diff --git a/apps/evm/src/locales/zh.po b/apps/evm/src/locales/zh.po
index eb4b61db4..fa41c172b 100644
--- a/apps/evm/src/locales/zh.po
+++ b/apps/evm/src/locales/zh.po
@@ -31,8 +31,8 @@ msgid "{0} remaining"
msgstr ""
#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:50
-msgid "{0} until next draw"
-msgstr ""
+#~ msgid "{0} until next draw"
+#~ msgstr ""
#: src/app/[lang]/fusion/components/Quest/Quest.tsx:40
msgid "{0} until quest ends"
@@ -42,6 +42,10 @@ msgstr "距离任务结束还有{0}"
msgid "{0} until voting round ends"
msgstr "距离投票轮结束还有{0}"
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:49
+msgid "{timeToNextDraw} until next draw"
+msgstr ""
+
#: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:226
msgid "* The multipliers displayed are subject to change based on the payout structure of the respective projects."
msgstr "* 显示的倍数可能会根据相应项目的支付结构而变化。"
@@ -50,7 +54,7 @@ msgstr "* 显示的倍数可能会根据相应项目的支付结构而变化。"
msgid "< 1 minute"
msgstr ""
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:59
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:55
msgid "<0>{0} {1, plural, one {Ticket} other {Tickets}} 0>Remaining"
msgstr ""
@@ -142,7 +146,7 @@ msgstr ""
msgid "Apps Used"
msgstr "已体验的应用"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:29
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:34
msgid "As one of our most important community members, we would love the opportunity to gain your input on the BOB ecosystem and our future plans."
msgstr ""
@@ -198,7 +202,7 @@ msgstr ""
msgid "BOB Bridge"
msgstr ""
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:35
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:40
msgid "BOB co-founder, <0>Alexei Zamyatin0>, would like to invite you to a private 1-to-1 call to hear your thoughts on BOB and Bitcoin DeFi. If you are interested, please click the button below to book a call at a time that suits you."
msgstr ""
@@ -236,7 +240,7 @@ msgstr "BOB TVL进度"
msgid "BOB Wallet"
msgstr "BOB 钱包"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:44
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:49
msgid "Book Meeting"
msgstr ""
@@ -588,7 +592,7 @@ msgstr "特色资产"
msgid "Fee"
msgstr ""
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:69
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:65
msgid "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day."
msgstr ""
@@ -825,7 +829,7 @@ msgstr "登录"
msgid "Log in to View Dashboard"
msgstr "登录查看仪表板"
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:81
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:77
msgid "Login to play"
msgstr ""
@@ -834,7 +838,7 @@ msgid "Login with wallet"
msgstr "使用钱包登录"
#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:36
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:57
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:53
msgid "Lottery"
msgstr ""
@@ -944,7 +948,12 @@ msgstr ""
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:70
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:163
-msgid "new tickets drop in {0}"
+#~ msgid "new tickets drop in {0}"
+#~ msgstr ""
+
+#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:70
+#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:163
+msgid "new tickets drop in {timeToNextDraw}"
msgstr ""
#: src/app/[lang]/wallet/Wallet.tsx:70
@@ -959,7 +968,7 @@ msgstr ""
msgid "No new goal at the moment. Stay tuned for updates!"
msgstr "目前暂无新目标。请保持关注更新!"
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:47
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:52
msgid "No Thanks"
msgstr ""
@@ -1017,7 +1026,7 @@ msgid "Pending"
msgstr ""
#: src/app/[lang]/fusion/components/LotterySections/LotteryModal/LotteryModal.tsx:208
-#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:81
+#: src/app/[lang]/fusion/components/LotterySections/LotterySections.tsx:77
msgid "Play"
msgstr ""
@@ -1783,7 +1792,7 @@ msgstr "收益资产"
msgid "You"
msgstr ""
-#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:26
+#: src/app/[lang]/fusion/components/TopUserModal/TopUserModal.tsx:31
msgid "You are one of the top 100 Spice holders in BOB Fusion"
msgstr ""
From 5d299be322ad38fe8bc99fd7d2363178c9a682ac Mon Sep 17 00:00:00 2001
From: Slava
Date: Wed, 20 Nov 2024 20:36:09 +0300
Subject: [PATCH 09/17] chore: localize format distance to now
---
.../lingui.config.ts} | 11 ++-
.../lingui.config.js => evm/lingui.config.ts} | 9 +-
.../components/BridgeStatus/TimeStep.tsx | 2 +-
.../TransactionList/TransactionDetails.tsx | 5 +-
.../VotingDashboard/UserVotingInfo.tsx | 88 +++++++++++--------
.../CommunityVoting/CommunityVoting.tsx | 10 ++-
.../LotteryModal/LotteryModal.tsx | 2 +-
.../LotterySections/LotterySections.tsx | 4 +-
.../hooks/useTimeToNextDraw.ts | 6 +-
.../[lang]/fusion/components/Quest/Quest.tsx | 11 ++-
apps/evm/src/utils/index.ts | 1 +
apps/evm/src/utils/locale.ts | 12 +++
12 files changed, 108 insertions(+), 53 deletions(-)
rename apps/{evm/lingui.config.js => bob-pay/lingui.config.ts} (50%)
rename apps/{bob-pay/lingui.config.js => evm/lingui.config.ts} (59%)
create mode 100644 apps/evm/src/utils/locale.ts
diff --git a/apps/evm/lingui.config.js b/apps/bob-pay/lingui.config.ts
similarity index 50%
rename from apps/evm/lingui.config.js
rename to apps/bob-pay/lingui.config.ts
index 82f1610ab..5124ecf01 100644
--- a/apps/evm/lingui.config.js
+++ b/apps/bob-pay/lingui.config.ts
@@ -1,6 +1,7 @@
-/** @type {import('@lingui/conf').LinguiConfig} */
-module.exports = {
- locales: ['en', 'zh'],
+import { LinguiConfig } from '@lingui/conf';
+
+const config = {
+ locales: ['en', 'zh'] as const,
sourceLocale: 'en',
fallbackLocales: {
default: 'en'
@@ -11,4 +12,6 @@ module.exports = {
include: ['src/']
}
]
-};
+} as const satisfies LinguiConfig;
+
+export default config;
diff --git a/apps/bob-pay/lingui.config.js b/apps/evm/lingui.config.ts
similarity index 59%
rename from apps/bob-pay/lingui.config.js
rename to apps/evm/lingui.config.ts
index 82f1610ab..7685ec857 100644
--- a/apps/bob-pay/lingui.config.js
+++ b/apps/evm/lingui.config.ts
@@ -1,5 +1,6 @@
-/** @type {import('@lingui/conf').LinguiConfig} */
-module.exports = {
+import { LinguiConfig } from '@lingui/conf';
+
+const config = {
locales: ['en', 'zh'],
sourceLocale: 'en',
fallbackLocales: {
@@ -11,4 +12,6 @@ module.exports = {
include: ['src/']
}
]
-};
+} as const satisfies LinguiConfig;
+
+export default config;
diff --git a/apps/evm/src/app/[lang]/(bridge)/components/BridgeStatus/TimeStep.tsx b/apps/evm/src/app/[lang]/(bridge)/components/BridgeStatus/TimeStep.tsx
index 358c5a714..520232519 100644
--- a/apps/evm/src/app/[lang]/(bridge)/components/BridgeStatus/TimeStep.tsx
+++ b/apps/evm/src/app/[lang]/(bridge)/components/BridgeStatus/TimeStep.tsx
@@ -44,7 +44,7 @@ const TimeStep = ({ step, data, currentStep }: TimeStepProps): JSX.Element => {
return step === 'challenge-period' ? 7 days : 2 hours;
}
- return {formatDistanceToNow(data.statusEndDate)} remaining;
+ return {formatDistanceToNow(data.statusEndDate, {})} remaining;
}, [step, currentStep, data.statusEndDate]);
return (
diff --git a/apps/evm/src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx b/apps/evm/src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx
index 2f09c9c61..776e56f39 100644
--- a/apps/evm/src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx
+++ b/apps/evm/src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx
@@ -3,11 +3,13 @@ import { Currency, CurrencyAmount } from '@gobob/currency';
import { ArrowLongRight, Flex, FlexProps, P, UnstyledButton } from '@gobob/ui';
import { Trans } from '@lingui/macro';
import { formatDistanceToNow } from 'date-fns';
+import { useParams } from 'next/navigation';
import { StyledDetailsButton, StyledExpandIcon } from './TransactionList.style';
import { Chain } from '@/components';
import { TransactionDirection } from '@/types';
+import { getLocale } from '@/utils';
type Props = {
direction: TransactionDirection;
@@ -35,6 +37,7 @@ const TransactionDetails = ({
onExpand,
...props
}: TransactionDetailsProps): JSX.Element => {
+ const { lang } = useParams();
const directionLabel = direction === TransactionDirection.L1_TO_L2 ? Deposit : Withdraw;
const isExpandable = !!onExpand;
@@ -46,7 +49,7 @@ const TransactionDetails = ({
{directionLabel}
- {formatDistanceToNow(date)} ago
+ {formatDistanceToNow(date, { locale: getLocale(lang as Parameters[0]) })} ago
diff --git a/apps/evm/src/app/[lang]/apps/components/VotingDashboard/UserVotingInfo.tsx b/apps/evm/src/app/[lang]/apps/components/VotingDashboard/UserVotingInfo.tsx
index a9f81777f..dcfd4d474 100644
--- a/apps/evm/src/app/[lang]/apps/components/VotingDashboard/UserVotingInfo.tsx
+++ b/apps/evm/src/app/[lang]/apps/components/VotingDashboard/UserVotingInfo.tsx
@@ -1,51 +1,65 @@
import { Card, Dd, Divider, Dl, DlGroup, Dt, Flex, P, Skeleton, SolidClock, Span, Tooltip } from '@gobob/ui';
import { formatDistanceToNow } from 'date-fns';
import { Trans } from '@lingui/macro';
+import { useParams } from 'next/navigation';
import { SpiceChip } from '../SpiceChip';
import { LoginButton, SignUpButton } from '@/components';
+import { getLocale } from '@/utils';
type Props = { isAuthenticated?: boolean; roundEndsAt?: string; votesRemaining?: number };
type UserVotingInfoProps = Props;
-const UserVotingInfo = ({ isAuthenticated, roundEndsAt, votesRemaining }: UserVotingInfoProps): JSX.Element => (
-
- <>
- {isAuthenticated ? (
-
-
-
- Votes Left:
-
-
-
-
-
-
- ) : (
-
-
- Log in
-
-
- or
-
-
- Create Account
-
-
- )}
-
- Time left until voting round ends}>
-
-
- {roundEndsAt ?