feat: add button tips
This commit is contained in:
@@ -1478,4 +1478,19 @@ export const I18N = {
|
||||
en: `To import vocabulary, please use a txt file with one word per line.`,
|
||||
zh_TW: `匯入詞彙請使用txt文件,每一行一個單字。`,
|
||||
},
|
||||
btn_tip_click_away: {
|
||||
zh: `失焦隐藏/显示`,
|
||||
en: `Loss of focus hide/show`,
|
||||
zh_TW: `失焦隱藏/顯示`,
|
||||
},
|
||||
btn_tip_follow_selection: {
|
||||
zh: `跟随/固定模式`,
|
||||
en: `Follow/Fixed Mode`,
|
||||
zh_TW: `跟隨/固定模式`,
|
||||
},
|
||||
btn_tip_simple_style: {
|
||||
zh: `迷你/常规模式`,
|
||||
en: `Mini/Regular Mode`,
|
||||
zh_TW: `迷你/常規模式`,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -38,6 +38,8 @@ function Header({
|
||||
setFollowSelection,
|
||||
mouseHover,
|
||||
}) {
|
||||
const i18n = useI18n();
|
||||
|
||||
if (!isMobile && simpleStyle && !mouseHover) {
|
||||
return;
|
||||
}
|
||||
@@ -66,6 +68,7 @@ function Header({
|
||||
<Stack direction="row" alignItems="center">
|
||||
<IconButton
|
||||
size="small"
|
||||
title={i18n("btn_tip_click_away")}
|
||||
onClick={() => {
|
||||
setHideClickAway((pre) => !pre);
|
||||
}}
|
||||
@@ -78,6 +81,7 @@ function Header({
|
||||
</IconButton>
|
||||
<IconButton
|
||||
size="small"
|
||||
title={i18n("btn_tip_follow_selection")}
|
||||
onClick={() => {
|
||||
setFollowSelection((pre) => !pre);
|
||||
}}
|
||||
@@ -90,6 +94,7 @@ function Header({
|
||||
</IconButton>
|
||||
<IconButton
|
||||
size="small"
|
||||
title={i18n("btn_tip_simple_style")}
|
||||
onClick={() => {
|
||||
setSimpleStyle((pre) => !pre);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user