Skip to content

Commit 3ef12ac

Browse files
authored
fix: remove connected button (#13625)
It didn't make a lot of sense in current form. It will when we improve autostop.
1 parent 75e7213 commit 3ef12ac

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

site/src/pages/WorkspacePage/WorkspaceScheduleControls.tsx

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
import type { Template, Workspace } from "api/typesGenerated";
1919
import { TopbarData, TopbarIcon } from "components/FullPageLayout/Topbar";
2020
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
21-
import { Pill } from "components/Pill/Pill";
2221
import { useTime } from "hooks/useTime";
2322
import { getWorkspaceActivityStatus } from "modules/workspaces/activity";
2423
import {
@@ -170,11 +169,9 @@ const AutostopDisplay: FC<AutostopDisplayProps> = ({
170169

171170
const [showControlsAnyway, setShowControlsAnyway] = useState(false);
172171
let onClickScheduleIcon: (() => void) | undefined;
173-
let activity: ReactNode = null;
174172

175173
if (activityStatus === "connected") {
176174
onClickScheduleIcon = () => setShowControlsAnyway((it) => !it);
177-
activity = <Pill type="active">Connected</Pill>;
178175

179176
const now = dayjs();
180177
const noRequiredStopSoon =
@@ -183,12 +180,7 @@ const AutostopDisplay: FC<AutostopDisplayProps> = ({
183180

184181
// User has shown controls manually, or we should warn about a nearby required stop
185182
if (!showControlsAnyway && noRequiredStopSoon) {
186-
return (
187-
<>
188-
{activity}
189-
<WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon} />
190-
</>
191-
);
183+
return <WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon} />;
192184
}
193185
}
194186

@@ -239,24 +231,18 @@ const AutostopDisplay: FC<AutostopDisplayProps> = ({
239231

240232
if (tooltip) {
241233
return (
242-
<>
243-
{activity}
244-
<WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon}>
245-
<Tooltip title={tooltip}>{display}</Tooltip>
246-
{controls}
247-
</WorkspaceScheduleContainer>
248-
</>
234+
<WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon}>
235+
<Tooltip title={tooltip}>{display}</Tooltip>
236+
{controls}
237+
</WorkspaceScheduleContainer>
249238
);
250239
}
251240

252241
return (
253-
<>
254-
{activity}
255-
<WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon}>
256-
{display}
257-
{controls}
258-
</WorkspaceScheduleContainer>
259-
</>
242+
<WorkspaceScheduleContainer onClickIcon={onClickScheduleIcon}>
243+
{display}
244+
{controls}
245+
</WorkspaceScheduleContainer>
260246
);
261247
};
262248

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy