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
---
# Deploying on Docker
# 🐋 Deploying on Docker
...

View File

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

View File

@ -5,5 +5,5 @@ summary: 'petentium usu tota noluisse errem elaboraret auctor.'
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)!

View File

@ -13,7 +13,6 @@ import { capitalizeWords } from "@/lib/string";
import { Metadata } from "next";
import Embed from "@/components/embed";
import DocsFooter from "@/components/docs-footer";
import { cn } from "@/lib/utils";
import OnThisPage from "@/components/on-this-page";
/**
@ -47,18 +46,15 @@ const DocsPage = async ({
{/* Breadcrumb */}
<Breadcrumb className="pt-4 pb-3 select-none">
<BreadcrumbList>
{splitSlug.map(
(part: string, index: number): ReactElement => {
const active: boolean =
index === splitSlug.length - 1;
{splitSlug
.slice(0, -1)
.map((part: string, index: number): ReactElement => {
const slug: string = splitSlug
.slice(1, index + 1)
.slice(1, index + 2) // Include one more to account for the index shift
.join("/");
return (
<div className="flex items-center" key={part}>
<BreadcrumbItem
className={cn(active && "text-primary")}
>
<BreadcrumbItem>
<BreadcrumbLink
href={slug}
draggable={false}
@ -66,13 +62,17 @@ const DocsPage = async ({
{capitalizeWords(part)}
</BreadcrumbLink>
</BreadcrumbItem>
{index < splitSlug.length - 1 && (
{index < splitSlug.length - 1 && ( // Adjusted to avoid separator after the last breadcrumb
<BreadcrumbSeparator className="pl-1.5" />
)}
</div>
);
}
)}
})}
<BreadcrumbItem className="text-primary">
<BreadcrumbLink href="#" draggable={false}>
{page.title}{" "}
</BreadcrumbLink>
</BreadcrumbItem>
</BreadcrumbList>
</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";
import Link from "next/link";
import { capitalizeWords } from "@/lib/string";
import ImageViewer from "@/components/image-viewer";
const blockquoteStyles: { [key: string]: any } = {
NOTE: {
@ -94,12 +95,14 @@ const components = {
// Media
img: ({ src, alt }: { src: string; alt: string }): ReactElement => (
<img
className="m-2 my-2.5 rounded-2xl ring-1 ring-muted/45 select-none"
src={src}
alt={alt}
draggable={false}
/>
<ImageViewer className="m-2 my-2.5">
<img
className="ring-1 ring-muted/45 rounded-2xl select-none"
src={src}
alt={alt}
draggable={false}
/>
</ImageViewer>
),
// Lists

View File

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