Skip to content

Commit a4bcb5a

Browse files
[dashboard] Introduce component CodeText
1 parent ce3ad30 commit a4bcb5a

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
export default function CodeText(p: { children?: React.ReactNode }) {
8+
return <span className="bg-gray-100 dark:bg-gray-800 px-1.5 py-1 rounded-md text-sm font-mono font-medium">{p.children}</span>;
9+
}

components/dashboard/src/settings/Account.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { getGitpodService, gitpodHostUrl } from "../service/service";
1111
import { UserContext } from "../user-context";
1212
import settingsMenu from "./settings-menu";
1313
import ConfirmationModal from "../components/ConfirmationModal";
14+
import CodeText from "../components/CodeText";
1415

1516
export default function Account() {
1617
const { user } = useContext(UserContext);
@@ -46,7 +47,7 @@ export default function Account() {
4647

4748
<PageWithSubMenu subMenu={settingsMenu} title='Account' subtitle='Manage account and git configuration.'>
4849
<h3>Profile</h3>
49-
<p className="text-base text-gray-500 pb-4 max-w-2xl">The following information will be used to set up git configuration. You can override git author name and email per project by using the default environment variables <span className="bg-gray-100 dark:bg-gray-800 px-1.5 py-1 rounded-md text-sm font-mono font-medium">GIT_AUTHOR_NAME</span> and <span className="bg-gray-100 dark:bg-gray-800 px-1.5 py-1 rounded-md text-sm font-mono font-medium">GIT_COMMITTER_EMAIL</span>.</p>
50+
<p className="text-base text-gray-500 pb-4 max-w-2xl">The following information will be used to set up git configuration. You can override git author name and email per project by using the default environment variables <CodeText>GIT_AUTHOR_NAME</CodeText> and <CodeText>GIT_COMMITTER_EMAIL</CodeText>.</p>
5051
<div className="flex flex-col lg:flex-row">
5152
<div>
5253
<div className="mt-4">

components/dashboard/src/settings/EnvironmentVariables.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
*/
66

77
import { UserEnvVarValue } from "@gitpod/gitpod-protocol";
8-
import React, { useEffect, useRef, useState } from "react";
8+
import { useEffect, useRef, useState } from "react";
99
import ConfirmationModal from "../components/ConfirmationModal";
1010
import { Item, ItemField, ItemFieldContextMenu, ItemsList } from "../components/ItemsList";
1111
import Modal from "../components/Modal";
1212
import { PageWithSubMenu } from "../components/PageWithSubMenu";
1313
import { getGitpodService } from "../service/service";
1414
import settingsMenu from "./settings-menu";
15+
import CodeText from "../components/CodeText";
1516

1617
interface EnvVarModalProps {
1718
envVar: UserEnvVarValue;
@@ -70,7 +71,7 @@ function AddEnvVarModal(p: EnvVarModalProps) {
7071
onChange={(v) => { update({repositoryPattern: v.target.value}) }} />
7172
</div>
7273
<div className="mt-1">
73-
<p className="text-gray-500">You can pass a variable for a specific project or use wildcard character (<span className="bg-gray-100 dark:bg-gray-800 px-1.5 py-1 rounded-md text-sm font-mono font-medium">*/*</span>) to make it available in more projects.</p>
74+
<p className="text-gray-500">You can pass a variable for a specific project or use wildcard character (<CodeText>*/*</CodeText>) to make it available in more projects.</p>
7475
</div>
7576
</div>
7677
<div className="flex justify-end mt-6">

0 commit comments

Comments
 (0)