@@ -3,13 +3,13 @@ import Switch from 'rc-switch';
33import { Menu , MenuItem , MenuButton } from '@szhsin/react-menu' ;
44
55function DropDown ( {
6- Icon, text, action, active, tabIndex, hotkey,
6+ Icon, text, action, active, visibility , tabIndex, hotkey,
77} ) {
88 return (
99 < Menu menuButton = { (
1010 < MenuButton >
1111 < ActionButton { ...{
12- Icon, text, action, active, tabIndex, hotkey,
12+ Icon, text, action, active, visibility , tabIndex, hotkey,
1313 } }
1414 />
1515 </ MenuButton >
@@ -21,10 +21,10 @@ function DropDown({
2121}
2222
2323const FileUploader = ( {
24- Icon, text, active, tabIndex, hotkey, superState,
24+ Icon, text, active, visibility , tabIndex, hotkey, superState,
2525} ) => (
2626 < ActionButton { ...{
27- Icon, text, active, tabIndex, action : ( ) => superState . fileRef . current . click ( ) , hotkey,
27+ Icon, text, active, visibility , tabIndex, action : ( ) => superState . fileRef . current . click ( ) , hotkey,
2828 } }
2929 />
3030) ;
@@ -51,7 +51,7 @@ const Switcher = ({
5151) ;
5252
5353const ActionButton = ( {
54- Icon, text, action, active, tabIndex, hotkey,
54+ Icon, text, action, active, visibility , tabIndex, hotkey,
5555} ) => (
5656 < div
5757 role = "button"
@@ -61,6 +61,7 @@ const ActionButton = ({
6161 onClick = { ( ) => ( active && action ( ) ) }
6262 onKeyDown = { ( ev ) => active && ev . key === ' ' && action ( ) }
6363 data-tip = { hotkey ? hotkey . split ( ',' ) [ 0 ] : '' }
64+ style = { { display : `${ visibility ? '' : 'none' } ` } }
6465 >
6566 < div className = "icon" > < Icon size = "20" /> </ div >
6667 < div style = { { fontSize : 14 } } > { text } </ div >
0 commit comments