File tree Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Expand file tree Collapse file tree 2 files changed +13
-15
lines changed Original file line number Diff line number Diff line change 1- type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType ;
2-
31export type AppLayoutMainPropsType = {
42 /**
53 * Everything between the tags will be displayed as the content of the main part of the application.
@@ -37,9 +35,9 @@ type AppLayoutPropsType = {
3735 */
3836 footer ?: React . ReactNode ;
3937 /**
40- * The area inside the sidenav. This area can be used to render custom content.
38+ * Use the DxcApplicationLayout.Main provided to render main content.
4139 */
42- children : React . ReactElement < ChildrenType > | React . ReactElement < ChildrenType > [ ] ;
40+ children : React . ReactElement < AppLayoutMainPropsType > ;
4341} ;
4442
4543export default AppLayoutPropsType ;
Original file line number Diff line number Diff line change @@ -23,7 +23,14 @@ const DxcSidenav = ({ title, children }: SidenavPropsType): JSX.Element => {
2323 < BackgroundColorProvider color = { colorsTheme . sidenav . backgroundColor } >
2424 { title }
2525 < DxcFlex direction = "column" gap = "1rem" >
26- { children }
26+ { React . Children . map ( children , ( child , index ) => {
27+ return (
28+ < >
29+ { child }
30+ { index !== React . Children . count ( children ) - 1 && < Divider /> }
31+ </ >
32+ ) ;
33+ } ) }
2734 </ DxcFlex >
2835 </ BackgroundColorProvider >
2936 </ SidenavContainer >
@@ -38,12 +45,9 @@ const Title = ({ children }: SidenavTitlePropsType): JSX.Element => (
3845) ;
3946
4047const Section = ( { children } : SidenavSectionPropsType ) : JSX . Element => (
41- < >
42- < DxcBleed horizontal = "1rem" >
43- < DxcFlex direction = "column" > { children } </ DxcFlex >
44- </ DxcBleed >
45- < Divider />
46- </ >
48+ < DxcBleed horizontal = "1rem" >
49+ < DxcFlex direction = "column" > { children } </ DxcFlex >
50+ </ DxcBleed >
4751) ;
4852
4953const GroupContext = React . createContext < React . Dispatch < React . SetStateAction < boolean > > | null > ( null ) ;
@@ -160,10 +164,6 @@ const Divider = styled.div`
160164 width: 100%;
161165 height: 1px;
162166 background-color: #999999;
163-
164- &:last-child {
165- display: none;
166- }
167167` ;
168168
169169const SidenavGroup = styled . div `
You can’t perform that action at this time.
0 commit comments