feat: Add fullscreen mode notification with localized message
This commit is contained in:
parent
68df5cd211
commit
26dd931f70
@ -1,6 +1,8 @@
|
||||
import '@renderer/databases'
|
||||
|
||||
import store, { persistor } from '@renderer/store'
|
||||
import { useEffect } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Provider } from 'react-redux'
|
||||
import { HashRouter, Route, Routes } from 'react-router-dom'
|
||||
import { PersistGate } from 'redux-persist/integration/react'
|
||||
@ -21,6 +23,24 @@ import SettingsPage from './pages/settings/SettingsPage'
|
||||
import TranslatePage from './pages/translate/TranslatePage'
|
||||
|
||||
function App(): JSX.Element {
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => {
|
||||
const cleanup = window.electron.ipcRenderer.on('fullscreen-status-changed', (_, isFullscreen) => {
|
||||
if (isFullscreen) {
|
||||
window.message.info({
|
||||
content: t('common.fullscreen'),
|
||||
duration: 3,
|
||||
key: 'fullscreen-notification'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return () => {
|
||||
cleanup()
|
||||
}
|
||||
}, [t])
|
||||
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<ThemeProvider>
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
"select": "Select",
|
||||
"topics": "Topics",
|
||||
"warning": "Warning",
|
||||
"you": "You"
|
||||
"you": "You",
|
||||
"fullscreen": "Entered fullscreen mode. Press F11 to exit"
|
||||
},
|
||||
"docs": {
|
||||
"title": "Docs"
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
"select": "選択",
|
||||
"topics": "トピック",
|
||||
"warning": "警告",
|
||||
"you": "あなた"
|
||||
"you": "あなた",
|
||||
"fullscreen": "全画面モードに入りました。F11キーで終了します"
|
||||
},
|
||||
"docs": {
|
||||
"title": "ドキュメント"
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
"select": "Выбрать",
|
||||
"topics": "Топики",
|
||||
"warning": "Предупреждение",
|
||||
"you": "Вы"
|
||||
"you": "Вы",
|
||||
"fullscreen": "Вы вошли в полноэкранный режим. Нажмите F11 для выхода"
|
||||
},
|
||||
"docs": {
|
||||
"title": "Документация"
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
"select": "选择",
|
||||
"topics": "话题",
|
||||
"warning": "警告",
|
||||
"you": "用户"
|
||||
"you": "用户",
|
||||
"fullscreen": "已进入全屏模式,按 F11 退出"
|
||||
},
|
||||
"docs": {
|
||||
"title": "帮助文档"
|
||||
|
||||
@ -190,7 +190,8 @@
|
||||
"select": "選擇",
|
||||
"topics": "話題",
|
||||
"warning": "警告",
|
||||
"you": "您"
|
||||
"you": "您",
|
||||
"fullscreen": "已進入全螢幕模式,按 F11 退出"
|
||||
},
|
||||
"docs": {
|
||||
"title": "幫助文件"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user