Skip to content

Introduce new version designs #15397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2022
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
4 changes: 3 additions & 1 deletion components/dashboard/src/components/PillLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* See License.AGPL.txt in the project root for license information.
*/

export type PillType = "info" | "warn" | "success";
export type PillType = "info" | "warn" | "success" | "neutral";

const PillClsMap: Record<PillType, string> = {
info: "bg-blue-50 text-blue-500 dark:bg-blue-500 dark:text-blue-100",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: Going with the same subtle (neutral) label could be nice with the upcoming changes in #15389, see relevant designs in #15287 (comment). Cc @svenefftinge

Alternatively, using the info variant could be also a good way forward. But in any case, going with the neutral and improving the label designs (colors) (#15218) in the future sounds good.

Using neutral label variant Using info label variant
Frame 269 Frame 269-1

warn: "bg-orange-100 text-orange-700 dark:bg-orange-600 dark:text-orange-100",
success: "bg-green-100 text-green-700 dark:bg-green-600 dark:text-green-100",
neutral: "bg-gray-300 text-gray-800 dark:bg-gray-600 dark:text-gray-100",
};

/**
Expand All @@ -19,6 +20,7 @@ const PillClsMap: Record<PillType, string> = {
* info: Renders a blue pile label (default).\
* warn: Renders an orange pile label.
* success: Renders an green pile label.
* subtle: Renders a grey pile label.
*
* **className**\
* Add additional css classes to style this component.
Expand Down
56 changes: 27 additions & 29 deletions components/dashboard/src/settings/SelectIDE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,42 +176,40 @@ function renderIdeOption(
version: IDEOption["imageVersion"],
onSelect: () => void,
): JSX.Element {
const label = option.type === "desktop" ? "" : option.type;
const shouldShowOptionType = option.type !== "desktop" || option.title === "VS Code"; // Force show of "Desktop" in the list for VS Code Desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taking a note on hardcoding, let's go with it for now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could add something like forceShowType in https://github.com/gitpod-io/gitpod/blob/main/install/installer/pkg/components/ide-service/ide_config_configmap.go to VS Code Desktop to remove this.

const card = (
<SelectableCardSolid className="w-36 h-44" title={option.title} selected={selected} onClick={onSelect}>
<div className="flex justify-center mt-3">
<img className="w-16 filter-grayscale self-center" src={option.logo} alt="logo" />
</div>
<div
className="mt-2 px-3 py-1 self-center"
style={{
minHeight: "1.75rem",
}}
>
{label ? (
<span
className={`font-semibold text-sm ${
selected ? "text-gray-100 dark:text-gray-600" : "text-gray-600 dark:text-gray-500"
} uppercase`}
>
{label}
</span>
) : (
<></>
)}
</div>

{version ? (
<div
className={`font-semibold text-xs ${
selected ? "text-gray-100 dark:text-gray-600" : "text-gray-600 dark:text-gray-500"
} uppercase px-3 self-center`}
<span
className={`font-normal font-mono text-xs ${
selected
? "text-gray-100 dark:text-gray-600"
: "text-gray-400 contrast-more:text-gray-600 dark:text-gray-500"
} pl-1 self-start`}
title="The IDE's current version on Gitpod"
>
{version}
</div>
</span>
) : (
<span
style={{
minHeight: "1rem",
}}
></span>
)}
<div className="flex justify-center mt-3 mb-2">
<img className="w-16 filter-grayscale self-center" src={option.logo} alt="logo" />
</div>
{shouldShowOptionType ? (
<PillLabel type="warn" className="place-self-start py-0.5 my-2 flex">
<span className="text-xs capitalize">{option.type}</span>
</PillLabel>
) : (
<></>
option.label && (
<PillLabel type="neutral" className="place-self-start py-0.5 my-2 flex">
<span className="text-xs normal-case font-medium">{option.label}</span>
</PillLabel>
)
)}
</SelectableCardSolid>
);
Expand Down
4 changes: 4 additions & 0 deletions install/installer/cmd/testdata/render/aws-setup/output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions install/installer/cmd/testdata/render/gcp-setup/output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions install/installer/cmd/testdata/render/kind-ide/output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions install/installer/cmd/testdata/render/kind-meta/output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading