Skip to content

Commit

Permalink
feat: render changelog markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
JMBeresford committed Sep 2, 2024
1 parent cfb9a84 commit e87b0f7
Show file tree
Hide file tree
Showing 3 changed files with 666 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { ScrollArea } from "@/components/ui/scroll-area";
import { Progress } from "@/components/ui/progress";
import { relaunch } from "@tauri-apps/plugin-process";
import { ToastAction } from "@/components/ui/toast";
import Markdown from "react-markdown";
import classes from "./markdown.module.scss";

type Progress = {
downloaded: number;
Expand Down Expand Up @@ -126,13 +128,15 @@ export function UpdateAvailable() {

function Changelog({ body }: { body?: string }) {
return (
<ScrollArea className="h-full max-h-[65dvh]">
<h3 className="font-semibold text-lg">Changelog</h3>

<p className="text-muted-foreground">
{body || "No changelog for this release"}
</p>
</ScrollArea>
<div className="py-2">
<ScrollArea className="h-full max-h-[65dvh] p-2 border bg-muted rounded">
{body ? (
<Markdown className={classes.markdown}>{body}</Markdown>
) : (
<p className="text-muted italic">No changelog for this release</p>
)}
</ScrollArea>
</div>
);
}

Expand Down
1 change: 1 addition & 0 deletions packages/client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.52.0",
"react-markdown": "^9.0.1",
"react-resizable-panels": "^2.0.19",
"sass": "^1.76.0",
"tailwind-merge": "^2.3.0",
Expand Down
Loading

0 comments on commit e87b0f7

Please sign in to comment.