improve styling (update to secondary button included)
This commit is contained in:
parent
cdd05a267f
commit
d88f64155a
2 changed files with 31 additions and 31 deletions
|
|
@ -52,7 +52,7 @@ export const SecondaryButton = styled.button`
|
|||
margin: 8px;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
||||
border: 1px solid ${vscInputBorder};
|
||||
border: 1px solid ${lightGray};
|
||||
color: ${vscForeground};
|
||||
background-color: ${vscInputBackground};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
import React from "react";
|
||||
import {
|
||||
Listbox,
|
||||
ListboxButton,
|
||||
ListboxOptions,
|
||||
Transition,
|
||||
} from "../../ui";
|
||||
import { ChevronDownIcon } from "@heroicons/react/24/outline";
|
||||
import { Button, SecondaryButton, vscButtonBackground } from "../..";
|
||||
import { fontSize } from "../../../util";
|
||||
import { Listbox, ListboxButton, ListboxOptions, Transition } from "../../ui";
|
||||
import { useFontSize } from "../../ui/font";
|
||||
|
||||
interface ProgressBarProps {
|
||||
|
|
@ -17,17 +12,22 @@ interface ProgressBarProps {
|
|||
|
||||
function ProgressBar({ label, current, total }: ProgressBarProps) {
|
||||
const percentage = Math.min((current / total) * 100, 100);
|
||||
|
||||
|
||||
return (
|
||||
<div className="mb-4">
|
||||
<div className="flex justify-between text-xs mb-1">
|
||||
<div className="mb-1 flex justify-between text-xs">
|
||||
<span>{label}</span>
|
||||
<span>{current}/{total}</span>
|
||||
<span>
|
||||
{current}/{total}
|
||||
</span>
|
||||
</div>
|
||||
<div className="w-full bg-gray-700 rounded-full h-2">
|
||||
<div
|
||||
className="bg-blue-500 h-2 rounded-full transition-all duration-300"
|
||||
style={{ width: `${percentage}%` }}
|
||||
<div className="h-2 w-full rounded-full bg-gray-700">
|
||||
<div
|
||||
className="h-2 rounded-full transition-all duration-300"
|
||||
style={{
|
||||
width: `${percentage}%`,
|
||||
backgroundColor: vscButtonBackground,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -59,43 +59,43 @@ export default function FreeTrialButton() {
|
|||
</ListboxButton>
|
||||
|
||||
<Transition>
|
||||
<ListboxOptions className="pb-0 min-w-80">
|
||||
<div className="p-4">
|
||||
<h3 className="text-sm font-semibold mb-4">
|
||||
<ListboxOptions className="min-w-80 pb-0">
|
||||
<div className="px-4 pb-4">
|
||||
<h3 className="mb-4 text-sm font-semibold">
|
||||
You are currently using the free trial
|
||||
</h3>
|
||||
|
||||
<ProgressBar
|
||||
|
||||
<ProgressBar
|
||||
label="Autocomplete usage"
|
||||
current={autocompleteUsage.current}
|
||||
total={autocompleteUsage.total}
|
||||
/>
|
||||
|
||||
<ProgressBar
|
||||
|
||||
<ProgressBar
|
||||
label="Chat usage"
|
||||
current={chatUsage.current}
|
||||
total={chatUsage.total}
|
||||
/>
|
||||
|
||||
<div className="flex gap-2 mt-4">
|
||||
<button
|
||||
className="flex-1 px-3 py-2 text-sm border border-gray-600 rounded-md hover:bg-gray-700 transition-colors"
|
||||
|
||||
<div className="mt-4 flex gap-2">
|
||||
<SecondaryButton
|
||||
className="flex-1"
|
||||
onClick={() => {
|
||||
// TODO: Implement eject from trial
|
||||
console.log("Eject from trial clicked");
|
||||
}}
|
||||
>
|
||||
Eject from trial
|
||||
</button>
|
||||
<button
|
||||
className="flex-1 px-3 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
||||
</SecondaryButton>
|
||||
<Button
|
||||
className="flex-1"
|
||||
onClick={() => {
|
||||
// TODO: Implement upgrade
|
||||
console.log("Upgrade clicked");
|
||||
}}
|
||||
>
|
||||
Upgrade
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</ListboxOptions>
|
||||
|
|
@ -103,4 +103,4 @@ export default function FreeTrialButton() {
|
|||
</div>
|
||||
</Listbox>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue