chore: 迁移工具方法 isMobileUI

This commit is contained in:
CrescentLeaf
2025-10-01 00:02:20 +08:00
parent cd22f62d60
commit 29ea6f9142
2 changed files with 5 additions and 1 deletions

View File

@@ -21,7 +21,8 @@ urlParams.get('debug') == 'true' && window.addEventListener('error', ({ message,
import App from './ui/App.tsx'
import AppMobile from './ui/AppMobile.tsx'
ReactDOM.createRoot(document.getElementById('app') as HTMLElement).render(React.createElement(urlParams.get('mobile') == 'true' ? AppMobile : App, null))
import isMobileUI from "./ui/isMobileUI.ts"
ReactDOM.createRoot(document.getElementById('app') as HTMLElement).render(React.createElement(isMobileUI() ? AppMobile : App, null))
const onResize = () => {
document.body.style.setProperty('--whitesilk-widget-message-maxwidth', breakpoint().down('md') ? "80%" : "70%")

3
client/ui/isMobileUI.ts Normal file
View File

@@ -0,0 +1,3 @@
export default function isMobileUI() {
return new URL(location.href).searchParams.get('mobile') == 'true'
}