Browse Source

删除起始页面上用于测试多语言的元素;调整切换主题按钮的位置到右下角

dengdx 2 months ago
parent
commit
4ddd59bbd0
1 changed files with 9 additions and 12 deletions
  1. 9 12
      src/app.tsx

+ 9 - 12
src/app.tsx

@@ -25,19 +25,16 @@ function App({ children }: PropsWithChildren<any>) {
   return (
     <ConfigProvider theme={currentTheme}>
       <IntlProvider locale={locale} messages={messages}>
-        <div style={{backgroundColor: currentTheme.token.colorBgLayout, color: currentTheme.token.colorText, padding: '20px'}}>
-          <div>
-            <FormattedMessage id="greeting" defaultMessage="Hello, world!" />
-            <br />
-            <FormattedMessage id="name" defaultMessage="John Doe" />
-            {children}
+        <div style={{backgroundColor: currentTheme.token.colorBgLayout, color: currentTheme.token.colorText, borderRadius: '8px', boxShadow: '0 2px 8px rgba(0,0,0,0.1)'}}>
+          {children}
+          <div className="fixed bottom-4 right-4">
+            <Button type="primary" onClick={() => changeTheme(darkTheme)}>
+              Switch to Dark Theme
+            </Button>
+            <Button type="primary" onClick={() => changeTheme(lightTheme)}>
+              Switch to Light Theme
+            </Button>
           </div>
-          <Button type="primary" onClick={() => changeTheme(darkTheme)}>
-            Switch to Dark Theme
-          </Button>
-          <Button type="primary" onClick={() => changeTheme(lightTheme)}>
-            Switch to Light Theme
-          </Button>
         </div>
       </IntlProvider>
     </ConfigProvider>