Skip to content

Commit d224833

Browse files
gtsiolisroboquat
authored andcommitted
Add beta label and feedback link on the usage page
1 parent 432fb65 commit d224833

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

components/dashboard/src/components/PillLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
export default function PillLabel(props: { children?: React.ReactNode; type?: "info" | "warn"; className?: string }) {
1818
const infoStyle = "bg-blue-50 text-blue-500 dark:bg-blue-500 dark:text-blue-100";
1919
const warnStyle = "bg-orange-100 text-orange-700 dark:bg-orange-600 dark:text-orange-100";
20-
const style = `px-3 py-1 text-sm uppercase rounded-xl ${props.type === "warn" ? warnStyle : infoStyle} ${
20+
const style = `px-2 py-1 text-sm uppercase rounded-xl ${props.type === "warn" ? warnStyle : infoStyle} ${
2121
props.className
2222
}`;
2323
return <span className={style}>{props.children}</span>;

components/dashboard/src/components/UsageView.tsx

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { ReactComponent as UsageIcon } from "../images/usage-default.svg";
2424
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode";
2525
import { toRemoteURL } from "../projects/render-utils";
2626
import { WorkspaceType } from "@gitpod/gitpod-protocol";
27+
import PillLabel from "./PillLabel";
2728

2829
interface UsageViewProps {
2930
attributionId: AttributionId;
@@ -169,11 +170,38 @@ function UsageView({ attributionId, billingMode }: UsageViewProps) {
169170
{getBillingHistory()}
170171
</div>
171172
{!isLoading && (
172-
<div className="flex flex-col truncate">
173-
<div className="text-base text-gray-500">Total usage</div>
174-
<div className="flex text-lg text-gray-600 font-semibold">
175-
<CreditsSvg className="my-auto mr-1" />
176-
<span>{Intl.NumberFormat().format(totalCreditsUsed)} Credits</span>
173+
<div>
174+
<div className="flex flex-col truncate">
175+
<div className="text-base text-gray-500">Total usage</div>
176+
<div className="flex text-lg text-gray-600 font-semibold">
177+
<CreditsSvg className="my-auto mr-1" />
178+
<span>{totalCreditsUsed} Credits</span>
179+
</div>
180+
</div>
181+
<div className="flex flex-col truncate mt-8 text-sm">
182+
<div className="text-gray-400 dark:text-gray-500">
183+
This feature is in{" "}
184+
<PillLabel
185+
type="warn"
186+
className="font-semibold mt-2 ml-0 py-0.5 px-1 self-center"
187+
>
188+
<span className="text-xs">Beta</span>
189+
</PillLabel>
190+
<br />
191+
<a
192+
href="https://www.gitpod.io/docs/references/gitpod-releases"
193+
className="gp-link"
194+
>
195+
Learn more
196+
</a>
197+
&nbsp;·&nbsp;
198+
<a
199+
href="https://github.com/gitpod-io/gitpod/issues/12636"
200+
className="gp-link"
201+
>
202+
Send feedback
203+
</a>
204+
</div>
177205
</div>
178206
</div>
179207
)}

0 commit comments

Comments
 (0)