Skip to content

Commit e67c76a

Browse files
cleanup of ui elements (#1999)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
1 parent a164e86 commit e67c76a

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

apps/mail/components/labels/label-dialog.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,21 @@ export function LabelDialog({
132132
<div className="space-y-2">
133133
<Label>{m['common.labels.color']()}</Label>
134134
<div className="w-full">
135-
<div className="flex flex-wrap gap-2 mt-2">
135+
<div className="relative mt-2 flex flex-wrap gap-2">
136136
{LABEL_COLORS.map((color) => (
137137
<button
138-
key={color.backgroundColor}
139138
type="button"
139+
key={color.backgroundColor}
140140
className={`h-10 w-10 rounded-[4px] border-[0.5px] border-white/10 ${
141141
formColor?.backgroundColor.toString() === color.backgroundColor &&
142142
formColor.textColor.toString() === color.textColor
143143
? 'scale-110 ring-2 ring-blue-500 ring-offset-1'
144144
: 'hover:scale-105'
145145
}`}
146-
style={{ backgroundColor: color.backgroundColor }}
146+
style={{
147+
backgroundColor: color.backgroundColor,
148+
filter: 'brightness(1.4)',
149+
}}
147150
onClick={() =>
148151
form.setValue('color', {
149152
backgroundColor: color.backgroundColor,

apps/mail/components/ui/button.tsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { cn } from '@/lib/utils';
66

77
const buttonVariants = cva(
88
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 aria-busy:cursor-progress cursor-pointer',
9+
{
910
variants: {
1011
variant: {
1112
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
@@ -44,11 +45,23 @@ export interface ButtonProps
4445
}
4546

4647
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
47-
({ className, variant, size, asChild = false, isLoading = false, loadingText, children, ...props }, ref) => {
48+
(
49+
{
50+
className,
51+
variant,
52+
size,
53+
asChild = false,
54+
isLoading = false,
55+
loadingText,
56+
children,
57+
...props
58+
},
59+
ref,
60+
) => {
4861
const Comp = asChild ? Slot.Slot : 'button';
4962
return (
50-
<Comp
51-
className={cn(buttonVariants({ variant, size, className }))}
63+
<Comp
64+
className={cn(buttonVariants({ variant, size }), className)}
5265
disabled={isLoading || props.disabled}
5366
aria-busy={isLoading}
5467
aria-disabled={props.disabled}
@@ -57,10 +70,12 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
5770
>
5871
{isLoading ? (
5972
<>
60-
<span className="inline-block animate-spin mr-2"></span>
73+
<span className="mr-2 inline-block animate-spin"></span>
6174
{loadingText || children}
6275
</>
63-
) : children}
76+
) : (
77+
children
78+
)}
6479
</Comp>
6580
);
6681
},

apps/mail/components/ui/nav-user.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export function NavUser() {
391391
}`}
392392
>
393393
<div className="relative">
394-
<Avatar className="size-6 rounded-[5px]">
394+
<Avatar className="size-7 rounded-[5px]">
395395
<AvatarImage
396396
className="rounded-[5px]"
397397
src={activeAccount.picture || undefined}
@@ -509,15 +509,15 @@ export function NavUser() {
509509

510510
{isPro ? (
511511
<AddConnectionDialog>
512-
<button className="flex h-6 w-6 cursor-pointer items-center justify-center rounded-[5px] border border-dashed dark:bg-[#262626] dark:text-[#929292]">
512+
<Button className="hover:bg-offsetLight/80 dark:hover:bg-offsetDark/80 flex h-7 w-7 cursor-pointer items-center justify-center rounded-[5px] border border-dashed bg-transparent px-0 text-black dark:bg-[#262626] dark:text-[#929292]">
513513
<Plus className="size-4" />
514-
</button>
514+
</Button>
515515
</AddConnectionDialog>
516516
) : (
517517
<>
518518
<Button
519519
onClick={() => setPricingDialog('true')}
520-
className="hover:bg-offsetLight/80 flex h-7 w-7 cursor-pointer items-center justify-center rounded-[5px] border border-dashed bg-transparent px-0 text-black dark:bg-[#262626] dark:text-[#929292]"
520+
className="hover:bg-offsetLight/80 dark:hover:bg-offsetDark/80 flex h-7 w-7 cursor-pointer items-center justify-center rounded-[5px] border border-dashed bg-transparent px-0 text-black dark:bg-[#262626] dark:text-[#929292]"
521521
>
522522
<Plus className="size-4" />
523523
</Button>

0 commit comments

Comments
 (0)