Skip to content

Commit

Permalink
Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 2, 2023
1 parent 6e3edd6 commit 808477b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 35 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config = {
},
],
},
transpilePackages: ["@midday/ui", "@midday/jobs"],
transpilePackages: ["@midday/ui", "@midday/jobs", "@midday/tailwind"],
eslint: {
ignoreDuringBuilds: true,
},
Expand Down
10 changes: 2 additions & 8 deletions apps/dashboard/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ThemeProvider } from "@/components/theme-provider";
import "@/styles/globals.css";
import "@midday/ui/globals.css";
import { Toaster } from "@midday/ui/toaster";
import { cn } from "@midday/ui/utils";
import type { Metadata } from "next";
import { Instrument_Sans } from "next/font/google";
import { type ReactElement, Suspense } from "react";
Expand All @@ -25,13 +24,8 @@ export const metadata: Metadata = {
export default function Layout({ children }: { children: ReactElement }) {
return (
<html lang="en" suppressHydrationWarning>
<body className={cn(fontSans.variable, "bg-background")}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<body className={fontSans.variable}>
<ThemeProvider attribute="class">
{children}
<Toaster />
</ThemeProvider>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
transpilePackages: ["@midday/ui", "@midday/tailwind", "@midday/location"],
transpilePackages: ["@midday/ui", "@midday/tailwind"],
experimental: {
// ppr: true,
},
Expand Down
5 changes: 4 additions & 1 deletion apps/website/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Provider } from "./provider";
export default function Layout({
params: { locale },
children,
}: { params: { locale: string }; children: ReactNode }) {
}: {
params: { locale: string };
children: ReactNode;
}) {
return <Provider locale={locale}>{children}</Provider>;
}
14 changes: 1 addition & 13 deletions apps/website/src/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import { StartPage } from "@/components/startpage";
import { getStaticParams } from "@/locales/server";
import { setStaticParamsLocale } from "next-international/server";

export function generateStaticParams() {
return getStaticParams();
}

export default function Page({
params: { locale },
}: {
params: { locale: string };
}) {
setStaticParamsLocale(locale);

export default function Page() {
return <StartPage />;
}
13 changes: 2 additions & 11 deletions apps/website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ export const metadata: Metadata = {
export default function Layout({ children }: { children: ReactElement }) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={cn(fontSans.variable, "bg-background whitespace-pre-line")}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
<body className={cn(fontSans.variable, "whitespace-pre-line")}>
<ThemeProvider attribute="class">{children}</ThemeProvider>
<Analytics />
</body>
</html>
Expand Down
1 change: 1 addition & 0 deletions apps/website/src/components/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { ThemeProvider as NextThemesProvider } from "next-themes";
import * as React from "react";

type ThemeProviderProps = Parameters<typeof NextThemesProvider>[0];

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
Expand Down

0 comments on commit 808477b

Please sign in to comment.