Explorar o código

🐛 fix(navbar): 修复导航栏右侧元素位置计算错误

- 修正右侧按钮定位公式,由`right + 10`改为`screenWidth - right - 10`
- 调整标题最大宽度计算,修复元素重叠问题
yourname hai 4 meses
pai
achega
16016f405c
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      mini/src/components/ui/navbar.tsx

+ 2 - 2
mini/src/components/ui/navbar.tsx

@@ -91,7 +91,7 @@ export const Navbar: React.FC<NavbarProps> = ({
           className="absolute top-0 bottom-0 flex items-center z-10"
           style={{
             height: NAVBAR_HEIGHT,
-            right: `${menuButtonInfo.right + 10}px`,
+            right: `${systemInfo.screenWidth - menuButtonInfo.right - 10}px`,
           }}
           onClick={onClickRight}
         >
@@ -137,7 +137,7 @@ export const Navbar: React.FC<NavbarProps> = ({
           <Text
             className={cn('text-base font-semibold truncate', textColor)}
             style={{
-              maxWidth: `calc(100% - ${menuButtonInfo.right + 10}px - 60px - 60px)`
+              maxWidth: `calc(100% - ${systemInfo.screenWidth - menuButtonInfo.right + 10}px - 60px - 60px)`
             }}
           >
             {title}