@@ -26,6 +26,7 @@ import {
2626 NavLayoutItemActiveStyleType ,
2727} from "comps/controls/styleControlConstants" ;
2828import { dropdownControl } from "comps/controls/dropdownControl" ;
29+ import _ from "lodash" ;
2930
3031const DEFAULT_WIDTH = 240 ;
3132const ModeOptions = [
@@ -156,6 +157,7 @@ let NavTmpLayout = (function () {
156157 } ,
157158 ] ) ,
158159 width : withDefault ( StringControl , DEFAULT_WIDTH ) ,
160+ backgroundImage : withDefault ( StringControl , "" ) ,
159161 mode : dropdownControl ( ModeOptions , "inline" ) ,
160162 navStyle : withDefault ( styleControl ( NavLayoutStyle ) , defaultStyle ) ,
161163 navItemStyle : withDefault ( styleControl ( NavLayoutItemStyle ) , defaultStyle ) ,
@@ -170,7 +172,9 @@ let NavTmpLayout = (function () {
170172
171173 return (
172174 < div style = { { overflowY : 'auto' } } >
173- < Section name = { trans ( "menu" ) } > { menuPropertyView ( children . items ) } </ Section >
175+ < Section name = { trans ( "menu" ) } >
176+ { menuPropertyView ( children . items ) }
177+ </ Section >
174178 < Section name = { sectionNames . layout } >
175179 { children . width . propertyView ( {
176180 label : trans ( "navLayout.width" ) ,
@@ -181,6 +185,10 @@ let NavTmpLayout = (function () {
181185 label : trans ( "labelProp.position" ) ,
182186 radioButton : true
183187 } ) }
188+ { children . backgroundImage . propertyView ( {
189+ label : `Background Image` ,
190+ placeholder : 'https://temp.im/350x400' ,
191+ } ) }
184192 </ Section >
185193 < Section name = { trans ( "navLayout.navStyle" ) } >
186194 { children . navStyle . getPropertyView ( ) }
@@ -222,7 +230,8 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
222230 const navItemStyle = useMemo ( ( ) => comp . children . navItemStyle . getView ( ) , [ comp . children . navItemStyle ] ) ;
223231 const navItemHoverStyle = useMemo ( ( ) => comp . children . navItemHoverStyle . getView ( ) , [ comp . children . navItemHoverStyle ] ) ;
224232 const navItemActiveStyle = useMemo ( ( ) => comp . children . navItemActiveStyle . getView ( ) , [ comp . children . navItemActiveStyle ] ) ;
225- console . log ( navItemActiveStyle ) ;
233+ const backgroundImage = comp . children . backgroundImage . getView ( ) ;
234+
226235 // filter out hidden. unauthorised items filtered by server
227236 const filterItem = useCallback ( ( item : LayoutMenuItemComp ) : boolean => {
228237 return ! item . children . hidden . getView ( ) ;
@@ -367,6 +376,10 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
367376 return '0px' ;
368377 }
369378
379+ let backgroundStyle = navStyle . background ;
380+ if ( ! _ . isEmpty ( backgroundImage ) ) {
381+ backgroundStyle = `center / cover url('${ backgroundImage } ') no-repeat, ${ backgroundStyle } ` ;
382+ }
370383 let content = (
371384 < Layout >
372385 < StyledSide theme = "light" width = { navWidth } >
@@ -376,18 +389,18 @@ NavTmpLayout = withViewFn(NavTmpLayout, (comp) => {
376389 style = { {
377390 height : `calc(100% - ${ getVerticalMargin ( navStyle . margin . split ( ' ' ) ) } )` ,
378391 width : `calc(100% - ${ getHorizontalMargin ( navStyle . margin . split ( ' ' ) ) } )` ,
392+ borderRight : `1px solid ${ navStyle . border } ` ,
379393 borderRadius : navStyle . radius ,
380394 color : navStyle . text ,
381395 margin : navStyle . margin ,
382396 padding : navStyle . padding ,
383- background : navStyle . background ,
384- borderRight : `1px solid ${ navStyle . border } ` ,
397+ background : backgroundStyle ,
385398 } }
386399 defaultOpenKeys = { defaultOpenKeys }
387400 selectedKeys = { [ selectedKey ] }
388401 $navItemStyle = { {
389402 width : `calc(100% - ${ getHorizontalMargin ( navItemStyle . margin . split ( ' ' ) ) } )` ,
390- ...navItemStyle
403+ ...navItemStyle ,
391404 } }
392405 $navItemHoverStyle = { navItemHoverStyle }
393406 $navItemActiveStyle = { navItemActiveStyle }
0 commit comments