Skip to content

Commit 3e1c766

Browse files
committed
[dashboard] Misc style updates
1 parent 2ef05e4 commit 3e1c766

File tree

13 files changed

+75
-54
lines changed

13 files changed

+75
-54
lines changed

components/dashboard/src/components/ContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function ContextMenu(props: ContextMenuProps) {
7070
{props.menuEntries.map((e, index) => {
7171
const clickable = e.href || e.onClick || e.link;
7272
const entry = <div className={`px-4 flex py-3 ${clickable ? 'hover:bg-gray-200' : ''} text-sm leading-1 ${e.customFontStyle || font} ${e.separator ? ' border-b border-gray-200' : ''}`} >
73-
<div>{e.title}</div><div className="flex-1"></div>{e.active ? <div className="pl-1 font-semibold">&#x2713;</div> : null}
73+
<div className="truncate w-52">{e.title}</div><div className="flex-1"></div>{e.active ? <div className="pl-1 font-semibold">&#x2713;</div> : null}
7474
</div>
7575
const key = `entry-${menuId}-${index}-${e.title}`;
7676
if (e.link) {

components/dashboard/src/components/DropDown.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* See License-AGPL.txt in the project root for license information.
55
*/
66

7-
import { useState } from 'react';
7+
import { useEffect, useState } from 'react';
88
import ContextMenu from './ContextMenu';
99

1010
export interface DropDownProps {
1111
prefix?: string;
1212
contextMenuWidth?: string;
13+
activeEntry?: string,
1314
entries: {
1415
title: string,
1516
onClick: ()=>void
@@ -21,7 +22,10 @@ function Arrow(props: {up: boolean}) {
2122
}
2223

2324
function DropDown(props: DropDownProps) {
24-
const [current, setCurrent] = useState(props.entries[0].title);
25+
const [current, setCurrent] = useState(props.activeEntry || props.entries[0].title);
26+
useEffect(() => {
27+
setCurrent(props.activeEntry || props.entries[0].title);
28+
}, [props.activeEntry, props.entries]);
2529
const enhancedEntries = props.entries.map(e => {
2630
return {
2731
...e,
@@ -32,7 +36,7 @@ function DropDown(props: DropDownProps) {
3236
}
3337
}
3438
})
35-
const font = "text-gray-400 text-sm leading-1 group hover:text-gray-600"
39+
const font = "text-gray-400 text-sm leading-1 group hover:text-gray-600 transition ease-in-out"
3640
return (
3741
<ContextMenu menuEntries={enhancedEntries} width={props.contextMenuWidth}>
3842
<span className={`py-2 cursor-pointer ${font}`}>{props.prefix}{current}<Arrow up={false}/></span>

components/dashboard/src/components/Menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ interface Entry {
1818

1919
function MenuItem(entry: Entry) {
2020
const location = useLocation();
21-
let classes = "flex block text-sm font-medium px-3 px-0 py-1.5 rounded-md";
21+
let classes = "flex block text-sm font-medium px-3 px-0 py-1.5 rounded-md transition ease-in-out";
2222
if (location.pathname.toLowerCase() === entry.link.toLowerCase() ||
2323
entry.matches && entry.matches.test(location.pathname.toLowerCase())) {
2424
classes += " bg-gray-200";
2525
} else {
26-
classes += " text-gray-600 hover:bg-gray-100 ";
26+
classes += " text-gray-600 hover:bg-gray-100 transition ease-in-out";
2727
}
2828
return <li key={entry.title}>
2929
{entry.link.startsWith('https://')

components/dashboard/src/components/SelectableCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ 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-500' : '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 transition ease-in-out ${props.selected ? 'border-green-500' : 'border-gray-300 hover:border-gray-400'} ${props.className || ''}`} onClick={props.onClick}>
1717
<div className="flex items-center">
1818
<p className={`w-full text-base font-semibold ${props.selected ? 'text-green-500' : 'text-gray-300 group-hover:text-gray-400'}`}>{props.title}</p>
1919
<input className={'text-green-500 ' + (props.selected ? 'opacity-100' : 'opacity-0 group-hover:opacity-100')} type="radio" checked={props.selected} />

components/dashboard/src/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@apply text-2xl text-gray-800 leading-9 font-semibold;
2222
}
2323
h4 {
24-
@apply pb-2 text-sm font-medium text-gray-600;
24+
@apply pb-2 text-sm font-semibold text-gray-600;
2525
}
2626
p {
2727
@apply text-sm text-gray-400;
@@ -35,7 +35,7 @@
3535

3636
@layer components {
3737
button {
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;
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 transition ease-in-out;
3939
}
4040
button.secondary {
4141
@apply bg-gray-100 hover:bg-gray-200 text-gray-500 hover:text-gray-600;
@@ -51,7 +51,7 @@
5151
}
5252

5353
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;
54+
@apply block w-56 text-gray-600 rounded-md border border-gray-300 focus:border-gray-400 focus:bg-white focus:ring-0;
5555
}
5656

5757
input[type=text]::placeholder, input[type=password]::placeholder {

components/dashboard/src/settings/Account.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function Account() {
4545

4646
<SettingsPage title='Account' subtitle='Manage account and git configuration.'>
4747
<h3>Profile</h3>
48-
<p className="text-base text-gray-500 pb-4">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="text-gitpod-kumquat-dark bg-gitpod-kumquat-light px-1.5 py-1 rounded-md text-sm font-mono">GIT_AUTHOR_NAME</span> and <span className="text-gitpod-kumquat-dark bg-gitpod-kumquat-light px-1.5 py-1 rounded-md text-sm font-mono">GIT_COMMITTER_EMAIL</span>.</p>
48+
<p className="text-base text-gray-500 pb-4">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="text-gray--300 bg-gray-100 px-1.5 py-1 rounded-md text-sm font-mono font-medium">GIT_AUTHOR_NAME</span> and <span className="text-gray--300 bg-gray-100 px-1.5 py-1 rounded-md text-sm font-mono font-medium">GIT_COMMITTER_EMAIL</span>.</p>
4949
<div className="flex flex-col lg:flex-row">
5050
<div>
5151
<div className="mt-4">

components/dashboard/src/settings/EnvironmentVariables.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ function AddEnvVarModal(p: EnvVarModalProps) {
5050
};
5151

5252
return <Modal visible={true} onClose={p.onClose} onEnter={save}>
53-
<h3 className="pb-2">{isNew ? 'New' : 'Edit'} Variable</h3>
54-
<div className="border-t -mx-6 px-6 py-2 flex flex-col">
55-
{error ? <div className="bg-gitpod-kumquat-light rounded-md p-3 text-red-500 text-sm">
53+
<h3 className="mb-4">{isNew ? 'New' : 'Edit'} Variable</h3>
54+
<div className="border-t border-b -mx-6 px-6 py-4 flex flex-col">
55+
{error ? <div className="bg-gitpod-kumquat-light rounded-md p-3 text-red-500 text-sm mb-2">
5656
{error}
5757
</div> : null}
58-
<div className="mt-4">
58+
<div>
5959
<h4>Name</h4>
6060
<input className="w-full" type="text" value={ev.name} onChange={(v) => { update({name: v.target.value}) }} />
6161
</div>
@@ -68,8 +68,8 @@ function AddEnvVarModal(p: EnvVarModalProps) {
6868
<input className="w-full" type="text" value={ev.repositoryPattern} placeholder="e.g. org/project"
6969
onChange={(v) => { update({repositoryPattern: v.target.value}) }} />
7070
</div>
71-
<div className="mt-3">
72-
<p>You can pass a variable for a specific project or use wildcard characters (<span className="text-gitpod-kumquat-dark bg-gitpod-kumquat-light px-1 py-0.5 rounded-md text-sm font-mono">*/*</span>) to make it available in more projects.</p>
71+
<div className="mt-1">
72+
<p className="text-gray-500">You can pass a variable for a specific project or use wildcard character (<span className="text-gray--300 bg-gray-100 px-1.5 py-1 rounded-md text-sm font-mono font-medium">*/*</span>) to make it available in more projects.</p>
7373
</div>
7474
</div>
7575
<div className="flex justify-end mt-6">
@@ -147,18 +147,27 @@ export default function EnvVars() {
147147
envVar={currentEnvVar}
148148
validate={validate}
149149
onClose={() => setAddEnvVarModalVisible(false)} /> : null}
150+
<div className="flex items-start sm:justify-between mb-2">
151+
<div>
152+
<h3>Environment Variables</h3>
153+
<h2 className="text-gray-500">Variables are used to store information like passwords.</h2>
154+
</div>
155+
{envVars.length !== 0
156+
?
157+
<div className="mt-3 flex mt-0">
158+
<button onClick={add} className="ml-2">New Variable</button>
159+
</div>
160+
: null}
161+
</div>
150162
{envVars.length === 0
151163
? <div className="bg-gray-100 rounded-xl w-full h-96">
152164
<div className="pt-28 flex flex-col items-center w-96 m-auto">
153165
<h3 className="text-center pb-3 text-gray-500">No Environment Variables</h3>
154166
<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}>New Environment Variable</button>
167+
<button onClick={add}>New Variable</button>
156168
</div>
157169
</div>
158170
: <div className="space-y-2">
159-
<div className="flex justify-end mb-2">
160-
<button onClick={add} className="ml-2">New Environment Variable</button>
161-
</div>
162171
<div className="flex flex-col space-y-2">
163172
<div className="px-3 py-3 flex justify-between space-x-2 text-sm text-gray-400 border-t border-b border-gray-200">
164173
<div className="w-5/12">Name</div>
@@ -168,11 +177,11 @@ export default function EnvVars() {
168177
</div>
169178
<div className="flex flex-col">
170179
{envVars.map(ev => {
171-
return <div className="rounded-xl whitespace-nowrap flex space-x-2 py-3 px-3 w-full justify-between hover:bg-gray-100 focus:bg-gitpod-kumquat-light group">
180+
return <div className="rounded-xl whitespace-nowrap flex space-x-2 py-3 px-3 w-full justify-between hover:bg-gray-100 focus:bg-gitpod-kumquat-light transition ease-in-out group">
172181
<div className="w-5/12 m-auto">{ev.name}</div>
173182
<div className="w-5/12 m-auto text-sm text-gray-400">{ev.repositoryPattern}</div>
174183
<div className="w-2/12 flex justify-end">
175-
<div className="flex w-8 self-center hover:bg-gray-200 rounded-md cursor-pointer">
184+
<div className="flex w-8 self-center hover:bg-gray-200 rounded-md cursor-pointer opacity-0 group-hover:opacity-100">
176185
<ContextMenu menuEntries={[
177186
{
178187
title: 'Edit',

components/dashboard/src/settings/Integrations.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ function GitProviders() {
254254
</Modal>
255255
)}
256256

257-
<h3>Git Providers</h3>
258-
<h2>Manage permissions for git providers.</h2>
257+
<h3>Git Providers</h3>
258+
<h2>Manage permissions for git providers.</h2>
259259
<div className="flex flex-col pt-6 space-y-2">
260260
{authProviders && authProviders.map(ap => (
261-
<div key={"ap-" + ap.authProviderId} className="flex-grow flex flex-row hover:bg-gray-100 rounded-xl h-16 w-full">
261+
<div key={"ap-" + ap.authProviderId} className="flex-grow flex flex-row hover:bg-gray-100 rounded-xl h-16 w-full transition ease-in-out group">
262262
<div className="px-4 self-center w-1/12">
263263
<div className={"rounded-full w-3 h-3 text-sm align-middle " + (isConnected(ap.authProviderId) ? "bg-green-500" : "bg-gray-400")}>
264264
&nbsp;
@@ -276,7 +276,7 @@ function GitProviders() {
276276
<span className="my-auto truncate text-gray-500 overflow-ellipsis">{getPermissions(ap.authProviderId)?.join(", ") || "–"}</span>
277277
<span className="text-sm my-auto text-gray-400">Permissions</span>
278278
</div>
279-
<div className="my-auto flex w-1/12 pl-8">
279+
<div className="my-auto flex w-1/12 pl-8 mr-4 opacity-0 group-hover:opacity-100">
280280
<div className="self-center hover:bg-gray-200 rounded-md cursor-pointer w-8">
281281
<ContextMenu menuEntries={gitProviderMenu(ap)}>
282282
<img className="w-8 h-8 p-1" src={ThreeDots} alt="Actions" />
@@ -355,21 +355,31 @@ function GitIntegrations() {
355355
</Modal>
356356
)}
357357

358-
<h3 className="flex-grow self-center">Git Integrations</h3>
359-
<h2>Manage git integrations for GitLab or GitHub self-hosted instances.</h2>
358+
<div className="flex items-start sm:justify-between mb-2">
359+
<div>
360+
<h3>Git Integrations</h3>
361+
<h2 className="text-gray-500">Manage git integrations for GitLab or GitHub self-hosted instances.</h2>
362+
</div>
363+
{providers.length !== 0
364+
?
365+
<div className="mt-3 flex mt-0">
366+
<button onClick={() => setModal({ mode: "new" })} className="ml-2 font-medium">New Integration</button>
367+
</div>
368+
: null}
369+
</div>
360370

361371
{providers && providers.length === 0 && (
362372
<div className="w-full flex h-80 mt-2 rounded-xl bg-gray-100">
363373
<div className="m-auto text-center">
364374
<h3 className="self-center text-gray-500 mb-4">No Git Integrations</h3>
365375
<div className="text-gray-500 mb-6">In addition to the default Git Providers you can authorize<br /> with a self hosted instace of a provider.</div>
366-
<button className="self-center" onClick={() => setModal({ mode: "new" })}>New Git Integration</button>
376+
<button className="self-center" onClick={() => setModal({ mode: "new" })}>New Integration</button>
367377
</div>
368378
</div>
369379
)}
370380
<div className="flex flex-col pt-6 space-y-2">
371381
{providers && providers.map(ap => (
372-
<div key={"ap-" + ap.id} className="flex-grow flex flex-row hover:bg-gray-100 rounded-xl h-16 w-full">
382+
<div key={"ap-" + ap.id} className="flex-grow flex flex-row hover:bg-gray-100 rounded-xl h-16 w-full transition ease-in-out group">
373383

374384
<div className="px-4 self-center w-1/12">
375385
<div className={"rounded-full w-3 h-3 text-sm align-middle " + (ap.status === "verified" ? "bg-green-500" : "bg-gray-400")}>
@@ -382,7 +392,7 @@ function GitIntegrations() {
382392
<div className="p-0 my-auto flex flex-col w-7/12">
383393
<span className="my-auto truncate text-gray-500 overflow-ellipsis">{ap.host}</span>
384394
</div>
385-
<div className="my-auto flex w-1/12 pl-8">
395+
<div className="my-auto flex w-1/12 pl-8 opacity-0 group-hover:opacity-100">
386396
<div className="self-center hover:bg-gray-200 rounded-md cursor-pointer w-8">
387397
<ContextMenu menuEntries={gitProviderMenu(ap)}>
388398
<img className="w-8 h-8 p-1" src={ThreeDots} alt="Actions" />
@@ -392,11 +402,6 @@ function GitIntegrations() {
392402
</div>
393403
))}
394404
</div>
395-
{providers && providers.length > 0 && (
396-
<div className="flex justify-start mt-6">
397-
<button className="h-full" onClick={() => setModal({ mode: "new" })}>New Git Integration</button>
398-
</div>
399-
)}
400405
</div>);
401406
}
402407

@@ -584,7 +589,7 @@ function GitIntegrationModal(props: ({
584589
<div className="w-full relative">
585590
<input name="redirectURL" disabled={true} readOnly={true} type="text" value={redirectURL} className="w-full truncate" />
586591
<div className="cursor-pointer" onClick={() => copyRedirectUrl()}>
587-
<img src={copy} title="Copy the Redirect URL to clippboard." className="absolute top-1/3 right-3" />
592+
<img src={copy} title="Copy the Redirect URL to clippboard" className="absolute top-1/3 right-3" />
588593
</div>
589594
</div>
590595
<span className="text-gray-500 text-sm">{getRedirectUrlDescription(type, host)}</span>

components/dashboard/src/settings/SettingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function SettingsPage(p: Props) {
3737
})}
3838
</ul>
3939
</div>
40-
<div className='ml-32 w-full pt-1'>
40+
<div className='ml-32 w-full pt-1 mb-40'>
4141
{p.children}
4242
</div>
4343
</div>

components/dashboard/src/tailwind.output.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ h3 {
788788
}
789789

790790
h4 {
791-
font-weight: 500;
791+
font-weight: 600;
792792
font-size: 0.875rem;
793793
line-height: 1.25rem;
794794
padding-bottom: 0.5rem;
@@ -897,6 +897,10 @@ button:focus {
897897
button {
898898
--tw-text-opacity: 1;
899899
color: rgba(245, 245, 244, var(--tw-text-opacity));
900+
transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
901+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
902+
transition-duration: 150ms;
903+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
900904
}
901905

902906
button.secondary {
@@ -979,10 +983,6 @@ input[type=text], input[type=password], select {
979983
border-radius: 0.375rem;
980984
border-width: 1px;
981985
display: block;
982-
font-size: 0.75rem;
983-
line-height: 1rem;
984-
font-size: 0.875rem;
985-
line-height: 1.25rem;
986986
}
987987

988988
input[type=text]:focus, input[type=password]:focus, select:focus {

0 commit comments

Comments
 (0)