Skip to content

Commit 71bc52b

Browse files
committed
Fix dark mode bugs
1 parent a8ff0a1 commit 71bc52b

File tree

15 files changed

+24
-30
lines changed

15 files changed

+24
-30
lines changed

apps/react-vite/src/app/routes/app/profile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type EntryProps = {
99
const Entry = ({ label, value }: EntryProps) => (
1010
<div className="py-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5">
1111
<dt className="text-sm font-medium text-gray-500">{label}</dt>
12-
<dd className="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">
12+
<dd className="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0 dark:text-gray-100">
1313
{value}
1414
</dd>
1515
</div>

apps/react-vite/src/app/routes/landing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const LandingRoute = () => {
2222
<Head description="Welcome to bulletproof react" />
2323
<div className="flex h-screen items-center">
2424
<div className="mx-auto max-w-7xl px-4 py-12 text-center sm:px-6 lg:px-8 lg:py-16">
25-
<h2 className="text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl">
25+
<h2 className="text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl dark:text-gray-100">
2626
<span className="block">Bulletproof React</span>
2727
</h2>
2828
<img src={logo} alt="react" />

apps/react-vite/src/components/layouts/auth-layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ export const AuthLayout = ({ children, title }: LayoutProps) => {
2828
return (
2929
<>
3030
<Head title={title} />
31-
<div className="flex min-h-screen flex-col justify-center bg-gray-50 py-12 sm:px-6 lg:px-8">
31+
<div className="flex min-h-screen flex-col justify-center bg-gray-50 py-12 sm:px-6 lg:px-8 dark:bg-gray-900">
3232
<div className="sm:mx-auto sm:w-full sm:max-w-md">
3333
<div className="flex justify-center">
3434
<Link className="flex items-center text-white" to="/">
3535
<img className="h-24 w-auto" src={logo} alt="Workflow" />
3636
</Link>
3737
</div>
3838

39-
<h2 className="mt-3 text-center text-3xl font-extrabold text-gray-900">
39+
<h2 className="mt-3 text-center text-3xl font-extrabold text-gray-900 dark:text-slate-100">
4040
{title}
4141
</h2>
4242
</div>
4343

4444
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
45-
<div className="px-4 py-8 shadow sm:rounded-lg sm:px-10">
45+
<div className="px-4 py-8 shadow sm:rounded-lg sm:px-10 dark:shadow-slate-600">
4646
{children}
4747
</div>
4848
</div>

apps/react-vite/src/components/layouts/dashboard-layout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,17 @@ export function DashboardLayout({ children }: { children: React.ReactNode }) {
179179
<DropdownMenuContent align="end">
180180
<DropdownMenuItem
181181
onClick={() => navigate('./profile')}
182-
className={cn('block px-4 py-2 text-sm text-gray-700')}
182+
className={cn(
183+
'block px-4 py-2 text-sm text-gray-700 dark:text-slate-100',
184+
)}
183185
>
184186
Your Profile
185187
</DropdownMenuItem>
186188
<DropdownMenuSeparator />
187189
<DropdownMenuItem
188-
className={cn('block px-4 py-2 text-sm text-gray-700 w-full')}
190+
className={cn(
191+
'block px-4 py-2 text-sm text-gray-700 w-full dark:text-slate-100',
192+
)}
189193
onClick={() => logout.mutate({})}
190194
>
191195
Sign Out

apps/react-vite/src/components/ui/button/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const buttonVariants = cva(
1212
variants: {
1313
variant: {
1414
default:
15-
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
15+
'bg-primary text-primary-foreground shadow hover:bg-primary/90 dark:bg-slate-700 dark:text-slate-100 hover:dark:bg-slate-600',
1616
destructive:
1717
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
1818
outline:

apps/react-vite/src/components/ui/form/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const Select = (props: SelectFieldProps) => {
2424
<FieldWrapper label={label} error={error}>
2525
<select
2626
className={cn(
27-
'mt-1 block w-full rounded-md border-gray-600 py-2 pl-3 pr-10 text-base focus:border-blue-500 focus:outline-none focus:ring-blue-500 sm:text-sm',
27+
'mt-1 block w-full bg-transparent shadow border border-input rounded-md py-2 pl-3 pr-10 text-base focus:border-blue-500 focus:outline-none focus:ring-blue-500 sm:text-sm',
2828
className,
2929
)}
3030
defaultValue={defaultValue}

apps/react-vite/src/components/ui/link/link.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { cn } from '@/utils/cn';
55
export const Link = ({ className, children, ...props }: LinkProps) => {
66
return (
77
<RouterLink
8-
className={cn('text-slate-600 hover:text-slate-900', className)}
8+
className={cn(
9+
'text-slate-600 hover:text-slate-900 dark:text-white dark:hover:text-slate-300',
10+
className,
11+
)}
912
{...props}
1013
>
1114
{children}

apps/react-vite/src/components/ui/md-preview/md-preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type MDPreviewProps = {
1010
export const MDPreview = ({ value = '' }: MDPreviewProps) => {
1111
return (
1212
<div
13-
className="prose prose-slate w-full p-2"
13+
className="prose prose-slate w-full p-2 dark:text-slate-100"
1414
dangerouslySetInnerHTML={{
1515
__html: DOMPurify.sanitize(parse(value) as string),
1616
}}

apps/react-vite/src/components/ui/table/pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const TablePagination = ({
160160
</PaginationLink>
161161
</PaginationItem>
162162
)}
163-
<PaginationItem className="rounded-sm bg-gray-200">
163+
<PaginationItem className="rounded-sm bg-gray-200 dark:bg-slate-800 dark:text-white">
164164
<PaginationLink href={createHref(currentPage)}>
165165
{currentPage}
166166
</PaginationLink>

apps/react-vite/src/components/ui/table/table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const Table = <Entry extends BaseEntity>({
142142
}: TableProps<Entry>) => {
143143
if (!data?.length) {
144144
return (
145-
<div className="flex h-80 flex-col items-center justify-center bg-white text-gray-500">
145+
<div className="flex h-80 flex-col items-center justify-center bg-white text-gray-500 dark:bg-slate-800">
146146
<ArchiveX className="size-16" />
147147
<h4>No Entries Found</h4>
148148
</div>

0 commit comments

Comments
 (0)