File tree Expand file tree Collapse file tree 3 files changed +23
-11
lines changed
app/(org)/dashboard/_components/Navbar Expand file tree Collapse file tree 3 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
33import { LogoBadge } from "@cap/ui" ;
4- import { faMoon , faSun } from "@fortawesome/free-solid-svg-icons" ;
5- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
64import { useClickAway } from "@uidotdev/usehooks" ;
75import { AnimatePresence , motion } from "framer-motion" ;
86import { X } from "lucide-react" ;
97import Link from "next/link" ;
108import { type MutableRefObject , useState } from "react" ;
9+
10+ import { ThemeToggleIcon } from "@/components/theme-toggle-icon" ;
1111import { useTheme } from "../../Contexts" ;
1212import NavItems from "./Items" ;
1313
@@ -61,10 +61,7 @@ export const AdminMobileNav = () => {
6161 } }
6262 className = "flex justify-center items-center rounded-full border transition-colors cursor-pointer lg:hidden bg-gray-4 hover:border-gray-6 hover:bg-gray-5 size-9 border-gray-5"
6363 >
64- < FontAwesomeIcon
65- className = "text-gray-12 size-3.5"
66- icon = { theme === "dark" ? faSun : faMoon }
67- />
64+ < ThemeToggleIcon />
6865 </ div >
6966 </ div >
7067 </ div >
Original file line number Diff line number Diff line change 99 PopoverContent ,
1010 PopoverTrigger ,
1111} from "@cap/ui" ;
12- import { faBell , faMoon , faSun } from "@fortawesome/free-solid-svg-icons" ;
12+ import { faBell } from "@fortawesome/free-solid-svg-icons" ;
1313import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
1414import { useMutation , useQueryClient } from "@tanstack/react-query" ;
1515import { useClickAway } from "@uidotdev/usehooks" ;
@@ -31,6 +31,7 @@ import {
3131import { markAsRead } from "@/actions/notifications/mark-as-read" ;
3232import Notifications from "@/app/(org)/dashboard/_components/Notifications" ;
3333import { SignedImageUrl } from "@/components/SignedImageUrl" ;
34+ import { ThemeToggleIcon } from "@/components/theme-toggle-icon" ;
3435import { UpgradeModal } from "@/components/UpgradeModal" ;
3536import { useDashboardContext , useTheme } from "../../Contexts" ;
3637import {
@@ -170,10 +171,7 @@ const Top = () => {
170171 } }
171172 className = "hidden justify-center items-center rounded-full transition-colors cursor-pointer bg-gray-3 lg:flex hover:bg-gray-5 size-9"
172173 >
173- < FontAwesomeIcon
174- className = "text-gray-12 size-3.5 view-transition-theme-icon"
175- icon = { theme === "dark" ? faMoon : faSun }
176- />
174+ < ThemeToggleIcon />
177175 </ div >
178176 < User />
179177 </ div >
Original file line number Diff line number Diff line change 1+ "use client" ;
2+ import { Moon , Sun } from "lucide-react" ;
3+ import { useTheme } from "@/app/(org)/dashboard/Contexts" ;
4+
5+ export const ThemeToggleIcon = ( ) => {
6+ const { theme } = useTheme ( ) ;
7+
8+ return (
9+ < span className = "view-transition-theme-icon" >
10+ { theme === "dark" ? (
11+ < Moon size = { 17 } className = "fill-white stroke-gray-3" />
12+ ) : (
13+ < Sun size = { 17 } className = "stroke-gray-12" />
14+ ) }
15+ </ span >
16+ ) ;
17+ } ;
You can’t perform that action at this time.
0 commit comments