@@ -49,8 +49,8 @@ const DEFAULT_WIDTH = 240;
4949type MenuItemStyleOptionValue = "normal" | "hover" | "active" ;
5050const EventOptions = [ clickEvent ] as const ;
5151
52- const StyledSide = styled ( LayoutSider ) `
53- max-height: calc(100vh - ${ TopHeaderHeight } );
52+ const StyledSide = styled ( LayoutSider ) < { $isPreview : boolean } > `
53+ max-height: ${ ( props ) => ( props . $isPreview ? ` calc(100vh - ${ TopHeaderHeight } )` : "100vh" ) } ;
5454 overflow: auto;
5555
5656 .ant-menu-item:first-child {
@@ -87,18 +87,42 @@ const StyledMenu = styled(AntdMenu)<{
8787 border: ${ ( props ) => `1px solid ${ props . $navItemStyle ?. border } ` } ;
8888 margin: ${ ( props ) => props . $navItemStyle ?. margin } ;
8989 padding: ${ ( props ) => props . $navItemStyle ?. padding } ;
90+ }
9091
92+ .ant-menu-title-content {
93+ font-size: ${ ( props ) => props . $navItemStyle ?. textSize } ;
94+ font-family: ${ ( props ) => props . $navItemStyle ?. fontFamily } ;
95+ font-style: ${ ( props ) => props . $navItemStyle ?. fontStyle } ;
96+ font-weight: ${ ( props ) => props . $navItemStyle ?. textWeight } ;
97+ text-decoration: ${ ( props ) => props . $navItemStyle ?. textDecoration } ;
9198 }
99+
92100 .ant-menu-item-active {
93101 background-color: ${ ( props ) => props . $navItemHoverStyle ?. background } !important;
94102 color: ${ ( props ) => props . $navItemHoverStyle ?. text } !important;
95103 border: ${ ( props ) => `1px solid ${ props . $navItemHoverStyle ?. border } ` } ;
104+
105+ .ant-menu-title-content {
106+ font-size: ${ ( props ) => props . $navItemHoverStyle ?. textSize || props . $navItemStyle ?. textSize } ;
107+ font-family: ${ ( props ) => props . $navItemHoverStyle ?. fontFamily || props . $navItemStyle ?. fontFamily } ;
108+ font-style: ${ ( props ) => props . $navItemHoverStyle ?. fontStyle || props . $navItemStyle ?. fontStyle } ;
109+ font-weight: ${ ( props ) => props . $navItemHoverStyle ?. textWeight || props . $navItemStyle ?. textWeight } ;
110+ text-decoration: ${ ( props ) => props . $navItemHoverStyle ?. textDecoration || props . $navItemStyle ?. textDecoration } ;
111+ }
96112 }
97113
98114 .ant-menu-item-selected {
99115 background-color: ${ ( props ) => props . $navItemActiveStyle ?. background } !important;
100116 color: ${ ( props ) => props . $navItemActiveStyle ?. text } !important;
101117 border: ${ ( props ) => `1px solid ${ props . $navItemActiveStyle ?. border } ` } ;
118+
119+ .ant-menu-title-content {
120+ font-size: ${ ( props ) => props . $navItemActiveStyle ?. textSize || props . $navItemStyle ?. textSize } ;
121+ font-family: ${ ( props ) => props . $navItemActiveStyle ?. fontFamily || props . $navItemStyle ?. fontFamily } ;
122+ font-style: ${ ( props ) => props . $navItemActiveStyle ?. fontStyle || props . $navItemStyle ?. fontStyle } ;
123+ font-weight: ${ ( props ) => props . $navItemActiveStyle ?. textWeight || props . $navItemStyle ?. textWeight } ;
124+ text-decoration: ${ ( props ) => props . $navItemActiveStyle ?. textDecoration || props . $navItemStyle ?. textDecoration } ;
125+ }
102126 }
103127
104128 .ant-menu-submenu {
@@ -112,11 +136,15 @@ const StyledMenu = styled(AntdMenu)<{
112136 max-height: 100%;
113137 background-color: ${ ( props ) => props . $navItemStyle ?. background } ;
114138 color: ${ ( props ) => props . $navItemStyle ?. text } ;
139+ font-size: ${ ( props ) => props . $navItemStyle ?. textSize } ;
140+ font-family: ${ ( props ) => props . $navItemStyle ?. fontFamily } ;
141+ font-style: ${ ( props ) => props . $navItemStyle ?. fontStyle } ;
142+ font-weight: ${ ( props ) => props . $navItemStyle ?. textWeight } ;
143+ text-decoration: ${ ( props ) => props . $navItemStyle ?. textDecoration } ;
115144 border-radius: ${ ( props ) => props . $navItemStyle ?. radius } !important;
116145 border: ${ ( props ) => `1px solid ${ props . $navItemStyle ?. border } ` } ;
117146 margin: 0;
118147 padding: ${ ( props ) => props . $navItemStyle ?. padding } ;
119-
120148 }
121149
122150 .ant-menu-item {
@@ -129,6 +157,11 @@ const StyledMenu = styled(AntdMenu)<{
129157 background-color: ${ ( props ) => props . $navItemHoverStyle ?. background } !important;
130158 color: ${ ( props ) => props . $navItemHoverStyle ?. text } !important;
131159 border: ${ ( props ) => `1px solid ${ props . $navItemHoverStyle ?. border } ` } ;
160+ font-size: ${ ( props ) => props . $navItemHoverStyle ?. textSize || props . $navItemStyle ?. textSize } ;
161+ font-family: ${ ( props ) => props . $navItemHoverStyle ?. fontFamily || props . $navItemStyle ?. fontFamily } ;
162+ font-style: ${ ( props ) => props . $navItemHoverStyle ?. fontStyle || props . $navItemStyle ?. fontStyle } ;
163+ font-weight: ${ ( props ) => props . $navItemHoverStyle ?. textWeight || props . $navItemStyle ?. textWeight } ;
164+ text-decoration: ${ ( props ) => props . $navItemHoverStyle ?. textDecoration || props . $navItemStyle ?. textDecoration } ;
132165 }
133166 }
134167 &.ant-menu-submenu-selected {
@@ -137,6 +170,11 @@ const StyledMenu = styled(AntdMenu)<{
137170 background-color: ${ ( props ) => props . $navItemActiveStyle ?. background } !important;
138171 color: ${ ( props ) => props . $navItemActiveStyle ?. text } !important;
139172 border: ${ ( props ) => `1px solid ${ props . $navItemActiveStyle ?. border } ` } ;
173+ font-size: ${ ( props ) => props . $navItemActiveStyle ?. textSize || props . $navItemStyle ?. textSize } ;
174+ font-family: ${ ( props ) => props . $navItemActiveStyle ?. fontFamily || props . $navItemStyle ?. fontFamily } ;
175+ font-style: ${ ( props ) => props . $navItemActiveStyle ?. fontStyle || props . $navItemStyle ?. fontStyle } ;
176+ font-weight: ${ ( props ) => props . $navItemActiveStyle ?. textWeight || props . $navItemStyle ?. textWeight } ;
177+ text-decoration: ${ ( props ) => props . $navItemActiveStyle ?. textDecoration || props . $navItemStyle ?. textDecoration } ;
140178 }
141179 }
142180 }
@@ -161,6 +199,11 @@ const StyledMenu = styled(AntdMenu)<{
161199
162200` ;
163201
202+
203+ const ViewerMainContent = styled ( MainContent ) < { $isPreview : boolean } > `
204+ height: ${ ( props ) => ( props . $isPreview ? `calc(100vh - ${ TopHeaderHeight } )` : "100vh" ) } ;
205+ ` ;
206+
164207const StyledImage = styled . img `
165208 height: 1em;
166209 color: currentColor;
@@ -317,6 +360,7 @@ let NavTmpLayout = (function () {
317360NavTmpLayout = withViewFn ( NavTmpLayout , ( comp ) => {
318361 const pathParam = useAppPathParam ( ) ;
319362 const isViewMode = isUserViewMode ( pathParam ) ;
363+ const isPreview = pathParam . viewMode === "preview" ;
320364 const [ selectedKey , setSelectedKey ] = useState ( "" ) ;
321365 const items = comp . children . items . getView ( ) ;
322366 const navWidth = comp . children . width . getView ( ) ;
@@ -636,25 +680,25 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
636680 ) ;
637681
638682 let content = (
639- < Layout >
683+ < Layout style = { { height : isPreview ? undefined : "100vh" } } >
640684 { ( navPosition === 'top' ) && (
641685 < Header style = { { display : 'flex' , alignItems : 'center' , padding : 0 } } >
642686 { navMenu }
643687 </ Header >
644688 ) }
645689 { ( navPosition === 'left' ) && (
646- < StyledSide theme = "light" width = { navWidth } collapsed = { navCollapse } >
690+ < StyledSide $isPreview = { isPreview } theme = "light" width = { navWidth } collapsed = { navCollapse } >
647691 { navMenu }
648692 </ StyledSide >
649693 ) }
650- < MainContent > { pageView } </ MainContent >
694+ < ViewerMainContent $isPreview = { isPreview } > { pageView } </ ViewerMainContent >
651695 { ( navPosition === 'bottom' ) && (
652696 < Footer style = { { display : 'flex' , alignItems : 'center' , padding : 0 } } >
653697 { navMenu }
654698 </ Footer >
655699 ) }
656700 { ( navPosition === 'right' ) && (
657- < StyledSide theme = "light" width = { navWidth } collapsed = { navCollapse } >
701+ < StyledSide $isPreview = { isPreview } theme = "light" width = { navWidth } collapsed = { navCollapse } >
658702 { navMenu }
659703 </ StyledSide >
660704 ) }
0 commit comments