Skip to content

Commit

Permalink
fix(layout): set layout headermenu height to 40
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed May 12, 2023
1 parent 307a84e commit f50cfd2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/layout/src/components/TopNavHeader/style.ts
Expand Up @@ -67,9 +67,10 @@ const genTopNavHeaderStyle: GenerateStyle<TopNavHeaderToken> = (token) => {
alignItems: 'center',
paddingInline: 6,
paddingBlock: 6,
lineHeight: `${
(token?.layout?.header?.heightLayoutHeader || 56) - 12
}px`,
lineHeight: `${Math.max(
(token?.layout?.header?.heightLayoutHeader || 56) - 12,
40,
)}px`,
},
},
};
Expand Down
7 changes: 7 additions & 0 deletions packages/layout/src/demos/base.tsx
Expand Up @@ -295,6 +295,11 @@ export default () => {
location={{
pathname,
}}
token={{
header: {
colorBgMenuItemSelected: 'rgba(0,0,0,0.04)',
},
}}
siderMenuType="group"
menu={{
collapsedShowGroupTitle: true,
Expand Down Expand Up @@ -323,6 +328,7 @@ export default () => {
}}
actionsRender={(props) => {
if (props.isMobile) return [];
if (typeof document === 'undefined') return [];
return [
props.layout !== 'side' && document.body.clientWidth > 1400 ? (
<SearchInput />
Expand All @@ -339,6 +345,7 @@ export default () => {
{title}
</a>
);
if (typeof document === 'undefined') return defaultDom;
if (document.body.clientWidth < 1400) {
return defaultDom;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/layout/src/demos/topMode.tsx
Expand Up @@ -319,7 +319,10 @@ export default () => {
{title}
</a>
);
if (document.body.clientWidth < 1400) {
if (
typeof document === 'undefined' ||
document.body.clientWidth < 1400
) {
return defaultDom;
}
if (_.isMobile) return defaultDom;
Expand Down

0 comments on commit f50cfd2

Please sign in to comment.