@@ -12,7 +12,20 @@ import DemoFileMosaicFileIcons from "../../components/demo-components/filemosaic
1212import MainLayoutPage from "../../components/layout-pages/MainLayoutPage" ;
1313import AnchorToTab from "../../components/util-components/AnchorToTab" ;
1414import FileCardMosaicSwitch from "../../components/switch/FileCardMosaicSwitch" ;
15+ import { scrollHandler } from "../../utils/scrollHandler" ;
1516const FileIconsPage = ( props ) => {
17+ const [ selectedItem , setSelectedItem ] = React . useState ( 0 ) ;
18+
19+ React . useEffect ( ( ) => {
20+ window . addEventListener ( "scroll" , ( ) =>
21+ scrollHandler ( rightMenuItems , setSelectedItem )
22+ ) ;
23+ return ( ) => {
24+ window . removeEventListener ( "scroll" , ( ) =>
25+ scrollHandler ( rightMenuItems , setSelectedItem )
26+ ) ;
27+ } ;
28+ } , [ ] ) ;
1629 const [ component , setComponent ] = React . useState ( "FileMosaic" ) ;
1730 const handleChangeComponent = ( newVal ) => {
1831 setComponent ( newVal ) ;
@@ -24,11 +37,11 @@ const FileIconsPage = (props) => {
2437 < MainTitle > File Icons (extensive list)</ MainTitle >
2538 < MainParagraph >
2639 Both < CodeHighlight > { "<FileMosaic/>" } </ CodeHighlight > and{ " " }
27- < CodeHighlight > { "<FileCard/>" } </ CodeHighlight > components diplay a file icon
28- according to the file mime type. A media type (also known as a
29- Multipurpose Internet Mail Extensions or MIME type) indicates the
30- nature and format of a document, file, or assortment of bytes. You
31- can find more information{ " " }
40+ < CodeHighlight > { "<FileCard/>" } </ CodeHighlight > components diplay a
41+ file icon according to the file mime type. A media type (also known
42+ as a Multipurpose Internet Mail Extensions or MIME type) indicates
43+ the nature and format of a document, file, or assortment of bytes.
44+ You can find more information{ " " }
3245 < AnchorToTab href = "https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types" >
3346 here
3447 </ AnchorToTab >
@@ -63,11 +76,15 @@ const FileIconsPage = (props) => {
6376 < DemoFileMosaicFileIcons card = { component === "FileCard" } />
6477 </ Paper >
6578 </ section >
66-
67- < RightMenuContainer >
68- < RightMenu width = "240px" items = { rightMenuItems } />
69- </ RightMenuContainer >
7079 </ MainContentContainer >
80+ < RightMenuContainer >
81+ < RightMenu
82+ width = "240px"
83+ items = { rightMenuItems }
84+ selectedItemProp = { selectedItem }
85+ setSelected = { setSelectedItem }
86+ />
87+ </ RightMenuContainer >
7188 </ MainLayoutPage >
7289 </ React . Fragment >
7390 ) ;
0 commit comments