From 0dea9c5d3c24ef312ee3c8218b7de85cc5e16cc3 Mon Sep 17 00:00:00 2001 From: Nikhil Sarwara Date: Sat, 14 Oct 2023 15:38:29 +0530 Subject: [PATCH 1/6] Added: Dark Toggle Button --- app/breadcrumb.tsx | 126 ++++++++++++++++++-------------- app/layout.tsx | 4 +- app/page.tsx | 4 +- components/dark-mode-toggle.tsx | 26 +++++++ tailwind.config.js | 1 + 5 files changed, 101 insertions(+), 60 deletions(-) create mode 100644 components/dark-mode-toggle.tsx diff --git a/app/breadcrumb.tsx b/app/breadcrumb.tsx index b39eef3..28d351e 100644 --- a/app/breadcrumb.tsx +++ b/app/breadcrumb.tsx @@ -1,56 +1,57 @@ -'use client'; +"use client"; -import clsx from 'clsx'; -import { signIn, signOut, useSession } from 'next-auth/react'; -import Image from 'next/image'; -import Link from 'next/link'; -import { useSelectedLayoutSegments } from 'next/navigation'; -import { Fragment, useState } from 'react'; -import { BiBell } from 'react-icons/bi'; -import { BsLink45Deg, BsPersonFill } from 'react-icons/bs'; -import { TbLogout } from 'react-icons/tb'; +import clsx from "clsx"; +import { signIn, signOut, useSession } from "next-auth/react"; +import Image from "next/image"; +import Link from "next/link"; +import { useSelectedLayoutSegments } from "next/navigation"; +import { Fragment, useState } from "react"; +import { BiBell } from "react-icons/bi"; +import { BsLink45Deg, BsPersonFill } from "react-icons/bs"; +import { TbLogout } from "react-icons/tb"; -import ImageWithFallback from '@/components/fallback-image'; +import ImageWithFallback from "@/components/fallback-image"; +import DarkModeToggle from "@/components/dark-mode-toggle"; const capitalise = (text: string) => { return text - .split(' ') + .split(" ") .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(' '); + .join(" "); }; const quickList = [ { - heading: 'Calendars', + heading: "Calendars", items: [ - { name: 'Academic Calendar', link: '1iJ6BxMBIqZEfFMe9c4ocidcm_madI13U' }, - { name: 'Holidays', link: '1l5no5NR7uguRm7zXbpeIqbN9X9IiyDun' }, + { name: "Academic Calendar", link: "1iJ6BxMBIqZEfFMe9c4ocidcm_madI13U" }, + { name: "Holidays", link: "1l5no5NR7uguRm7zXbpeIqbN9X9IiyDun" }, ], }, { - heading: 'Syllabi', + heading: "Syllabi", items: [ - { name: 'Civil Engineering', link: '16GZfj3pzUaiKMx-frey_K2dB2Oy6xe0d' }, - { name: 'Computer Science', link: '1sgjxNv4gf662kwbNeAGygPD49NvGQ2gL' }, + { name: "Civil Engineering", link: "16GZfj3pzUaiKMx-frey_K2dB2Oy6xe0d" }, + { name: "Computer Science", link: "1sgjxNv4gf662kwbNeAGygPD49NvGQ2gL" }, { - name: 'Electronics And Communication Engineering', - link: '1IUDACGOHCO3h-vhx-G8ofwrD3LUfqTP-', + name: "Electronics And Communication Engineering", + link: "1IUDACGOHCO3h-vhx-G8ofwrD3LUfqTP-", }, { - name: 'Electrical Engineering', - link: '1m-xhRr2J-kK-5EUBeRj7M33ipndCfT_t', + name: "Electrical Engineering", + link: "1m-xhRr2J-kK-5EUBeRj7M33ipndCfT_t", }, { - name: 'Information Technology', - link: '1hF5sqQb6ifLHcZrc2immFpSn6IoF35OD', + name: "Information Technology", + link: "1hF5sqQb6ifLHcZrc2immFpSn6IoF35OD", }, { - name: 'Mechanical Engineering', - link: '1vvgCKCY8hTbHd4oFT51MRXdyYuT2lSLI', + name: "Mechanical Engineering", + link: "1vvgCKCY8hTbHd4oFT51MRXdyYuT2lSLI", }, { - name: 'Production and Industrial Engineering', - link: '1l--XXOVAGTyhZYGxz_-G6RJT_Bq-FKY9', + name: "Production and Industrial Engineering", + link: "1l--XXOVAGTyhZYGxz_-G6RJT_Bq-FKY9", }, ], }, @@ -58,7 +59,7 @@ const quickList = [ export default function Breadcrumb() { const segments = useSelectedLayoutSegments() - .filter((segment) => !(segment.startsWith('(') && segment.endsWith(')'))) + .filter((segment) => !(segment.startsWith("(") && segment.endsWith(")"))) .map((segment) => decodeURIComponent(segment)); const [showQuickList, setShowQuickList] = useState(false); @@ -68,7 +69,7 @@ export default function Breadcrumb() { return (