Skip to content

Commit

Permalink
Remove theme switch and eth price
Browse files Browse the repository at this point in the history
  • Loading branch information
damianmarti committed Nov 6, 2024
1 parent 6036cb3 commit 71edf47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 64 deletions.
5 changes: 1 addition & 4 deletions packages/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "@rainbow-me/rainbowkit/styles.css";
import { ScaffoldEthAppWithProviders } from "~~/components/ScaffoldEthAppWithProviders";
import { ThemeProvider } from "~~/components/ThemeProvider";
import "~~/styles/globals.css";
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";

Expand All @@ -13,9 +12,7 @@ const ScaffoldEthApp = ({ children }: { children: React.ReactNode }) => {
return (
<html suppressHydrationWarning>
<body>
<ThemeProvider enableSystem>
<ScaffoldEthAppWithProviders>{children}</ScaffoldEthAppWithProviders>
</ThemeProvider>
<ScaffoldEthAppWithProviders>{children}</ScaffoldEthAppWithProviders>
<div id="zpass-app-connector">{/* This element will be used by the app connector */}</div>
</body>
</html>
Expand Down
14 changes: 1 addition & 13 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import React from "react";
import Link from "next/link";
import { hardhat } from "viem/chains";
import { CurrencyDollarIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { HeartIcon } from "@heroicons/react/24/outline";
import { SwitchTheme } from "~~/components/SwitchTheme";
import { BuidlGuidlLogo } from "~~/components/assets/BuidlGuidlLogo";
import { Faucet } from "~~/components/scaffold-eth";
import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork";
import { useGlobalState } from "~~/services/store/store";

/**
* Site footer
*/
export const Footer = () => {
const nativeCurrencyPrice = useGlobalState(state => state.nativeCurrency.price);
const { targetNetwork } = useTargetNetwork();
const isLocalNetwork = targetNetwork.id === hardhat.id;

Expand All @@ -22,14 +19,6 @@ export const Footer = () => {
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto">
{nativeCurrencyPrice > 0 && (
<div>
<div className="btn btn-primary btn-sm font-normal gap-1 cursor-auto">
<CurrencyDollarIcon className="h-4 w-4" />
<span>{nativeCurrencyPrice.toFixed(2)}</span>
</div>
</div>
)}
{isLocalNetwork && (
<>
<Faucet />
Expand All @@ -40,7 +29,6 @@ export const Footer = () => {
</>
)}
</div>
<SwitchTheme className={`pointer-events-auto ${isLocalNetwork ? "self-end md:self-auto" : ""}`} />
</div>
</div>
<div className="w-full">
Expand Down
14 changes: 2 additions & 12 deletions packages/nextjs/components/ScaffoldEthAppWithProviders.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use client";

import { useEffect, useState } from "react";
import { RainbowKitProvider, darkTheme, lightTheme } from "@rainbow-me/rainbowkit";
import { RainbowKitProvider, lightTheme } from "@rainbow-me/rainbowkit";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { useTheme } from "next-themes";
import { Toaster } from "react-hot-toast";
import { WagmiProvider } from "wagmi";
import { Footer } from "~~/components/Footer";
Expand Down Expand Up @@ -37,21 +35,13 @@ export const queryClient = new QueryClient({
});

export const ScaffoldEthAppWithProviders = ({ children }: { children: React.ReactNode }) => {
const { resolvedTheme } = useTheme();
const isDarkMode = resolvedTheme === "dark";
const [mounted, setMounted] = useState(false);

useEffect(() => {
setMounted(true);
}, []);

return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<ProgressBar />
<RainbowKitProvider
avatar={BlockieAvatar}
theme={mounted ? (isDarkMode ? darkTheme() : lightTheme()) : lightTheme()}
theme={lightTheme()}
>
<ScaffoldEthApp>{children}</ScaffoldEthApp>
</RainbowKitProvider>
Expand Down
35 changes: 0 additions & 35 deletions packages/nextjs/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
module.exports = {
content: ["./app/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", "./utils/**/*.{js,ts,jsx,tsx}"],
plugins: [require("daisyui")],
darkTheme: "dark",
darkMode: ["selector", "[data-theme='dark']"],
// DaisyUI theme colors
daisyui: {
themes: [
Expand Down Expand Up @@ -39,39 +37,6 @@ module.exports = {
},
},
},
{
dark: {
primary: "#212638",
"primary-content": "#F9FBFF",
secondary: "#323f61",
"secondary-content": "#F9FBFF",
accent: "#4969A6",
"accent-content": "#F9FBFF",
neutral: "#F9FBFF",
"neutral-content": "#385183",
"base-100": "#385183",
"base-200": "#2A3655",
"base-300": "#212638",
"base-content": "#F9FBFF",
info: "#385183",
success: "#34EEB6",
warning: "#FFCF72",
error: "#FF8863",

"--rounded-btn": "9999rem",

".tooltip": {
"--tooltip-tail": "6px",
"--tooltip-color": "oklch(var(--p))",
},
".link": {
textUnderlineOffset: "2px",
},
".link:hover": {
opacity: "80%",
},
},
},
],
},
theme: {
Expand Down

0 comments on commit 71edf47

Please sign in to comment.