Skip to content

Commit 3848649

Browse files
committed
Behave nicely in dedicated emulated preview envs
1 parent b0cdb79 commit 3848649

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

components/dashboard/src/workspaces/Workspaces.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { VideoCarousel } from "./VideoCarousel";
2222
import { BlogBanners } from "./BlogBanners";
2323
import { Book, BookOpen, Building, Code, GraduationCap } from "lucide-react";
2424
import { ReactComponent as GitpodStrokedSVG } from "../icons/gitpod-stroked.svg";
25-
import { isGitpodIo } from "../utils";
2625
import PersonalizedContent from "./PersonalizedContent";
2726
import { useListenToWorkspacesWSMessages as useListenToWorkspacesStatusUpdates } from "../data/workspaces/listen-to-workspace-ws-messages";
2827
import { Subheading } from "@podkit/typography/Headings";
@@ -211,15 +210,19 @@ const WorkspacesPage: FunctionComponent = () => {
211210
{!isLoading &&
212211
(activeWorkspaces.length > 0 || inactiveWorkspaces.length > 0 || searchTerm ? (
213212
<>
214-
<div className={isGitpodIo() ? "!pl-0 app-container flex flex-1 flex-row" : "app-container"}>
213+
<div
214+
className={
215+
!isDedicatedInstallation ? "!pl-0 app-container flex flex-1 flex-row" : "app-container"
216+
}
217+
>
215218
<div>
216219
<WorkspacesSearchBar
217220
limit={limit}
218221
searchTerm={searchTerm}
219222
onLimitUpdated={setLimit}
220223
onSearchTermUpdated={setSearchTerm}
221224
/>
222-
<ItemsList className={isGitpodIo() ? "app-container xl:!pr-4 pb-40" : ""}>
225+
<ItemsList className={!isDedicatedInstallation ? "app-container xl:!pr-4 pb-40" : ""}>
223226
<div className="border-t border-gray-200 dark:border-gray-800"></div>
224227
{filteredActiveWorkspaces.map((info) => {
225228
return <WorkspaceEntry key={info.id} info={info} />;
@@ -284,7 +287,7 @@ const WorkspacesPage: FunctionComponent = () => {
284287
</ItemsList>
285288
</div>
286289
{/* Show Educational if user is in gitpodIo */}
287-
{isGitpodIo() && (
290+
{!isDedicatedInstallation && (
288291
<div className="max-xl:hidden border-l border-gray-200 dark:border-gray-800 pl-6 pt-5 pb-4 space-y-8">
289292
<VideoCarousel />
290293
<div className="flex flex-col gap-2">

components/dashboard/src/workspaces/WorkspacesSearchBar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { StartWorkspaceModalKeyBinding } from "../App";
99
import DropDown from "../components/DropDown";
1010
import search from "../icons/search.svg";
1111
import { LinkButton } from "@podkit/buttons/LinkButton";
12-
import { isGitpodIo } from "../utils";
12+
import { useInstallationConfiguration } from "../data/installation/default-workspace-image-query";
1313

1414
type WorkspacesSearchBarProps = {
1515
searchTerm: string;
@@ -24,8 +24,11 @@ export const WorkspacesSearchBar: FunctionComponent<WorkspacesSearchBarProps> =
2424
onSearchTermUpdated,
2525
onLimitUpdated,
2626
}) => {
27+
const { data: installationConfig } = useInstallationConfiguration();
28+
const isDedicatedInstallation = !!installationConfig?.isDedicatedInstallation;
29+
2730
return (
28-
<div className={isGitpodIo() ? "app-container xl:!pr-4 py-5 flex" : "py-5 flex"}>
31+
<div className={!isDedicatedInstallation ? "app-container xl:!pr-4 py-5 flex" : "py-5 flex"}>
2932
<div className="flex relative h-10 my-auto">
3033
<img src={search} title="Search" className="filter-grayscale absolute top-3 left-3" alt="search icon" />
3134
<input

0 commit comments

Comments
 (0)