Skip to content

Commit

Permalink
Fix dark mode in dashboard (#1887)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsoffer authored Sep 16, 2023
1 parent cec182c commit c7b8b79
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
2 changes: 1 addition & 1 deletion packages/www/lib/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Global } from "@emotion/core";
import React, { memo } from "react";
import { useThemeUI, ThemeProvider as TP, Styled } from "theme-ui";

export const DEFAULT_THEME = "light";
export const DEFAULT_THEME = "system";

export const theme = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
Expand Down
62 changes: 28 additions & 34 deletions packages/www/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { ApiProvider } from "hooks/use-api";
import { AnalyzerProvider } from "hooks/use-analyzer";
import { QueryClient, QueryClientProvider } from "react-query";
import { MetaMaskProvider } from "metamask-react";
import "../css/recaptcha.css";
import React from "react";
import { Theme } from "@radix-ui/themes";
import {
globalCss,
getThemes,
Expand All @@ -25,10 +25,6 @@ import "../css/hubspot.scss";
import { isStaging } from "lib/utils";
import { getEndpoint } from "../hooks/use-api";

import "../css/recaptcha.css";
import "../css/markdown.css";
import "@radix-ui/themes/styles.css";

const queryClient = new QueryClient();

const globalStyles = globalCss({
Expand Down Expand Up @@ -104,35 +100,33 @@ const App = ({ Component, pageProps }) => {
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Head>
<DesignSystemProvider>
<Theme appearance="light">
<ThemeProvider
forcedTheme={DEFAULT_THEME}
disableTransitionOnChange
attribute="class"
defaultTheme={DEFAULT_THEME}
value={{
...themeMap,
dark: "dark-theme-green",
light: "light-theme-green",
}}>
<SnackbarProvider>
<QueryClientProvider client={queryClient}>
<MetaMaskProvider>
<ApiProvider>
<AnalyzerProvider>
<LivepeerConfig
theme={livepeerTheme}
client={livepeerClient}>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</LivepeerConfig>
</AnalyzerProvider>
</ApiProvider>
</MetaMaskProvider>
</QueryClientProvider>
</SnackbarProvider>
</ThemeProvider>
</Theme>
<ThemeProvider
forcedTheme={Component.theme || undefined}
disableTransitionOnChange
attribute="class"
defaultTheme={DEFAULT_THEME}
value={{
...themeMap,
dark: "dark-theme-green",
light: "light-theme-green",
}}>
<SnackbarProvider>
<QueryClientProvider client={queryClient}>
<MetaMaskProvider>
<ApiProvider>
<AnalyzerProvider>
<LivepeerConfig
theme={livepeerTheme}
client={livepeerClient}>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</LivepeerConfig>
</AnalyzerProvider>
</ApiProvider>
</MetaMaskProvider>
</QueryClientProvider>
</SnackbarProvider>
</ThemeProvider>
</DesignSystemProvider>
</>
);
Expand Down
1 change: 1 addition & 0 deletions packages/www/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ const HomePage = () => {
);
};

HomePage.theme = "light-theme-green";
export default HomePage;
1 change: 1 addition & 0 deletions packages/www/pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ export async function getStaticProps() {
};
}

PricingPage.theme = "light-theme-green";
export default PricingPage;
1 change: 1 addition & 0 deletions packages/www/pages/use-cases/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ export async function getStaticProps({ params }) {
};
}

UseCase.theme = "light-theme-green";
export default UseCase;

1 comment on commit c7b8b79

@vercel
Copy link

@vercel vercel bot commented on c7b8b79 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.