Skip to content

Commit

Permalink
Simplify action bar
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Nov 19, 2024
1 parent 0c475ae commit 95bc485
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions packages/web-console/src/scenes/Editor/Metrics/metric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ import * as QuestDB from "../../../utils/questdb"
import { Graph } from "./graph"
import uPlot from "uplot"
import styled from "styled-components"
import {
Box,
Button,
ForwardRef,
Loader,
DropdownMenu,
} from "@questdb/react-components"
import { Error, Menu, Trash } from "@styled-icons/boxicons-regular"
import { Table } from "@styled-icons/remix-line"
import { Box, Button } from "@questdb/react-components"
import { Error, Trash } from "@styled-icons/boxicons-regular"
import { useSelector } from "react-redux"
import { selectors } from "../../../store"
import isEqual from "lodash.isequal"
Expand All @@ -36,10 +29,6 @@ const MetricInfoRoot = styled(Box).attrs({
height: 25rem;
`

const DropdownMenuContent = styled(DropdownMenu.Content)`
background: ${({ theme }) => theme.color.backgroundDarker};
`

const graphDataConfigs = {
[MetricType.LATENCY]: {
getData: (latency: Latency[]): uPlot.AlignedData => [
Expand Down Expand Up @@ -186,22 +175,11 @@ export const Metric = ({
/>
}
actions={
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<ForwardRef>
<Button skin="transparent">
<Menu size="18px" />
</Button>
</ForwardRef>
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenuContent>
<DropdownMenu.Item onClick={() => onRemove(metric)}>
<Trash size="18px" /> Remove
</DropdownMenu.Item>
</DropdownMenuContent>
</DropdownMenu.Portal>
</DropdownMenu.Root>
<Box gap="0.5rem" align="center">
<Button skin="transparent" onClick={() => onRemove(metric)}>
<Trash size="18px" />
</Button>
</Box>
}
/>
)
Expand Down

0 comments on commit 95bc485

Please sign in to comment.