Skip to content

Commit f3d77e3

Browse files
committed
fix: update hard-coded or inconsistent colors (#191)
* fix: update inconsistent chat colors and adjust styles * fix: update sidebar submenu svg color * fix: update auth-layout incorrect background * fix: update sidebar and search hover state color
1 parent 3440e34 commit f3d77e3

6 files changed

Lines changed: 30 additions & 26 deletions

File tree

src/components/search.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function Search({ className = '', placeholder = 'Search' }: Props) {
1515
<Button
1616
variant='outline'
1717
className={cn(
18-
'bg-muted/25 text-muted-foreground hover:bg-muted/50 relative h-8 w-full flex-1 justify-start rounded-md text-sm font-normal shadow-none sm:pe-12 md:w-40 md:flex-none lg:w-56 xl:w-64',
18+
'bg-muted/25 group text-muted-foreground hover:bg-accent relative h-8 w-full flex-1 justify-start rounded-md text-sm font-normal shadow-none sm:pe-12 md:w-40 md:flex-none lg:w-56 xl:w-64',
1919
className
2020
)}
2121
onClick={() => setOpen(true)}
@@ -26,7 +26,7 @@ export function Search({ className = '', placeholder = 'Search' }: Props) {
2626
size={16}
2727
/>
2828
<span className='ms-3'>{placeholder}</span>
29-
<kbd className='bg-muted pointer-events-none absolute end-[0.3rem] top-[0.3rem] hidden h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none sm:flex'>
29+
<kbd className='bg-muted group-hover:bg-accent pointer-events-none absolute end-[0.3rem] top-[0.3rem] hidden h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none sm:flex'>
3030
<span className='text-xs'></span>K
3131
</kbd>
3232
</Button>

src/components/ui/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ function SidebarMenuSubButton({
688688
data-size={size}
689689
data-active={isActive}
690690
className={cn(
691-
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
691+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-inherit',
692692
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
693693
size === 'sm' && 'text-xs',
694694
size === 'md' && 'text-sm',

src/features/auth/auth-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface Props {
44

55
export default function AuthLayout({ children }: Props) {
66
return (
7-
<div className='bg-primary-foreground container grid h-svh max-w-none items-center justify-center'>
7+
<div className='container grid h-svh max-w-none items-center justify-center'>
88
<div className='mx-auto flex w-full flex-col justify-center space-y-2 py-8 sm:w-[480px] sm:p-8'>
99
<div className='mb-4 flex items-center justify-center'>
1010
<svg

src/features/chats/components/new-chat.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export function NewChat({ users, onOpenChange, open }: Props) {
5454
<DialogTitle>New message</DialogTitle>
5555
</DialogHeader>
5656
<div className='flex flex-col gap-4'>
57-
<div className='flex flex-wrap items-center gap-2'>
58-
<span className='text-muted-foreground text-sm'>To:</span>
57+
<div className='flex flex-wrap items-baseline-last gap-2'>
58+
<span className='text-muted-foreground min-h-6 text-sm'>To:</span>
5959
{selectedUsers.map((user) => (
6060
<Badge key={user.id} variant='default'>
6161
{user.fullName}
@@ -85,7 +85,7 @@ export function NewChat({ users, onOpenChange, open }: Props) {
8585
<CommandItem
8686
key={user.id}
8787
onSelect={() => handleSelectUser(user)}
88-
className='flex items-center justify-between gap-2'
88+
className='hover:bg-accent hover:text-accent-foreground flex items-center justify-between gap-2'
8989
>
9090
<div className='flex items-center gap-2'>
9191
<img
@@ -97,8 +97,8 @@ export function NewChat({ users, onOpenChange, open }: Props) {
9797
<span className='text-sm font-medium'>
9898
{user.fullName}
9999
</span>
100-
<span className='text-muted-foreground text-xs'>
101-
{user.username} aa
100+
<span className='text-accent-foreground/70 text-xs'>
101+
{user.username}
102102
</span>
103103
</div>
104104
</div>

src/features/chats/index.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ export default function Chats() {
9494
</Button>
9595
</div>
9696

97-
<label className='border-input focus-within:ring-ring flex h-12 w-full items-center space-x-0 rounded-md border ps-2 focus-within:ring-1 focus-within:outline-hidden'>
97+
<label
98+
className={cn(
99+
'focus-within:ring-ring focus-within:ring-1 focus-within:outline-hidden',
100+
'border-border flex h-10 w-full items-center space-x-0 rounded-md border ps-2'
101+
)}
102+
>
98103
<SearchIcon size={15} className='me-2 stroke-slate-500' />
99104
<span className='sr-only'>Search</span>
100105
<input
@@ -120,7 +125,8 @@ export default function Chats() {
120125
<button
121126
type='button'
122127
className={cn(
123-
`hover:bg-secondary/75 -mx-1 flex w-full rounded-md px-2 py-2 text-start text-sm`,
128+
'group hover:bg-accent hover:text-accent-foreground',
129+
`flex w-full rounded-md px-2 py-2 text-start text-sm`,
124130
selectedUser?.id === id && 'sm:bg-muted'
125131
)}
126132
onClick={() => {
@@ -137,7 +143,7 @@ export default function Chats() {
137143
<span className='col-start-2 row-span-2 font-medium'>
138144
{fullName}
139145
</span>
140-
<span className='text-muted-foreground col-start-2 row-span-2 row-start-2 line-clamp-2 text-ellipsis'>
146+
<span className='text-muted-foreground group-hover:text-accent-foreground/90 col-start-2 row-span-2 row-start-2 line-clamp-2 text-ellipsis'>
141147
{lastMsg}
142148
</span>
143149
</div>
@@ -154,12 +160,12 @@ export default function Chats() {
154160
{selectedUser ? (
155161
<div
156162
className={cn(
157-
'bg-primary-foreground absolute inset-0 start-full z-50 hidden w-full flex-1 flex-col rounded-md border shadow-xs transition-all duration-200 sm:static sm:z-auto sm:flex',
163+
'bg-background absolute inset-0 start-full z-50 hidden w-full flex-1 flex-col rounded-md border shadow-xs sm:static sm:z-auto sm:flex',
158164
mobileSelectedUser && 'start-0 flex'
159165
)}
160166
>
161167
{/* Top Part */}
162-
<div className='bg-secondary mb-1 flex flex-none justify-between rounded-t-md p-4 shadow-lg'>
168+
<div className='bg-card mb-1 flex flex-none justify-between rounded-t-md p-4 shadow-lg'>
163169
{/* Left */}
164170
<div className='flex gap-3'>
165171
<Button
@@ -229,15 +235,16 @@ export default function Chats() {
229235
className={cn(
230236
'chat-box max-w-72 px-3 py-2 break-words shadow-lg',
231237
msg.sender === 'You'
232-
? 'bg-primary/85 text-primary-foreground/75 self-end rounded-[16px_16px_0_16px]'
233-
: 'bg-secondary self-start rounded-[16px_16px_16px_0]'
238+
? 'bg-primary/90 text-primary-foreground/75 self-end rounded-[16px_16px_0_16px]'
239+
: 'bg-muted self-start rounded-[16px_16px_16px_0]'
234240
)}
235241
>
236242
{msg.message}{' '}
237243
<span
238244
className={cn(
239-
'text-muted-foreground mt-1 block text-xs font-light italic',
240-
msg.sender === 'You' && 'text-end'
245+
'text-foreground/75 mt-1 block text-xs font-light italic',
246+
msg.sender === 'You' &&
247+
'text-primary-foreground/85 text-end'
241248
)}
242249
>
243250
{format(msg.timestamp, 'h:mm a')}
@@ -251,7 +258,7 @@ export default function Chats() {
251258
</div>
252259
</div>
253260
<form className='flex w-full flex-none gap-2'>
254-
<div className='border-input focus-within:ring-ring flex flex-1 items-center gap-2 rounded-md border px-2 py-1 focus-within:ring-1 focus-within:outline-hidden lg:gap-4'>
261+
<div className='border-input bg-card focus-within:ring-ring flex flex-1 items-center gap-2 rounded-md border px-2 py-1 focus-within:ring-1 focus-within:outline-hidden lg:gap-4'>
255262
<div className='space-x-1'>
256263
<Button
257264
size='icon'
@@ -309,7 +316,7 @@ export default function Chats() {
309316
) : (
310317
<div
311318
className={cn(
312-
'bg-primary-foreground absolute inset-0 start-full z-50 hidden w-full flex-1 flex-col justify-center rounded-md border shadow-xs transition-all duration-200 sm:static sm:z-auto sm:flex'
319+
'bg-card absolute inset-0 start-full z-50 hidden w-full flex-1 flex-col justify-center rounded-md border shadow-xs sm:static sm:z-auto sm:flex'
313320
)}
314321
>
315322
<div className='flex flex-col items-center space-y-6'>
@@ -322,10 +329,7 @@ export default function Chats() {
322329
Send a message to start a chat.
323330
</p>
324331
</div>
325-
<Button
326-
className='bg-blue-500 px-6 text-white hover:bg-blue-600'
327-
onClick={() => setCreateConversationDialog(true)}
328-
>
332+
<Button onClick={() => setCreateConversationDialog(true)}>
329333
Send message
330334
</Button>
331335
</div>

src/features/settings/components/sidebar-nav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export default function SidebarNav({
7373
className={cn(
7474
buttonVariants({ variant: 'ghost' }),
7575
pathname === item.href
76-
? 'bg-muted hover:bg-muted'
77-
: 'hover:bg-transparent hover:underline',
76+
? 'bg-muted hover:bg-accent'
77+
: 'hover:bg-accent hover:underline',
7878
'justify-start'
7979
)}
8080
>

0 commit comments

Comments
 (0)