Skip to content

Commit

Permalink
fix: admin系统名称字号适配
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Sep 22, 2024
1 parent 3bf3d92 commit 5f8f41d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/admin/src/components/Logo/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ function Logo() {
useEffect(() => {
// 左右布局模式下,Logo背景需要跟着主题色变化
if (projectInfo.menu_theme_color === 'dark') {
setStyle({ backgroundColor: '#001529', color: '#fff', height: 60, padding: '10px 24px' });
setStyle({ backgroundColor: '#001529', color: '#fff', height: 60, padding: '10px 20px' });
} else {
setStyle({ backgroundColor: '#fff', color: '#000', height: 60, padding: '10px 24px' });
setStyle({ backgroundColor: '#fff', color: '#000', height: 60, padding: '10px 20px' });
}
/**
* 1. 名称是中文,7个字,正常显示。
* 2. 9个字以内,调整字号,以适配显示9个字。
* 3. 9个字以上,超出显示省略号。
*/
if (/^[\u4e00-\u9fa5]+$/.test(projectInfo.name) && projectInfo.name.length > 7) {
if (/^[\u4e00-\u9fa5]+$/.test(projectInfo.name)) {
setNameStyle({
fontSize: 17,
fontSize: projectInfo.name.length > 9 ? 14 : 16,
});
}
}, [projectInfo.layout, projectInfo.menu_theme_color]);
Expand Down

0 comments on commit 5f8f41d

Please sign in to comment.