@@ -61,13 +61,15 @@ const Header: React.FC = () => {
6161        { siteMapNode  ? ( 
6262          < > 
6363            < Stack  direction = "row"  alignItems = "center"  justifyContent = "center"  spacing = { 2 } > 
64-               { Object . values ( siteMapNode . children ) . map ( ( r )  =>  ( 
65-                 < Link  key = { r . id }  to = { r . route_code }  onClick = { resetDepths } > 
66-                   < Button  key = { r . id }  onMouseEnter = { ( )  =>  setDepth1 ( r ) }  sx = { {  minWidth : 0 ,  textTransform : "none"  } } > 
67-                     { r . name } 
68-                   </ Button > 
69-                 </ Link > 
70-               ) ) } 
64+               { Object . values ( siteMapNode . children ) 
65+                 . filter ( ( s )  =>  ! s . hide ) 
66+                 . map ( ( r )  =>  ( 
67+                   < Link  key = { r . id }  to = { r . route_code }  onClick = { resetDepths } > 
68+                     < Button  key = { r . id }  onMouseEnter = { ( )  =>  setDepth1 ( r ) }  sx = { {  minWidth : 0 ,  textTransform : "none"  } } > 
69+                       { r . name } 
70+                     </ Button > 
71+                   </ Link > 
72+                 ) ) } 
7173            </ Stack > 
7274
7375            { navState . depth1  &&  ( 
@@ -79,36 +81,40 @@ const Header: React.FC = () => {
7981                  < Depth1to2Divider  flexItem  /> 
8082                  < Stack  direction = "row"  spacing = { 4 } > 
8183                    < Stack  spacing = { 1.25 } > 
82-                       { Object . values ( navState . depth1 . children ) . map ( ( r )  =>  ( 
83-                         < Depth2Item 
84-                           children = { r . name } 
85-                           className = { r . id  ===  navState . depth2 ?. id  ? "active"  : "" } 
86-                           key = { r . id } 
87-                           onClick = { resetDepths } 
88-                           onMouseEnter = { ( )  =>  setDepth2 ( r ) } 
89-                           // 하위 depth가 있는 경우, 하위 depth를 선택할 수 있도록 유지하기 위해 depth2도 유지합니다. 
90-                           onMouseLeave = { ( )  =>  R . isEmpty ( navState . depth2 ?. children  ??  { } )  &&  setDepth2 ( undefined ) } 
91-                           to = { getDepth2Route ( r . route_code ) } 
92-                         /> 
93-                       ) ) } 
84+                       { Object . values ( navState . depth1 . children ) 
85+                         . filter ( ( s )  =>  ! s . hide ) 
86+                         . map ( ( r )  =>  ( 
87+                           < Depth2Item 
88+                             children = { r . name } 
89+                             className = { r . id  ===  navState . depth2 ?. id  ? "active"  : "" } 
90+                             key = { r . id } 
91+                             onClick = { resetDepths } 
92+                             onMouseEnter = { ( )  =>  setDepth2 ( r ) } 
93+                             // 하위 depth가 있는 경우, 하위 depth를 선택할 수 있도록 유지하기 위해 depth2도 유지합니다. 
94+                             onMouseLeave = { ( )  =>  R . isEmpty ( navState . depth2 ?. children  ??  { } )  &&  setDepth2 ( undefined ) } 
95+                             to = { getDepth2Route ( r . route_code ) } 
96+                           /> 
97+                         ) ) } 
9498                    </ Stack > 
9599
96100                    { navState . depth2  &&  ! R . isEmpty ( navState . depth2 . children )  &&  ( 
97101                      < > 
98102                        { ! R . isEmpty ( navState . depth2 . children )  &&  < Depth2to3Divider  orientation = "vertical"  flexItem  /> } 
99103
100104                        < Stack  spacing = { 1.5 } > 
101-                           { Object . values ( navState . depth2 . children ) . map ( ( r )  =>  ( 
102-                             < Depth3Item 
103-                               children = { r . name } 
104-                               className = { r . id  ===  navState . depth3 ?. id  ? "active"  : "" } 
105-                               key = { r . id } 
106-                               onClick = { resetDepths } 
107-                               onMouseEnter = { ( )  =>  setDepth3 ( r ) } 
108-                               onMouseLeave = { ( )  =>  setDepth3 ( undefined ) } 
109-                               to = { getDepth3Route ( r ?. route_code ) } 
110-                             /> 
111-                           ) ) } 
105+                           { Object . values ( navState . depth2 . children ) 
106+                             . filter ( ( s )  =>  ! s . hide ) 
107+                             . map ( ( r )  =>  ( 
108+                               < Depth3Item 
109+                                 children = { r . name } 
110+                                 className = { r . id  ===  navState . depth3 ?. id  ? "active"  : "" } 
111+                                 key = { r . id } 
112+                                 onClick = { resetDepths } 
113+                                 onMouseEnter = { ( )  =>  setDepth3 ( r ) } 
114+                                 onMouseLeave = { ( )  =>  setDepth3 ( undefined ) } 
115+                                 to = { getDepth3Route ( r ?. route_code ) } 
116+                               /> 
117+                             ) ) } 
112118                        </ Stack > 
113119                      </ > 
114120                    ) } 
0 commit comments