Skip to content

Commit

Permalink
feat: add tooltip for Earn APT. (#6097)
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming authored Oct 29, 2024
1 parent 5484445 commit 6911248
Show file tree
Hide file tree
Showing 22 changed files with 394 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { GridItem } from './GridItem';
type IProfitInfoProps = {
apr?: string;
earningsIn24h?: string;
rewardToken?: string;
rewardTokens?: string;
updateFrequency?: string;
unstakingPeriod?: number;
Expand All @@ -25,6 +26,7 @@ type IProfitInfoProps = {
function ProfitInfo({
apr,
earningsIn24h,
rewardToken,
rewardTokens,
updateFrequency,
unstakingPeriod,
Expand Down Expand Up @@ -106,6 +108,13 @@ function ProfitInfo({
title={intl.formatMessage({
id: ETranslations.earn_unstaking_period,
})}
tooltip={
rewardToken === 'APT'
? intl.formatMessage({
id: ETranslations.earn_earn_during_unstaking_tooltip,
})
: undefined
}
>
{intl.formatMessage(
{ id: ETranslations.earn_up_to_number_days },
Expand All @@ -130,6 +139,7 @@ export const ProfitSection = ({
const props: IProfitInfoProps = {
apr: Number(details.provider?.apr) > 0 ? details.provider.apr : undefined,
earningsIn24h: details.earnings24h,
rewardToken: details.rewardToken,
rewardTokens: details.rewardToken,
// updateFrequency: details.updateFrequency,
earnPoints: details.provider.earnPoints,
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/locale/enum/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@
earn_currently_staking = 'earn.currently_staking',
earn_daily = 'earn.daily',
earn_early_withdraw_stake_unstaking_period = 'earn.early_withdraw_stake_unstaking_period',
earn_earn_during_unstaking_tooltip = 'earn.earn_during_unstaking_tooltip',
earn_earn_points = 'earn.earn_points',
earn_earn_points_desc = 'earn.earn_points_desc',
earn_earn_symbol = 'earn.earn_symbol',
Expand Down Expand Up @@ -709,6 +710,7 @@
global_404_message = 'global.404_message',
global_Note = 'global.Note',
global_about = 'global.about',
global_account = 'global.account',
global_account_name = 'global.account_name',
global_accounts = 'global.accounts',
global_acknowledged = 'global.acknowledged',
Expand Down Expand Up @@ -991,6 +993,9 @@
global_qr_code = 'global.qr_code',
global_quit = 'global.quit',
global_receive = 'global.receive',
global_receive_address_confirmation = 'global.receive_address_confirmation',
global_receive_address_confirmation_button = 'global.receive_address_confirmation_button',
global_receive_address_confirmation_desc = 'global.receive_address_confirmation_desc',
global_recent_searched = 'global.recent_searched',
global_recents = 'global.recents',
global_recipient = 'global.recipient',
Expand Down Expand Up @@ -1636,6 +1641,7 @@
settings_set_auto_lock_duration_mobile = 'settings.set_auto_lock_duration_mobile',
settings_set_auto_lock_duration_web = 'settings.set_auto_lock_duration_web',
settings_settings = 'settings.settings',
settings_shortcuts = 'settings.shortcuts',
settings_sign_text = 'settings.sign_text',
settings_signature_record = 'settings.signature_record',
settings_spend_dust_utxo = 'settings.spend_dust_utxo',
Expand Down Expand Up @@ -1664,6 +1670,18 @@
settings_view_address_in_explorer = 'settings.view_address_in_explorer',
settings_view_transaction_in_explorer = 'settings.view_transaction_in_explorer',
settings_whats_new = 'settings.whats_new',
shortcut_go_back = 'shortcut.go_back',
shortcut_go_forward = 'shortcut.go_forward',
shortcut_hide_sidebar = 'shortcut.hide_sidebar',
shortcut_show_sidebar = 'shortcut.show_sidebar',
shortcuts_account_selector = 'shortcuts.account_selector',
shortcuts_close_current_tab = 'shortcuts.close_current_tab',
shortcuts_go_to_browser_tab = 'shortcuts.go_to_browser_tab',
shortcuts_go_to_earn_tab = 'shortcuts.go_to_earn_tab',
shortcuts_go_to_market_tab = 'shortcuts.go_to_market_tab',
shortcuts_go_to_swap_tab = 'shortcuts.go_to_swap_tab',
shortcuts_go_to_wallet_tab = 'shortcuts.go_to_wallet_tab',
shortcuts_network_selector = 'shortcuts.network_selector',
skip_verify_text = 'skip_verify_text',
slippage_tolerance_button_save = 'slippage_tolerance.button_save',
slippage_tolerance_description = 'slippage_tolerance.description',
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/locale/json/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"earn.currently_staking": "বর্তমানে স্টেকিং করা হচ্ছে",
"earn.daily": "দৈনিক",
"earn.early_withdraw_stake_unstaking_period": "{number} দিনের অনস্টেকিং পর্ব সহ যে কোন সময় আপনার স্টেক প্রারম্ভিক উপস্থাপন করুন",
"earn.earn_during_unstaking_tooltip": "উত্তোলনের পর আনস্টেকিং সময়কালে সম্পদগুলি পুরস্কার অর্জন করতে থাকবে।",
"earn.earn_points": "পয়েন্ট অর্জন করুন",
"earn.earn_points_desc": "OneKey, বাবিলনের সাথে যোগদান করে, যা আপনাকে বাবিলনের কাজ সম্পন্ন করে এবং পয়েন্ট অর্জন করতে সক্ষম করে।",
"earn.earn_symbol": "{symbol} উপার্জন করুন",
Expand Down Expand Up @@ -704,6 +705,7 @@
"global.404_message": "দুঃখিত, কিছু ভুল হয়েছে!",
"global.Note": "নোট",
"global.about": "সম্পর্কে",
"global.account": "হিসাব",
"global.account_name": "অ্যাকাউন্টের নাম",
"global.accounts": "অ্যাকাউন্টস",
"global.acknowledged": "স্বীকৃত",
Expand Down Expand Up @@ -986,6 +988,9 @@
"global.qr_code": "কিউআর কোড",
"global.quit": "বন্ধ করুন",
"global.receive": "পান",
"global.receive_address_confirmation": "ঠিকানা নিশ্চিতকরণ",
"global.receive_address_confirmation_button": "আমি ঝুঁকি নেব",
"global.receive_address_confirmation_desc": "অযাচাইকৃত কার্যকলাপের ফলে সম্পদ ভুল ঠিকানায় পাঠানো হতে পারে, বিশেষ করে যদি স্থানীয় ডেটা টেম্পারিং বা রিসেটের পরে OneKey App পুনরায় সংযুক্ত না হয়।",
"global.recent_searched": "সাম্প্রতিক অনুসন্ধান",
"global.recents": "সাম্প্রতিক",
"global.recipient": "প্রাপক",
Expand Down Expand Up @@ -1631,6 +1636,7 @@
"settings.set_auto_lock_duration_mobile": "যখন অ্যাপটি বের হয়ে যাওয়া বা ডিভাইসের স্ক্রিন লক হয়ে যাওয়ার বিনা পটভূমিতে চলে, তখন এটি নির্দিষ্ট সময়ের পরে স্বয়ংক্রিয়ভাবে লক হয়ে যাবে।",
"settings.set_auto_lock_duration_web": "যখন অ্যাপটি একটি অব্যবহৃত ট্যাব বা সংকোচিত উইন্ডোতে থাকে, তখন এটি নির্দিষ্ট সময় পর স্বয়ংক্রিয়ভাবে লক হয়ে যাবে।",
"settings.settings": "সেটিংস",
"settings.shortcuts": "শর্টকাট",
"settings.sign_text": "সাইন টেক্সট",
"settings.signature_record": "স্বাক্ষর রেকর্ড",
"settings.spend_dust_utxo": "ধূলো ব্যয় করুন UTXO",
Expand Down Expand Up @@ -1659,6 +1665,18 @@
"settings.view_address_in_explorer": "এক্সপ্লোরারে ঠিকানা দেখুন",
"settings.view_transaction_in_explorer": "এক্সপ্লোরারে লেনদেন দেখুন",
"settings.whats_new": "কি নতুন",
"shortcut.go_back": "ফিরে যান",
"shortcut.go_forward": "এগিয়ে যান",
"shortcut.hide_sidebar": "সাইডবার লুকান",
"shortcut.show_sidebar": "সাইডবার দেখান",
"shortcuts.account_selector": "অ্যাকাউন্ট নির্বাচক",
"shortcuts.close_current_tab": "বর্তমান ট্যাব বন্ধ করুন",
"shortcuts.go_to_browser_tab": "ব্রাউজার ট্যাবে যান",
"shortcuts.go_to_earn_tab": "আয় ট্যাবে যান",
"shortcuts.go_to_market_tab": "মার্কেট ট্যাবে যান",
"shortcuts.go_to_swap_tab": "অদলবদল ট্যাবে যান",
"shortcuts.go_to_wallet_tab": "ওয়ালেট ট্যাবে যান",
"shortcuts.network_selector": "নেটওয়ার্ক নির্বাচক",
"skip_verify_text": "আমার ডিভাইসটি আমার সাথে নেই",
"slippage_tolerance.button_save": "সংরক্ষণ করুন",
"slippage_tolerance.description": "অটো স্লিপেজ পুল লিকুইডিটি এবং ট্রেডিং ভলিউমের উপর ভিত্তি করে স্লিপেজ অনুকূলন করে, লেনদেনের ব্যর্থতা এবং MEV হামলা ঝুঁকিগুলি হ্রাস করে।",
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/locale/json/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"earn.currently_staking": "Aktuell staking",
"earn.daily": "Täglich",
"earn.early_withdraw_stake_unstaking_period": "Ziehen Sie Ihren Einsatz jederzeit frühzeitig ab, mit einer Auszahlungsfrist von {number} Tagen",
"earn.earn_during_unstaking_tooltip": "Vermögenswerte werden während der Unstaking-Periode nach der Abhebung weiterhin Belohnungen verdienen.",
"earn.earn_points": "Sammle Punkte",
"earn.earn_points_desc": "OneKey arbeitet mit Babylon zusammen, was Ihnen ermöglicht, Babylons Aufgaben zu erfüllen und Punkte zu sammeln.",
"earn.earn_symbol": "Verdienen Sie {symbol}",
Expand Down Expand Up @@ -704,6 +705,7 @@
"global.404_message": "Entschuldigung, etwas ist schief gelaufen!",
"global.Note": "Hinweis",
"global.about": "Über",
"global.account": "Konto",
"global.account_name": "Kontoname",
"global.accounts": "Konten",
"global.acknowledged": "Anerkannt",
Expand Down Expand Up @@ -986,6 +988,9 @@
"global.qr_code": "QR-Code",
"global.quit": "Beenden",
"global.receive": "Erhalten",
"global.receive_address_confirmation": "Adressbestätigung",
"global.receive_address_confirmation_button": "Ich gehe das Risiko ein",
"global.receive_address_confirmation_desc": "Nicht verifizierte Aktionen können dazu führen, dass Vermögenswerte an die falsche Adresse gesendet werden, insbesondere wenn die OneKey App nach Manipulation oder Zurücksetzen lokaler Daten nicht erneut verbunden wird.",
"global.recent_searched": "Kürzlich gesucht",
"global.recents": "Kürzlich",
"global.recipient": "Empfänger",
Expand Down Expand Up @@ -1631,6 +1636,7 @@
"settings.set_auto_lock_duration_mobile": "Wenn die App im Hintergrund läuft, ohne beendet zu werden, oder wenn der Bildschirm des Geräts gesperrt ist, wird sie automatisch nach einer festgelegten Zeit gesperrt.",
"settings.set_auto_lock_duration_web": "Wenn die App in einem ungenutzten Tab oder minimierten Fenster ist, wird sie automatisch nach einer festgelegten Zeit gesperrt.",
"settings.settings": "Präferenzen",
"settings.shortcuts": "Verknüpfungen",
"settings.sign_text": "Schildtext",
"settings.signature_record": "Unterschriftenaufzeichnung",
"settings.spend_dust_utxo": "Staub-UTXO ausgeben",
Expand Down Expand Up @@ -1659,6 +1665,18 @@
"settings.view_address_in_explorer": "Adresse im Explorer anzeigen",
"settings.view_transaction_in_explorer": "Transaktion im Explorer anzeigen",
"settings.whats_new": "Was gibt's Neues",
"shortcut.go_back": "Geh zurück",
"shortcut.go_forward": "Weiter",
"shortcut.hide_sidebar": "Seitenleiste ausblenden",
"shortcut.show_sidebar": "Seitenleiste anzeigen",
"shortcuts.account_selector": "Kontoauswahl",
"shortcuts.close_current_tab": "Aktuellen Tab schließen",
"shortcuts.go_to_browser_tab": "Gehen Sie zur Registerkarte „Browser“",
"shortcuts.go_to_earn_tab": "Gehen Sie zur Registerkarte „Verdienen“",
"shortcuts.go_to_market_tab": "Zur Registerkarte „Markt“ gehen",
"shortcuts.go_to_swap_tab": "Zur Registerkarte „Austauschen“ gehen",
"shortcuts.go_to_wallet_tab": "Gehen Sie zur Registerkarte „Wallet“",
"shortcuts.network_selector": "Netzwerkauswahl",
"skip_verify_text": "Ich habe mein Gerät nicht bei mir",
"slippage_tolerance.button_save": "Speichern",
"slippage_tolerance.description": "Die Auto-Slippage optimiert den Slippage basierend auf der Pool-Liquidität und dem Handelsvolumen, wodurch Transaktionsfehler und MEV-Angriffsrisiken reduziert werden.",
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/locale/json/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"earn.currently_staking": "Currently staking",
"earn.daily": "Daily",
"earn.early_withdraw_stake_unstaking_period": "Early withdraw your stake anytime with a unstaking period of {number} days",
"earn.earn_during_unstaking_tooltip": "Assets will continue to earn rewards during the unstaking period after withdrawal.",
"earn.earn_points": "Earn points",
"earn.earn_points_desc": "OneKey partners with Babylon, enabling you to stake and complete Babylon’s tasks to earn points.",
"earn.earn_symbol": "Earn {symbol}",
Expand Down Expand Up @@ -704,6 +705,7 @@
"global.404_message": "Sorry, something went wrong!",
"global.Note": "Note",
"global.about": "About",
"global.account": "Account",
"global.account_name": "Account name",
"global.accounts": "Accounts",
"global.acknowledged": "Acknowledged",
Expand Down Expand Up @@ -986,6 +988,9 @@
"global.qr_code": "QR code",
"global.quit": "Quit",
"global.receive": "Receive",
"global.receive_address_confirmation": "Address confirmation",
"global.receive_address_confirmation_button": "I’ll take the risk",
"global.receive_address_confirmation_desc": "Unverified actions may result in assets being sent to the wrong address, especially if the OneKey App is not reconnected after local data tampering or reset.",
"global.recent_searched": "Recent searched",
"global.recents": "Recents",
"global.recipient": "Recipient",
Expand Down Expand Up @@ -1631,6 +1636,7 @@
"settings.set_auto_lock_duration_mobile": "When the app runs in the background without exiting or when the device screen is locked, it will automatically lock after a specified period of time.",
"settings.set_auto_lock_duration_web": "When the app is in an unused tab or minimized window, it will automatically lock after a specified period of time.",
"settings.settings": "Settings",
"settings.shortcuts": "Shortcuts",
"settings.sign_text": "Sign text",
"settings.signature_record": "Signature record",
"settings.spend_dust_utxo": "Spend dust UTXO",
Expand Down Expand Up @@ -1659,6 +1665,18 @@
"settings.view_address_in_explorer": "View address in explorer",
"settings.view_transaction_in_explorer": "View transaction in explorer",
"settings.whats_new": "What’s new",
"shortcut.go_back": "Go back",
"shortcut.go_forward": "Go forward",
"shortcut.hide_sidebar": "Hide sidebar",
"shortcut.show_sidebar": "Show sidebar",
"shortcuts.account_selector": "Account selector",
"shortcuts.close_current_tab": "Close current tab",
"shortcuts.go_to_browser_tab": "Go to browser tab",
"shortcuts.go_to_earn_tab": "Go to earn tab",
"shortcuts.go_to_market_tab": "Go to market tab",
"shortcuts.go_to_swap_tab": "Go to swap tab",
"shortcuts.go_to_wallet_tab": "Go to wallet tab",
"shortcuts.network_selector": "Network selector",
"skip_verify_text": "I don't have my device with me",
"slippage_tolerance.button_save": "Save",
"slippage_tolerance.description": "Auto slippage optimizes slippage based on pool liquidity and trading volume, reducing transaction failures and MEV attack risks.",
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/src/locale/json/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"earn.currently_staking": "Currently staking",
"earn.daily": "Daily",
"earn.early_withdraw_stake_unstaking_period": "Early withdraw your stake anytime with a unstaking period of {number} days",
"earn.earn_during_unstaking_tooltip": "Assets will continue to earn rewards during the unstaking period after withdrawal.",
"earn.earn_points": "Earn points",
"earn.earn_points_desc": "OneKey partners with Babylon, enabling you to stake and complete Babylon’s tasks to earn points.",
"earn.earn_symbol": "Earn {symbol}",
Expand Down Expand Up @@ -704,6 +705,7 @@
"global.404_message": "Sorry, something went wrong!",
"global.Note": "Note",
"global.about": "About",
"global.account": "Account",
"global.account_name": "Account name",
"global.accounts": "Accounts",
"global.acknowledged": "Acknowledged",
Expand Down Expand Up @@ -986,6 +988,9 @@
"global.qr_code": "QR code",
"global.quit": "Quit",
"global.receive": "Receive",
"global.receive_address_confirmation": "Address confirmation",
"global.receive_address_confirmation_button": "I’ll take the risk",
"global.receive_address_confirmation_desc": "Unverified actions may result in assets being sent to the wrong address, especially if the OneKey App is not reconnected after local data tampering or reset.",
"global.recent_searched": "Recent searched",
"global.recents": "Recents",
"global.recipient": "Recipient",
Expand Down Expand Up @@ -1631,6 +1636,7 @@
"settings.set_auto_lock_duration_mobile": "When the app runs in the background without exiting or when the device screen is locked, it will automatically lock after a specified period of time.",
"settings.set_auto_lock_duration_web": "When the app is in an unused tab or minimized window, it will automatically lock after a specified period of time.",
"settings.settings": "Settings",
"settings.shortcuts": "Shortcuts",
"settings.sign_text": "Sign text",
"settings.signature_record": "Signature record",
"settings.spend_dust_utxo": "Spend dust UTXO",
Expand Down Expand Up @@ -1659,6 +1665,18 @@
"settings.view_address_in_explorer": "View address in explorer",
"settings.view_transaction_in_explorer": "View transaction in explorer",
"settings.whats_new": "What’s new",
"shortcut.go_back": "Go back",
"shortcut.go_forward": "Go forward",
"shortcut.hide_sidebar": "Hide sidebar",
"shortcut.show_sidebar": "Show sidebar",
"shortcuts.account_selector": "Account selector",
"shortcuts.close_current_tab": "Close current tab",
"shortcuts.go_to_browser_tab": "Go to browser tab",
"shortcuts.go_to_earn_tab": "Go to earn tab",
"shortcuts.go_to_market_tab": "Go to market tab",
"shortcuts.go_to_swap_tab": "Go to swap tab",
"shortcuts.go_to_wallet_tab": "Go to wallet tab",
"shortcuts.network_selector": "Network selector",
"skip_verify_text": "I don't have my device with me",
"slippage_tolerance.button_save": "Save",
"slippage_tolerance.description": "Auto slippage optimizes slippage based on pool liquidity and trading volume, reducing transaction failures and MEV attack risks.",
Expand Down
Loading

0 comments on commit 6911248

Please sign in to comment.