From 8b6c902ec6d3f2a92b77e8979ba5799a0853a936 Mon Sep 17 00:00:00 2001 From: Agusti Date: Tue, 10 Oct 2023 18:59:00 +0200 Subject: [PATCH] feat: reading progress bar bigger --- app/(web)/guides/page.tsx | 4 +-- app/(web)/page.tsx | 6 ++--- components/animated-skeleton.tsx | 11 +++----- components/base-toggle.tsx | 44 ++++++++++++++++++++------------ components/guide-authors.tsx | 10 ++++---- components/main-nav.tsx | 2 +- components/mdx-components.tsx | 2 +- components/mode-toggle.tsx | 43 ------------------------------- components/page-header.tsx | 2 +- components/reading-progress.tsx | 27 +++++++++++++++----- components/site-footer.tsx | 8 +++--- content/guides/checks.mdx | 2 -- 12 files changed, 68 insertions(+), 93 deletions(-) delete mode 100644 components/mode-toggle.tsx diff --git a/app/(web)/guides/page.tsx b/app/(web)/guides/page.tsx index 442b4ec..97457b2 100644 --- a/app/(web)/guides/page.tsx +++ b/app/(web)/guides/page.tsx @@ -21,7 +21,7 @@ export default function GuidesPage() { return compareDesc(new Date(a.date), new Date(b.date)) }) return ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} {guide.title} -
+

{guide.title}

diff --git a/app/(web)/page.tsx b/app/(web)/page.tsx index 34b5298..8ec87e5 100644 --- a/app/(web)/page.tsx +++ b/app/(web)/page.tsx @@ -26,7 +26,7 @@ import { GuideAuthors } from "@/components/guide-authors" ) return ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} - {guide.title} -
+ {guide.title} +

{guide.title}

diff --git a/components/animated-skeleton.tsx b/components/animated-skeleton.tsx index e4c1564..3145fc4 100644 --- a/components/animated-skeleton.tsx +++ b/components/animated-skeleton.tsx @@ -1,8 +1,7 @@ "use client" import {motion} from "framer-motion" -import { FileQuestion } from "lucide-react"; -import { CardTitle } from "./ui/card"; + import Image from "next/image" export const AnimatedSkeleton = ({}) => { return( @@ -12,11 +11,9 @@ export const AnimatedSkeleton = ({}) => { animate={{ opacity: 1 }} transition={{ delay: 1 }} > - opepen-vvd - opepen-vvd -

COMING SOON...

- {/* {children} */} - {/* */} + opepen-vvd + opepen-vvd +

COMING SOON...

) } diff --git a/components/base-toggle.tsx b/components/base-toggle.tsx index f896162..704548d 100644 --- a/components/base-toggle.tsx +++ b/components/base-toggle.tsx @@ -2,6 +2,7 @@ import * as React from "react" import { useTheme } from "next-themes" +import { usePathname } from "next/navigation" import { Button } from "@/components/ui/button" import { @@ -14,33 +15,44 @@ import { Icons } from "@/components/icons" export function BaseToggle() { const { setTheme } = useTheme() + const pathname = usePathname() + console.log(pathname) + const isGuide = pathname.startsWith("/guides/") return ( - - +
- - setTheme("light")}> - - Light - - setTheme("dark")}> - - Dark - - setTheme("system")}> - - System - + setTheme("light")}> + + Light + + setTheme("dark")}> + + Dark + + setTheme("system")}> + + System +
) -} \ No newline at end of file +} diff --git a/components/guide-authors.tsx b/components/guide-authors.tsx index 6afc174..a84fb47 100644 --- a/components/guide-authors.tsx +++ b/components/guide-authors.tsx @@ -48,7 +48,7 @@ export function GuideAuthors({ authors, className }: GuideAuthorsProps) { <> {authors?.length ? ( @@ -84,9 +84,9 @@ export function GuideAuthors({ authors, className }: GuideAuthorsProps) { - + @{author.twitter} @@ -95,7 +95,7 @@ export function GuideAuthors({ authors, className }: GuideAuthorsProps) {
) : null)}
- + Go to {authors[0].title}'s Twitter diff --git a/components/main-nav.tsx b/components/main-nav.tsx index 04627f1..6e1ed1a 100644 --- a/components/main-nav.tsx +++ b/components/main-nav.tsx @@ -31,7 +31,7 @@ export function MainNav({ items, children }: MainNavProps) { } return ( -
+
diff --git a/components/mdx-components.tsx b/components/mdx-components.tsx index 4195cd4..d4e570b 100644 --- a/components/mdx-components.tsx +++ b/components/mdx-components.tsx @@ -108,7 +108,7 @@ const components = { // eslint-disable-next-line @next/next/no-img-element {alt} ), - hr: ({ ...props }) =>
, + hr: ({ ...props }) =>
, table: ({ className, ...props }: React.HTMLAttributes) => (
diff --git a/components/mode-toggle.tsx b/components/mode-toggle.tsx deleted file mode 100644 index 4210fb7..0000000 --- a/components/mode-toggle.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client" - -import * as React from "react" -import { useTheme } from "next-themes" - -import { Button } from "@/components/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu" -import { Icons } from "@/components/icons" - -export function ModeToggle() { - const { setTheme } = useTheme() - - return ( - - - - - - setTheme("light")}> - - Light - - setTheme("dark")}> - - Dark - - setTheme("system")}> - - System - - - - ) -} \ No newline at end of file diff --git a/components/page-header.tsx b/components/page-header.tsx index 51b227c..49f2f90 100644 --- a/components/page-header.tsx +++ b/components/page-header.tsx @@ -36,7 +36,7 @@ export function DocsPageHeader({ return ( -
+
+
{Math.round(scrollPosition)}%
+
+ ); - }; +}; -export default ReadingProgressBar \ No newline at end of file +export default ReadingProgressBar; diff --git a/components/site-footer.tsx b/components/site-footer.tsx index 5fa15e9..a9972c6 100644 --- a/components/site-footer.tsx +++ b/components/site-footer.tsx @@ -6,7 +6,6 @@ import { motion } from "framer-motion" import { siteConfig } from "@/config/site" import { cn } from "@/lib/utils" import { Icons } from "@/components/icons" -import { ModeToggle } from "@/components/mode-toggle" export function SiteFooter({ className }: React.HTMLAttributes) { const containerVariants = { @@ -27,7 +26,7 @@ export function SiteFooter({ className }: React.HTMLAttributes) { animate="visible" > ) {

-
- +
@@ -65,7 +63,7 @@ export function SiteFooter({ className }: React.HTMLAttributes) { >