Browse Source

feat: Add pricing link to HeaderBar component

- Introduced a new '定价' (Pricing) item in the HeaderBar navigation for better accessibility to pricing information.
- Updated routing to include the new '/pricing' path.
- Adjusted user display in the HeaderBar for mobile responsiveness, hiding the username on smaller screens for a cleaner interface.
CalciumIon 1 year ago
parent
commit
f0d9c89659
1 changed files with 8 additions and 2 deletions
  1. 8 2
      web/src/components/HeaderBar.js

+ 8 - 2
web/src/components/HeaderBar.js

@@ -67,6 +67,11 @@ const HeaderBar = () => {
       itemKey: 'detail',
       itemKey: 'detail',
       to: '/',
       to: '/',
     },
     },
+    {
+      text: '定价',
+      itemKey: 'pricing',
+      to: '/pricing',
+    },
   ];
   ];
 
 
   async function logout() {
   async function logout() {
@@ -112,6 +117,7 @@ const HeaderBar = () => {
                 about: '/about',
                 about: '/about',
                 login: '/login',
                 login: '/login',
                 register: '/register',
                 register: '/register',
+                pricing: '/pricing',
                 detail: '/detail',
                 detail: '/detail',
                 home: '/',
                 home: '/',
               };
               };
@@ -180,7 +186,7 @@ const HeaderBar = () => {
                 <>
                 <>
                   <Switch
                   <Switch
                     checkedText='🌞'
                     checkedText='🌞'
-                    size={'large'}
+                    size={styleState.isMobile?'default':'large'}
                     checked={theme === 'dark'}
                     checked={theme === 'dark'}
                     uncheckedText='🌙'
                     uncheckedText='🌙'
                     onChange={(checked) => {
                     onChange={(checked) => {
@@ -205,7 +211,7 @@ const HeaderBar = () => {
                       >
                       >
                         {userState.user.username[0]}
                         {userState.user.username[0]}
                       </Avatar>
                       </Avatar>
-                      <span>{userState.user.username}</span>
+                      {styleState.isMobile?null:<Text>{userState.user.username}</Text>}
                     </Dropdown>
                     </Dropdown>
                   </>
                   </>
                 ) : (
                 ) : (