Skip to content

Commit 5106dfd

Browse files
refactor(site): refactor the ports button design (#8879)
* Refactor button * Move component to where it is used * Add base state of port forward component * Add stories and empty state * Add listening ports to handlers * Add review suggestions * Fix minor thing
1 parent 1c3ec87 commit 5106dfd

File tree

10 files changed

+349
-264
lines changed

10 files changed

+349
-264
lines changed

site/src/components/PortForwardButton/PortForwardButton.tsx

Lines changed: 0 additions & 211 deletions
This file was deleted.

site/src/components/Resources/AgentRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
OpenDropdown,
99
} from "components/DropdownArrows/DropdownArrows"
1010
import { LogLine, logLineHeight } from "components/Logs/Logs"
11-
import { PortForwardButton } from "components/PortForwardButton/PortForwardButton"
11+
import { PortForwardButton } from "./PortForwardButton"
1212
import { VSCodeDesktopButton } from "components/VSCodeDesktopButton/VSCodeDesktopButton"
1313
import {
1414
FC,
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import Box from "@mui/material/Box"
2+
import { PortForwardPopoverView } from "./PortForwardButton"
3+
import type { Meta, StoryObj } from "@storybook/react"
4+
import { MockListeningPortsResponse } from "testHelpers/entities"
5+
6+
const meta: Meta<typeof PortForwardPopoverView> = {
7+
title: "components/PortForwardPopoverView",
8+
component: PortForwardPopoverView,
9+
decorators: [
10+
(Story) => (
11+
<Box
12+
sx={{
13+
width: (theme) => theme.spacing(38),
14+
border: (theme) => `1px solid ${theme.palette.divider}`,
15+
borderRadius: 1,
16+
backgroundColor: (theme) => theme.palette.background.paper,
17+
}}
18+
>
19+
<Story />
20+
</Box>
21+
),
22+
],
23+
}
24+
25+
export default meta
26+
type Story = StoryObj<typeof PortForwardPopoverView>
27+
28+
export const WithPorts: Story = {
29+
args: {
30+
ports: MockListeningPortsResponse.ports,
31+
},
32+
}
33+
34+
export const Empty: Story = {
35+
args: {
36+
ports: [],
37+
},
38+
}

0 commit comments

Comments
 (0)