Skip to content

Commit c665198

Browse files
committed
simplify button styles and update all the code everywhere all the time
1 parent a49806b commit c665198

29 files changed

+65
-166
lines changed

app/components/Sidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const modKey = /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'cmd' : 'ctrl'
2828
const JumpToButton = () => (
2929
<Button
3030
variant="ghost"
31-
color="secondary"
3231
size="sm"
3332
// TODO: click should open jump to menu
3433
onClick={() => alert('click not implemented, press cmd+k')}

app/components/TopBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ export function TopBar({ children }: { children: React.ReactNode }) {
4747
{otherPickers}
4848
</div>
4949
<div>
50-
<Button variant="default" color="secondary" size="sm" title="Info">
50+
<Button variant="secondary" size="icon" title="Info">
5151
<Info16Icon className="text-quaternary" />
5252
</Button>
53-
<Button color="secondary" size="sm" className="ml-2" title="Notifications">
53+
<Button variant="secondary" size="icon" className="ml-2" title="Notifications">
5454
<Notifications16Icon className="text-quaternary" />
5555
</Button>
5656
<Menu>
5757
<MenuButton
5858
as={Button}
59-
color="secondary"
6059
size="sm"
60+
variant="secondary"
6161
aria-label="User menu"
6262
className="ml-2"
6363
innerClassName="space-x-2"

app/components/form/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const Form = {
6464
Submit: (props: ButtonProps) => <Button type="submit" size="sm" {...props} />,
6565

6666
Cancel: (props: ButtonProps) => (
67-
<Button variant="ghost" color="secondary" size="sm" {...props}>
67+
<Button variant="ghost" size="sm" {...props}>
6868
Cancel
6969
</Button>
7070
),

app/components/form/SideModalForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function SideModalForm<TFieldValues extends FieldValues>({
8484
<span>{submitError.error.message}</span>
8585
</div>
8686
)}
87-
<Button variant="ghost" color="secondary" size="sm" onClick={onDismiss}>
87+
<Button variant="ghost" size="sm" onClick={onDismiss}>
8888
Cancel
8989
</Button>
9090
<Button type="submit" size="sm" disabled={submitDisabled || !canSubmit} form={id}>

app/components/form/fields/DisksTableField.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,10 @@ export function DisksTableField({ control }: { control: Control<InstanceCreateIn
6161
)}
6262

6363
<div className="space-x-3">
64-
<Button variant="default" size="sm" onClick={() => setShowDiskCreate(true)}>
64+
<Button size="sm" onClick={() => setShowDiskCreate(true)}>
6565
Create new disk
6666
</Button>
67-
<Button
68-
variant="ghost"
69-
color="secondary"
70-
size="sm"
71-
onClick={() => setShowDiskAttach(true)}
72-
>
67+
<Button variant="ghost" size="sm" onClick={() => setShowDiskAttach(true)}>
7368
Attach existing disk
7469
</Button>
7570
</div>

app/components/form/fields/NetworkInterfaceField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function NetworkInterfaceField({
107107
/>
108108
)}
109109
<div className="space-x-3">
110-
<Button variant="default" size="sm" onClick={() => setShowForm(true)}>
110+
<Button size="sm" onClick={() => setShowForm(true)}>
111111
Add network interface
112112
</Button>
113113
</div>

app/forms/firewall-rules-create.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,7 @@ export const CommonFields = ({ error, control }: CommonFieldsProps) => {
179179
<TextField name="value" label="Target name" required control={targetForm.control} />
180180

181181
<div className="flex justify-end">
182-
<Button
183-
variant="ghost"
184-
color="secondary"
185-
className="mr-2.5"
186-
onClick={() => targetForm.reset()}
187-
>
182+
<Button variant="ghost" className="mr-2.5" onClick={() => targetForm.reset()}>
188183
Clear
189184
</Button>
190185
<Button
@@ -265,12 +260,7 @@ export const CommonFields = ({ error, control }: CommonFieldsProps) => {
265260
/>
266261

267262
<div className="flex justify-end">
268-
<Button
269-
variant="ghost"
270-
color="secondary"
271-
className="mr-2.5"
272-
onClick={() => hostForm.reset()}
273-
>
263+
<Button variant="ghost" className="mr-2.5" onClick={() => hostForm.reset()}>
274264
Clear
275265
</Button>
276266
<Button
@@ -329,7 +319,7 @@ export const CommonFields = ({ error, control }: CommonFieldsProps) => {
329319
control={portRangeForm.control}
330320
/>
331321
<div className="flex justify-end">
332-
<Button variant="ghost" color="secondary" className="mr-2.5">
322+
<Button variant="ghost" className="mr-2.5">
333323
Clear
334324
</Button>
335325
<Button

app/pages/LoginPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export default function LoginPage() {
6262
</Button>
6363
<Button
6464
type="submit"
65-
variant="default"
6665
className="w-full"
6766
disabled={loginPost.isLoading}
6867
onClick={() => loginPost.mutate({ body: { username: 'unprivileged' } })}
@@ -71,7 +70,7 @@ export default function LoginPage() {
7170
</Button>
7271
<Button
7372
type="submit"
74-
variant="ghost"
73+
variant="danger"
7574
className="w-full"
7675
disabled={loginPost.isLoading}
7776
onClick={() => loginPost.mutate({ body: { username: 'other' } })}
@@ -80,7 +79,7 @@ export default function LoginPage() {
8079
</Button>
8180
<Button
8281
type="submit"
83-
variant="link"
82+
variant="ghost"
8483
className="w-full"
8584
disabled={loginPost.isLoading}
8685
onClick={() => logout.mutate({})}

app/pages/OrgAccessPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function OrgAccessPage() {
163163
</PageHeader>
164164

165165
<TableActions>
166-
<Button size="sm" variant="default" onClick={() => setAddModalOpen(true)}>
166+
<Button size="sm" onClick={() => setAddModalOpen(true)}>
167167
Add user to organization
168168
</Button>
169169
</TableActions>

app/pages/OrgsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function OrgsPage() {
8787
<PageTitle icon={<Folder24Icon />}>Organizations</PageTitle>
8888
</PageHeader>
8989
<TableActions>
90-
<Link to={pb.orgNew()} className={buttonStyle({ variant: 'default', size: 'sm' })}>
90+
<Link to={pb.orgNew()} className={buttonStyle({ size: 'sm' })}>
9191
New Organization
9292
</Link>
9393
</TableActions>

0 commit comments

Comments
 (0)