@@ -19,6 +19,7 @@ import React, { useContext, useEffect, useState } from "react";
1919import { ActionType } from "react-table" ;
2020import { usePopper } from "react-popper" ;
2121import { HeaderContext } from "components/contexts/HeaderContext" ;
22+ import { Checkbox , FormControlLabel , FormGroup } from "@material-ui/core" ;
2223type HeaderMenuProps = {
2324 dispatch : ( action : ActionType ) => void ;
2425 setSortBy : any ;
@@ -199,6 +200,15 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
199200 strategy : "fixed" ,
200201 } ) ;
201202
203+ const settingsPopper = usePopper (
204+ settingsReferenceElement ,
205+ settingsPopperElement ,
206+ {
207+ placement : "right" ,
208+ strategy : "fixed" ,
209+ }
210+ ) ;
211+
202212 function persistLabelChange ( ) {
203213 dispatch ( {
204214 type : ActionTypes . UPDATE_COLUMN_LABEL ,
@@ -294,7 +304,7 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
294304 Property Type
295305 </ span >
296306 </ div >
297- { /** Edit header label section */ }
307+ { /** Type of column section */ }
298308 < div style = { { padding : "4px 0px" } } >
299309 < button
300310 className = "sort-button"
@@ -336,6 +346,7 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
336346 </ div >
337347 ) }
338348 </ div >
349+ { /** Action buttons section */ }
339350 < div
340351 style = { {
341352 borderTop : `2px solid ${ StyleVariables . BACKGROUND_DIVIDER } ` ,
@@ -362,7 +373,7 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
362373 padding : "4px 0px" ,
363374 } }
364375 >
365- { /** Column settings */ }
376+ { /** Column settings section */ }
366377 < div style = { { padding : "4px 0px" } } >
367378 < button
368379 className = "sort-button"
@@ -376,7 +387,31 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
376387 </ span >
377388 < span > Settings</ span >
378389 </ button >
379- { showSettings && < span > pruebas</ span > }
390+ { showSettings && (
391+ < div
392+ className = "shadow-5 border-radius-m"
393+ ref = { setSettingsPopperElement }
394+ onMouseEnter = { ( ) => setShowSettings ( true ) }
395+ onMouseLeave = { ( ) => setShowSettings ( false ) }
396+ { ...settingsPopper . attributes . popper }
397+ style = { {
398+ ...settingsPopper . styles . popper ,
399+ width : 200 ,
400+ backgroundColor : StyleVariables . BACKGROUND_SECONDARY ,
401+ zIndex : 4 ,
402+ padding : "4px 0px" ,
403+ } }
404+ >
405+ < FormGroup >
406+ < FormControlLabel
407+ control = {
408+ < Checkbox checked = { headerMenuProps . column . isInline } />
409+ }
410+ label = "Inline"
411+ />
412+ </ FormGroup >
413+ </ div >
414+ ) }
380415 </ div >
381416 </ div >
382417 </ div >
0 commit comments