Skip to content

Commit 053b27e

Browse files
committed
[dashboard] Simplify <code> snippets by using CSS instead of a whole component
1 parent 13d62a9 commit 053b27e

File tree

7 files changed

+14
-29
lines changed

7 files changed

+14
-29
lines changed

components/dashboard/src/components/CodeText.tsx

-13
This file was deleted.

components/dashboard/src/index.css

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
@apply text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-500;
7878
}
7979

80+
code {
81+
@apply bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded-md text-sm font-mono font-medium;
82+
}
83+
8084
textarea,
8185
input[type="text"],
8286
input[type="tel"],

components/dashboard/src/settings/EnvironmentVariables.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import ConfirmationModal from "../components/ConfirmationModal";
1010
import { Item, ItemField, ItemFieldContextMenu, ItemsList } from "../components/ItemsList";
1111
import Modal from "../components/Modal";
1212
import { getGitpodService } from "../service/service";
13-
import CodeText from "../components/CodeText";
1413
import { PageWithSettingsSubMenu } from "./PageWithSettingsSubMenu";
1514

1615
interface EnvVarModalProps {
@@ -95,8 +94,8 @@ function AddEnvVarModal(p: EnvVarModalProps) {
9594
</div>
9695
<div className="mt-1">
9796
<p className="text-gray-500">
98-
You can pass a variable for a specific project or use wildcard character (
99-
<CodeText>*/*</CodeText>) to make it available in more projects.
97+
You can pass a variable for a specific project or use wildcard character (<code>*/*</code>) to
98+
make it available in more projects.
10099
</p>
101100
</div>
102101
</div>

components/dashboard/src/settings/ProfileInformation.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { User } from "@gitpod/gitpod-protocol";
88
import { hoursBefore, isDateSmaller } from "@gitpod/gitpod-protocol/lib/util/timeutil";
99
import React, { useContext, useState } from "react";
1010
import Alert from "../components/Alert";
11-
import CodeText from "../components/CodeText";
1211
import Modal from "../components/Modal";
1312
import { getGitpodService } from "../service/service";
1413
import { UserContext } from "../user-context";
@@ -118,9 +117,8 @@ export default function ProfileInformation(props: {
118117
<div>
119118
<p className="text-base text-gray-500 pb-4 max-w-xl">
120119
The following information will be used to set up Git configuration. You can override Git author name and
121-
email per project by using the default environment variables <CodeText>GIT_AUTHOR_NAME</CodeText>,{" "}
122-
<CodeText>GIT_COMMITTER_NAME</CodeText>, <CodeText>GIT_AUTHOR_EMAIL</CodeText> and{" "}
123-
<CodeText>GIT_COMMITTER_EMAIL</CodeText>.
120+
email per project by using the default environment variables <code>GIT_AUTHOR_NAME</code>,{" "}
121+
<code>GIT_COMMITTER_NAME</code>, <code>GIT_AUTHOR_EMAIL</code> and <code>GIT_COMMITTER_EMAIL</code>.
124122
</p>
125123
{props.errorMessage.length > 0 && (
126124
<Alert type="error" closable={true} className="mb-2 max-w-xl rounded-md">

components/dashboard/src/start/CreateWorkspace.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { openAuthorizeWindow } from "../provider-utils";
2323
import { SelectAccountPayload } from "@gitpod/gitpod-protocol/lib/auth";
2424
import { SelectAccountModal } from "../settings/SelectAccountModal";
2525
import PrebuildLogs from "../components/PrebuildLogs";
26-
import CodeText from "../components/CodeText";
2726
import FeedbackComponent from "../feedback-form/FeedbackComponent";
2827
import { isGitpodIo } from "../utils";
2928
import { BillingAccountSelector } from "../components/BillingAccountSelector";
@@ -480,7 +479,7 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) {
480479
<div className="mt-2 flex flex-col space-y-8">
481480
<p className="text-base text-gray-400 w-96">
482481
Permission to access private repositories has been granted. If you are a member of{" "}
483-
<CodeText>{owner}</CodeText>, please try to request access for Gitpod.
482+
<code>{owner}</code>, please try to request access for Gitpod.
484483
</p>
485484
<a className="mx-auto" href={authorizeURL}>
486485
<button>Request Access for Gitpod</button>
@@ -494,7 +493,7 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) {
494493
<div className="mt-2 flex flex-col space-y-8">
495494
<p className="text-base text-gray-400 w-96">
496495
Your access token was updated recently. Please try again if the repository exists and Gitpod was
497-
approved for <CodeText>{owner}</CodeText>.
496+
approved for <code>{owner}</code>.
498497
</p>
499498
<a className="mx-auto" href={authorizeURL}>
500499
<button>Try Again</button>
@@ -507,7 +506,7 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) {
507506
return (
508507
<StartPage phase={StartPhase.Checking} error={p.error}>
509508
<p className="text-base text-gray-400 mt-2">
510-
<CodeText>{repoFullName}</CodeText>
509+
<code>{repoFullName}</code>
511510
</p>
512511
{statusMessage}
513512
{p.error && isGitpodIo() && (

components/dashboard/src/teams/TeamSettings.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Team } from "@gitpod/gitpod-protocol";
88
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode";
99
import { useContext, useEffect, useState } from "react";
1010
import { Redirect, useLocation } from "react-router";
11-
import CodeText from "../components/CodeText";
1211
import ConfirmationModal from "../components/ConfirmationModal";
1312
import { PageWithSubMenu } from "../components/PageWithSubMenu";
1413
import { getGitpodService, gitpodHostUrl } from "../service/service";
@@ -110,7 +109,7 @@ export default function TeamSettings() {
110109
</li>
111110
</ol>
112111
<p className="pt-4 pb-2 text-gray-600 dark:text-gray-400 text-base font-semibold">
113-
Type <CodeText>{team?.slug}</CodeText> to confirm
112+
Type <code>{team?.slug}</code> to confirm
114113
</p>
115114
<input autoFocus className="w-full" type="text" onChange={(e) => setTeamSlug(e.target.value)}></input>
116115
</ConfirmationModal>

components/dashboard/src/whatsnew/WhatsNew-2021-06.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { User } from "@gitpod/gitpod-protocol";
88
import { WhatsNewEntry } from "./WhatsNew";
99
import { switchToVSCodeAction } from "./WhatsNew-2021-04";
10-
import CodeText from "../components/CodeText";
1110
import PillLabel from "../components/PillLabel";
1211

1312
export const WhatsNewEntry202106: WhatsNewEntry = {
@@ -24,8 +23,8 @@ export const WhatsNewEntry202106: WhatsNewEntry = {
2423
</p>
2524
<p className="pb-2 text-gray-500 dark:text-gray-400 text-sm">
2625
Exposing ports are now private by default. You can still change port visibility through the
27-
editor or even configure this with the <CodeText>visibility</CodeText> property in{" "}
28-
<CodeText>.gitpod.yml</CodeText>.
26+
editor or even configure this with the <code>visibility</code> property in{" "}
27+
<code>.gitpod.yml</code>.
2928
</p>
3029
</div>
3130
{user.additionalData?.ideSettings?.defaultIde !== "code" && (

0 commit comments

Comments
 (0)