mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixing CatalogAddButton (#2639)
* Start first action on button click Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fixing SpeedDial styles Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
2ba0a90cb5
commit
808642b64b
@ -5,5 +5,20 @@
|
|||||||
|
|
||||||
.MuiFab-primary {
|
.MuiFab-primary {
|
||||||
background-color: var(--blue);
|
background-color: var(--blue);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #317bb3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiTooltip-popper {
|
||||||
|
.MuiTooltip-tooltip {
|
||||||
|
background-color: #222;
|
||||||
|
font-size: 12px
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiTooltip-arrow {
|
||||||
|
color: #222;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,6 +45,13 @@ export class CatalogAddButton extends React.Component<CatalogAddButtonProps> {
|
|||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@autobind()
|
||||||
|
onButtonClick() {
|
||||||
|
if (this.menuItems.length == 1) {
|
||||||
|
this.menuItems[0].onClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.menuItems.length === 0) {
|
if (this.menuItems.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
@ -59,6 +66,7 @@ export class CatalogAddButton extends React.Component<CatalogAddButtonProps> {
|
|||||||
onClose={this.onClose}
|
onClose={this.onClose}
|
||||||
icon={<Icon material="add" />}
|
icon={<Icon material="add" />}
|
||||||
direction="up"
|
direction="up"
|
||||||
|
onClick={this.onButtonClick}
|
||||||
>
|
>
|
||||||
{ this.menuItems.map((menuItem, index) => {
|
{ this.menuItems.map((menuItem, index) => {
|
||||||
return <SpeedDialAction
|
return <SpeedDialAction
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user