2 Commits

Author SHA1 Message Date
dc89db4eed image viewer component
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m50s
Took 19 minutes
2024-10-07 20:47:52 -04:00
40b799e280 update docs page breadcrumb
Took 5 minutes
2024-10-07 20:29:06 -04:00
7 changed files with 57 additions and 26 deletions

View File

@ -5,5 +5,5 @@ summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 4 order: 4
--- ---
# Deploying on Docker # 🐋 Deploying on Docker
... ...

View File

@ -5,5 +5,5 @@ summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 2 order: 2
--- ---
# Components # 🧩 Components
... ...

View File

@ -5,5 +5,5 @@ summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 3 order: 3
--- ---
# Supported Services # ✔️ Supported Services
Below is a list of all the services that are currently supported by Pulse App. Are we missing a service? Please [open an issue](https://git.rainnny.club/PulseApp/API/issues)! Below is a list of all the services that are currently supported by Pulse App. Are we missing a service? Please [open an issue](https://git.rainnny.club/PulseApp/API/issues)!

View File

@ -13,7 +13,6 @@ import { capitalizeWords } from "@/lib/string";
import { Metadata } from "next"; import { Metadata } from "next";
import Embed from "@/components/embed"; import Embed from "@/components/embed";
import DocsFooter from "@/components/docs-footer"; import DocsFooter from "@/components/docs-footer";
import { cn } from "@/lib/utils";
import OnThisPage from "@/components/on-this-page"; import OnThisPage from "@/components/on-this-page";
/** /**
@ -47,18 +46,15 @@ const DocsPage = async ({
{/* Breadcrumb */} {/* Breadcrumb */}
<Breadcrumb className="pt-4 pb-3 select-none"> <Breadcrumb className="pt-4 pb-3 select-none">
<BreadcrumbList> <BreadcrumbList>
{splitSlug.map( {splitSlug
(part: string, index: number): ReactElement => { .slice(0, -1)
const active: boolean = .map((part: string, index: number): ReactElement => {
index === splitSlug.length - 1;
const slug: string = splitSlug const slug: string = splitSlug
.slice(1, index + 1) .slice(1, index + 2) // Include one more to account for the index shift
.join("/"); .join("/");
return ( return (
<div className="flex items-center" key={part}> <div className="flex items-center" key={part}>
<BreadcrumbItem <BreadcrumbItem>
className={cn(active && "text-primary")}
>
<BreadcrumbLink <BreadcrumbLink
href={slug} href={slug}
draggable={false} draggable={false}
@ -66,13 +62,17 @@ const DocsPage = async ({
{capitalizeWords(part)} {capitalizeWords(part)}
</BreadcrumbLink> </BreadcrumbLink>
</BreadcrumbItem> </BreadcrumbItem>
{index < splitSlug.length - 1 && ( {index < splitSlug.length - 1 && ( // Adjusted to avoid separator after the last breadcrumb
<BreadcrumbSeparator className="pl-1.5" /> <BreadcrumbSeparator className="pl-1.5" />
)} )}
</div> </div>
); );
} })}
)} <BreadcrumbItem className="text-primary">
<BreadcrumbLink href="#" draggable={false}>
{page.title}{" "}
</BreadcrumbLink>
</BreadcrumbItem>
</BreadcrumbList> </BreadcrumbList>
</Breadcrumb> </Breadcrumb>

View File

@ -0,0 +1,32 @@
"use client";
import { ReactElement, ReactNode } from "react";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import { cn } from "@/lib/utils";
type ImageViewerProps = {
className?: string | undefined;
children: ReactNode;
};
const ImageViewer = ({
className,
children,
}: ImageViewerProps): ReactElement => {
return (
<Dialog>
<DialogTrigger
className={cn(
"hover:scale-[1.005] transition-all transform-gpu",
className
)}
>
{children}
</DialogTrigger>
<DialogContent className="p-0 min-w-[20rem] max-w-screen-xl">
{children}
</DialogContent>
</Dialog>
);
};
export default ImageViewer;

View File

@ -12,6 +12,7 @@ import {
} from "lucide-react"; } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { capitalizeWords } from "@/lib/string"; import { capitalizeWords } from "@/lib/string";
import ImageViewer from "@/components/image-viewer";
const blockquoteStyles: { [key: string]: any } = { const blockquoteStyles: { [key: string]: any } = {
NOTE: { NOTE: {
@ -94,12 +95,14 @@ const components = {
// Media // Media
img: ({ src, alt }: { src: string; alt: string }): ReactElement => ( img: ({ src, alt }: { src: string; alt: string }): ReactElement => (
<img <ImageViewer className="m-2 my-2.5">
className="m-2 my-2.5 rounded-2xl ring-1 ring-muted/45 select-none" <img
src={src} className="ring-1 ring-muted/45 rounded-2xl select-none"
alt={alt} src={src}
draggable={false} alt={alt}
/> draggable={false}
/>
</ImageViewer>
), ),
// Lists // Lists

View File

@ -1,9 +1,5 @@
import { ReactElement, ReactNode } from "react"; import { ReactElement, ReactNode } from "react";
import { import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { SIDE_OPTIONS } from "@radix-ui/react-popper"; import { SIDE_OPTIONS } from "@radix-ui/react-popper";
/** /**