diff --git a/packages/nextjs/components/Header.tsx b/packages/nextjs/components/Header.tsx index ae6e84e..4bf4ff5 100644 --- a/packages/nextjs/components/Header.tsx +++ b/packages/nextjs/components/Header.tsx @@ -2,6 +2,7 @@ import React from "react"; import Link from "next/link"; +import { SwitchTheme } from "~~/components/SwitchTheme"; import { RainbowKitCustomConnectButton } from "~~/components/scaffold-eth"; /** @@ -20,6 +21,9 @@ export const Header = () => {
+
+ +
); diff --git a/packages/nextjs/components/SwitchTheme.tsx b/packages/nextjs/components/SwitchTheme.tsx index 4dc20af..88a33fb 100644 --- a/packages/nextjs/components/SwitchTheme.tsx +++ b/packages/nextjs/components/SwitchTheme.tsx @@ -11,11 +11,7 @@ export const SwitchTheme = ({ className }: { className?: string }) => { const isDarkMode = resolvedTheme === "dark"; const handleToggle = () => { - if (isDarkMode) { - setTheme("light"); - return; - } - setTheme("dark"); + setTheme(isDarkMode ? "light" : "dark"); }; useEffect(() => { @@ -25,18 +21,14 @@ export const SwitchTheme = ({ className }: { className?: string }) => { if (!mounted) return null; return ( -
- - -
+ ); }; diff --git a/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx b/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx index a9e3125..bfa17d1 100644 --- a/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx +++ b/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx @@ -50,9 +50,10 @@ export const AddressInfoDropdown = ({
- + {isENS(displayName) ? displayName : checkSumAddress?.slice(0, 6) + "..." + checkSumAddress?.slice(-4)} +