Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions apps/web/app/(org)/dashboard/_components/Navbar/Mobile.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";

import { LogoBadge } from "@cap/ui";
import { faMoon, faSun } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useClickAway } from "@uidotdev/usehooks";
import { AnimatePresence, motion } from "framer-motion";
import { X } from "lucide-react";
import Link from "next/link";
import { type MutableRefObject, useState } from "react";

import { ThemeToggleIcon } from "@/components/theme-toggle-icon";
import { useTheme } from "../../Contexts";
import NavItems from "./Items";

Expand Down Expand Up @@ -61,10 +61,7 @@ export const AdminMobileNav = () => {
}}
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"
>
<FontAwesomeIcon
className="text-gray-12 size-3.5"
icon={theme === "dark" ? faSun : faMoon}
/>
<ThemeToggleIcon />
</div>
</div>
</div>
Expand Down
8 changes: 3 additions & 5 deletions apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PopoverContent,
PopoverTrigger,
} from "@cap/ui";
import { faBell, faMoon, faSun } from "@fortawesome/free-solid-svg-icons";
import { faBell } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useClickAway } from "@uidotdev/usehooks";
Expand All @@ -31,6 +31,7 @@ import {
import { markAsRead } from "@/actions/notifications/mark-as-read";
import Notifications from "@/app/(org)/dashboard/_components/Notifications";
import { SignedImageUrl } from "@/components/SignedImageUrl";
import { ThemeToggleIcon } from "@/components/theme-toggle-icon";
import { UpgradeModal } from "@/components/UpgradeModal";
import { useDashboardContext, useTheme } from "../../Contexts";
import {
Expand Down Expand Up @@ -170,10 +171,7 @@ const Top = () => {
}}
className="hidden justify-center items-center rounded-full transition-colors cursor-pointer bg-gray-3 lg:flex hover:bg-gray-5 size-9"
>
<FontAwesomeIcon
className="text-gray-12 size-3.5 view-transition-theme-icon"
icon={theme === "dark" ? faMoon : faSun}
/>
<ThemeToggleIcon />
</div>
<User />
</div>
Expand Down
17 changes: 17 additions & 0 deletions apps/web/components/theme-toggle-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "@/app/(org)/dashboard/Contexts";

export const ThemeToggleIcon = () => {
const { theme } = useTheme();

return (
<span className="view-transition-theme-icon">
{theme === "dark" ? (
<Moon size={17} className="fill-white stroke-gray-3" />
) : (
<Sun size={17} className="stroke-gray-12" />
)}
</span>
);
};
Comment on lines +1 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Format the file with Biome.

As requested by @ameer2468 in the PR comments, please format this file with Biome to ensure consistency with the codebase standards.

As per coding guidelines.

Run the following command:


🏁 Script executed:

pnpm format

Length of output: 273


🏁 Script executed:

#!/bin/bash
# Check the actual indentation in the file
cat -A apps/web/components/theme-toggle-icon.tsx

Length of output: 451


Format the file with Biome to convert tabs to 2-space indentation.

The file currently uses tabs for indentation instead of the required 2-space indent. Run pnpm format to format with Biome and align with the coding guidelines.

🤖 Prompt for AI Agents
In apps/web/components/theme-toggle-icon.tsx around lines 1 to 17 the file uses
tabs for indentation instead of the project standard 2-space indent; run the
formatter (pnpm format) which uses Biome to convert tabs to 2-space indentation,
or replace tabs with two spaces throughout the file and re-save to match coding
guidelines.