Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/components/Navigation/KebabMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ConfigContext } from "../../common/App/ConfigContext";
import { ToggleSwitch } from "../../common/ToggleSwitch";
import { DigmaLogoFlatIcon } from "../../common/icons/16px/DigmaLogoFlatIcon";
import { OpenTelemetryLogoIcon } from "../../common/icons/16px/OpenTelemetryLogoIcon";
import { LocalEngineIcon } from "../../common/icons/LocalEngineIcon";
import { MenuList } from "../common/MenuList";
import { ListItemIconContainer } from "../common/MenuList/styles";
import { Popup } from "../common/Popup";
Expand Down Expand Up @@ -84,17 +85,13 @@ export const KebabMenu = (props: KebabMenuProps) => {
icon: <DigmaLogoFlatIcon size={16} color={"currentColor"} />,
onClick: handleOnboardingClick
},
...(isDigmaEngineRunning(config)
? [
{
id: "localEngine",
groupName: "settings",
label: "Local Engine",
icon: <s.LocalEngineStatusBadge />,
onClick: handleLocalEngineClick
}
]
: [])
{
id: "localEngine",
groupName: "settings",
label: "Local Engine",
icon: <LocalEngineIcon isActive={isDigmaEngineRunning(config)} />,
onClick: handleLocalEngineClick
}
]}
/>
</Popup>
Expand Down
35 changes: 35 additions & 0 deletions src/components/common/icons/LocalEngineIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react";
import { useIconProps } from "./hooks";
import { IconProps } from "./types";

const LocalEngineIconComponent = (
props: IconProps & { isActive?: boolean }
) => {
const { size, color } = useIconProps(props);
const status = props.isActive ? "#6EBD9C" : undefined;

return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox="0 0 16 14"
fill={color}
>
<g stroke="#F0F1F7">
<rect
width="9.667"
height="8.333"
x="3.167"
y=".833"
rx=".833"
fill={status}
/>
<path d="M8 9v3.333m0 0H0m8 0h8" />
<path strokeLinecap="round" strokeWidth="2" d="M6.667 12.334h2.666" />
</g>
</svg>
);
};

export const LocalEngineIcon = React.memo(LocalEngineIconComponent);