Skip to content

Commit 9c4971d

Browse files
committed
[dashboard] button styling
1 parent e33d526 commit 9c4971d

12 files changed

+12477
-61
lines changed

components/dashboard/src/components/CheckBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function CheckBox(props: {
2525
const checkboxId = `checkbox-${props.title}-${String(Math.random())}`;
2626

2727
return <div className="flex mt-4">
28-
<input className={"h-4 w-4 focus:ring-0 mt-1 rounded cursor-pointer border-2 " + (props.checked ? 'bg-gray-800' : '')} type="checkbox"
28+
<input className={"h-4 w-4 focus:ring-0 mt-1 rounded cursor-pointer border border-gray-300 focus:border-gray-400 " + (props.checked ? 'bg-gray-800' : '')} type="checkbox"
2929
id={checkboxId}
3030
{...inputProps}
3131
/>

components/dashboard/src/components/SelectableCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export interface SelectableCardProps {
1313
}
1414

1515
function SelectableCard(props: SelectableCardProps) {
16-
return <div className={`rounded-xl px-4 py-3 flex flex-col cursor-pointer group border-2 ${props.selected ? 'border-green-600' : 'border-gray-300 hover:border-gray-400'} ${props.className || ''}`} onClick={props.onClick}>
16+
return <div className={`rounded-xl px-4 py-3 flex flex-col cursor-pointer group border-2 ${props.selected ? 'border-green-500' : 'border-gray-300 hover:border-gray-400'} ${props.className || ''}`} onClick={props.onClick}>
1717
<div className="flex items-center">
18-
<p className={`w-full text-base font-semibold ${props.selected ? 'text-green-600' : 'text-gray-300 group-hover:text-gray-400'}`}>{props.title}</p>
19-
<input className={props.selected ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'} type="radio" checked={props.selected} />
18+
<p className={`w-full text-base font-semibold ${props.selected ? 'text-green-500' : 'text-gray-300 group-hover:text-gray-400'}`}>{props.title}</p>
19+
<input className={'text-green-500 ' + (props.selected ? 'opacity-100' : 'opacity-0 group-hover:opacity-100')} type="radio" checked={props.selected} />
2020
</div>
2121
{props.children}
2222
</div>;

components/dashboard/src/index.css

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,34 @@
3535

3636
@layer components {
3737
button {
38-
@apply cursor-pointer px-4 py-2 my-auto bg-green-600 hover:bg-green-700 border-2 border-green-800 text-gray-100 text-sm font-medium rounded-md focus:outline-none focus:ring focus:border-blue-300;
38+
@apply cursor-pointer px-4 py-2 my-auto bg-green-600 hover:bg-green-700 text-gray-100 text-sm font-medium rounded-md focus:outline-none focus:ring;
39+
}
40+
button.secondary {
41+
@apply bg-gray-100 hover:bg-gray-200 text-gray-500 hover:text-gray-600;
42+
}
43+
button.danger {
44+
@apply bg-red-600 hover:bg-red-700 text-gray-100;
45+
}
46+
button.danger.secondary {
47+
@apply bg-red-50 hover:bg-red-100 text-red-600 hover:text-red-700;
3948
}
40-
4149
button:disabled {
42-
@apply cursor-default;
50+
@apply cursor-default opacity-50 pointer-events-none;
4351
}
4452

45-
input[type=text] {
46-
@apply text-xs block w-56 text-sm text-gray-600 rounded-md border-2 border-gray-400 focus:border-gray-500 focus:bg-white focus:ring-0;
53+
input[type=text], input[type=password], select {
54+
@apply text-xs block w-56 text-sm text-gray-600 rounded-md border border-gray-300 focus:border-gray-400 focus:bg-white focus:ring-0;
4755
}
4856

49-
input[type=text]::placeholder {
57+
input[type=text]::placeholder, input[type=password]::placeholder {
5058
@apply text-gray-400;
5159
}
5260

5361
input[disabled] {
54-
@apply bg-gray-100 border-2 border-gray-300 text-gray-400;
62+
@apply bg-gray-100 border border-gray-200 text-gray-400;
5563
}
5664

65+
input[type=radio] {
66+
@apply rounded-md border border-gray-300 focus:border-gray-400 focus:bg-white focus:ring-0;
67+
}
5768
}

components/dashboard/src/settings/Account.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export default function Account() {
3535
<li className="ml-5">Your subscription will be cancelled. If you obtained a Gitpod subscription through the GitHub marketplace, you need to cancel your plan there.</li>
3636
</ol>
3737
<p className="pt-4 pb-2 text-gray-600 text-base font-bold">Type your email to confirm</p>
38-
<input className="border-2 border-gray-400 w-full" type="text" onChange={e => setTypedEmail(e.target.value)}></input>
38+
<input className="w-full" type="text" onChange={e => setTypedEmail(e.target.value)}></input>
3939
</div>
4040
<div className="flex justify-end mt-6">
41-
<button className="text-gray-900 border-white bg-white hover:border-gray-200" onClick={close}>Cancel</button>
42-
<button className={"ml-2 border-red-900 bg-red-500 disabled:opacity-50" + (typedEmail !== primaryEmail ? '' : ' hover:bg-red-700')} onClick={deleteAccount} disabled={typedEmail !== primaryEmail}>Delete Account</button>
41+
<button className="secondary" onClick={close}>Cancel</button>
42+
<button className="ml-2 danger" onClick={deleteAccount} disabled={typedEmail !== primaryEmail}>Delete Account</button>
4343
</div>
4444
</Modal>
4545

@@ -67,7 +67,7 @@ export default function Account() {
6767
</div>
6868
<h3 className="mt-12">Delete Account</h3>
6969
<p className="text-base text-gray-500 pb-4">This action will remove all the data associated with your account in Gitpod.</p>
70-
<button className="border-red-600 text-red-600 bg-white hover:border-red-800 hover:text-red-800" onClick={() => setModal(true)}>Delete Account</button>
70+
<button className="danger secondary" onClick={() => setModal(true)}>Delete Account</button>
7171
</SettingsPage>
7272
</div>;
7373
}

components/dashboard/src/settings/EnvironmentVariables.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ function AddEnvVarModal(p: EnvVarModalProps) {
7373
</div>
7474
</div>
7575
<div className="flex justify-end mt-6">
76-
<button className="text-gray-900 border-white bg-white hover:bg-gray-100 hover:border-gray-100" onClick={p.onClose}>Cancel</button>
77-
<button className={"ml-2 disabled:opacity-50"} onClick={save} >{isNew ? 'Add' : 'Update'} Variable</button>
76+
<button className="secondary" onClick={p.onClose}>Cancel</button>
77+
<button className="ml-2" onClick={save} >{isNew ? 'Add' : 'Update'} Variable</button>
7878
</div>
7979
</Modal>
8080
}
@@ -152,12 +152,12 @@ export default function EnvVars() {
152152
<div className="pt-28 flex flex-col items-center w-96 m-auto">
153153
<h3 className="text-center pb-3 text-gray-500">No Environment Variables</h3>
154154
<div className="text-center pb-6 text-gray-500">In addition to user-specific environment variables you can also pass variables through a workspace creation URL. <a className="text-gray-400 underline underline-thickness-thin underline-offset-small hover:text-gray-600" href="https://www.gitpod.io/docs/environment-variables/#using-the-account-settings">Learn more</a></div>
155-
<button onClick={add} className="font-medium">New Environment Variable</button>
155+
<button onClick={add}>New Environment Variable</button>
156156
</div>
157157
</div>
158158
: <div className="space-y-2">
159159
<div className="flex justify-end mb-2">
160-
<button onClick={add} className="ml-2 font-medium">New Environment Variable</button>
160+
<button onClick={add} className="ml-2">New Environment Variable</button>
161161
</div>
162162
<div className="flex flex-col space-y-2">
163163
<div className="px-3 py-3 flex justify-between space-x-2 text-sm text-gray-400 border-t border-b border-gray-200">

components/dashboard/src/settings/Integrations.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function GitProviders() {
218218
</div>
219219
</div>
220220
<div className="flex justify-end mt-6">
221-
<button className={"ml-2 border-red-900 bg-red-500 hover:bg-red-700"} onClick={() => disconnect(diconnectModal.provider)}>Disconnect Provider</button>
221+
<button className={"ml-2 danger secondary"} onClick={() => disconnect(diconnectModal.provider)}>Disconnect Provider</button>
222222
</div>
223223
</Modal>
224224
)}
@@ -350,7 +350,7 @@ function GitIntegrations() {
350350
</div>
351351
</div>
352352
<div className="flex justify-end mt-6">
353-
<button className={"ml-2 border-red-900 bg-red-500 hover:bg-red-700"} onClick={() => deleteProvider(modal.provider)}>Remove Integration</button>
353+
<button className={"ml-2 danger secondary"} onClick={() => deleteProvider(modal.provider)}>Remove Integration</button>
354354
</div>
355355
</Modal>
356356
)}
@@ -567,7 +567,7 @@ function GitIntegrationModal(props: ({
567567
{props.mode === "new" && (
568568
<div className="flex flex-col space-y-2">
569569
<label htmlFor="type" className="font-medium">Provider Type</label>
570-
<select name="type" value={type} disabled={props.mode !== "new"} className="rounded-md w-full border-2 border-gray-400"
570+
<select name="type" value={type} disabled={props.mode !== "new"} className="w-full"
571571
onChange={(e) => setType(e.target.value)}>
572572
<option value="GitHub">GitHub</option>
573573
<option value="GitLab">GitLab</option>
@@ -576,13 +576,13 @@ function GitIntegrationModal(props: ({
576576
)}
577577
<div className="flex flex-col space-y-2">
578578
<label htmlFor="hostName" className="font-medium">Provider Host Name</label>
579-
<input name="hostName" disabled={props.mode === "edit"} type="text" value={host} className="rounded-md w-full border-2 border-gray-400"
579+
<input name="hostName" disabled={props.mode === "edit"} type="text" value={host} className="w-full"
580580
onChange={(e) => updateHostValue(e.target.value)} />
581581
</div>
582582
<div className="flex flex-col space-y-2">
583583
<label htmlFor="redirectURL" className="font-medium">Redirect URL</label>
584584
<div className="w-full relative">
585-
<input name="redirectURL" disabled={true} readOnly={true} type="text" value={redirectURL} className="rounded-md w-full truncate pr-8" />
585+
<input name="redirectURL" disabled={true} readOnly={true} type="text" value={redirectURL} className="w-full truncate" />
586586
<div className="cursor-pointer" onClick={() => copyRedirectUrl()}>
587587
<img src={copy} title="Copy the Redirect URL to clippboard." className="absolute top-1/3 right-3" />
588588
</div>
@@ -591,12 +591,12 @@ function GitIntegrationModal(props: ({
591591
</div>
592592
<div className="flex flex-col space-y-2">
593593
<label htmlFor="clientId" className="font-medium">Client ID</label>
594-
<input name="clientId" type="text" value={clientId} className="rounded-md w-full border-2 border-gray-400"
594+
<input name="clientId" type="text" value={clientId} className="w-full"
595595
onChange={(e) => updateClientId(e.target.value)} />
596596
</div>
597597
<div className="flex flex-col space-y-2">
598598
<label htmlFor="clientSecret" className="font-medium">Client Secret</label>
599-
<input name="clientSecret" type="password" value={clientSecret} className="rounded-md w-full border-2 border-gray-400"
599+
<input name="clientSecret" type="password" value={clientSecret} className="w-full"
600600
onChange={(e) => updateClientSecret(e.target.value)} />
601601
</div>
602602
{errorMessage && (
@@ -613,7 +613,7 @@ function GitIntegrationModal(props: ({
613613
)}
614614
</div>
615615
<div className="flex justify-end mt-6">
616-
<button className="disabled:opacity-50" onClick={() => validate() && activate()} disabled={!!validationError || busy}>Activate Integration</button>
616+
<button onClick={() => validate() && activate()} disabled={!!validationError || busy}>Activate Integration</button>
617617
</div>
618618
</Modal>);
619619
}

components/dashboard/src/start/CreateWorkspace.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class CreateWorkspace extends React.Component<CreateWorkspaceProps, Creat
139139
return <StartPage phase={phase} error={!!error}>
140140
{statusMessage}
141141
{error && <div>
142-
<a href={gitpodHostUrl.asDashboard().toString()}><button className="mt-8 px-4 py-2 text-gray-500 bg-white font-semibold border-gray-500 hover:text-gray-700 hover:bg-gray-100 hover:border-gray-700">Go back to dashboard</button></a>
142+
<a href={gitpodHostUrl.asDashboard().toString()}><button className="mt-8 secondary">Go back to dashboard</button></a>
143143
<p className="mt-14 text-base text-gray-400 flex space-x-2">
144144
<a href="https://www.gitpod.io/docs/">Docs</a>
145145
<span></span>
@@ -204,6 +204,6 @@ function RunningPrebuildView(props: RunningPrebuildViewProps) {
204204
<Suspense fallback={<div />}>
205205
<WorkspaceLogs logsEmitter={logsEmitter} />
206206
</Suspense>
207-
<button className="mt-6 text-gray-500 border-gray-500 bg-white hover:text-gray-700 hover:bg-gray-100 hover:border-gray-700" onClick={() => { clearTimeout(pollTimeout!); props.onIgnorePrebuild(); }}>Don't Wait for Prebuild</button>
207+
<button className="mt-6 secondary" onClick={() => { clearTimeout(pollTimeout!); props.onIgnorePrebuild(); }}>Don't Wait for Prebuild</button>
208208
</StartPage>;
209209
}

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
265265
</div>
266266
</div>
267267
<div className="mt-10 flex space-x-2">
268-
<button className="px-4 py-2 text-gray-500 bg-white font-semibold border-gray-500 hover:text-gray-700 hover:border-gray-700 hover:bg-gray-100" onClick={() => this.redirectTo(gitpodHostUrl.asDashboard().toString())}>Go to Dashboard</button>
269-
<button className="px-4 py-2 text-gray-50 bg-green-600 font-semibold border-green-800 hover:bg-green-700" onClick={() => this.redirectTo(gitpodHostUrl.asStart(this.state.workspaceInstance?.workspaceId).toString())}>Open Workspace</button>
268+
<button className="secondary" onClick={() => this.redirectTo(gitpodHostUrl.asDashboard().toString())}>Go to Dashboard</button>
269+
<button onClick={() => this.redirectTo(gitpodHostUrl.asStart(this.state.workspaceInstance?.workspaceId).toString())}>Open Workspace</button>
270270
</div>
271271
</div>;
272272
break;
@@ -275,7 +275,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
275275
return <StartPage phase={phase} error={!!error} title={title}>
276276
{statusMessage}
277277
{error && <div>
278-
<button className="mt-8 px-4 py-2 text-gray-500 bg-white font-semibold border-gray-500 hover:text-gray-700 hover:bg-gray-100 hover:border-gray-700" onClick={() => this.redirectTo(gitpodHostUrl.asDashboard().toString())}>Go back to dashboard</button>
278+
<button className="mt-8 secondary" onClick={() => this.redirectTo(gitpodHostUrl.asDashboard().toString())}>Go back to dashboard</button>
279279
<p className="mt-14 text-base text-gray-400 flex space-x-2">
280280
<a href="https://www.gitpod.io/docs/">Docs</a>
281281
<span></span>

0 commit comments

Comments
 (0)