diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-10 20:13:21 -0500 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-01-10 20:13:21 -0500 |
| commit | 7b4de6ba79f2c0fec8056a5261d66d2edb66a4f8 (patch) | |
| tree | 0454842c401cb4064c72df2dc295393102e154f9 /src | |
| parent | d16216a6152cc763298f240467d323c1b2cf7c0e (diff) | |
| download | decky-bazzite-buddy-7b4de6ba79f2c0fec8056a5261d66d2edb66a4f8.tar.gz decky-bazzite-buddy-7b4de6ba79f2c0fec8056a5261d66d2edb66a4f8.zip | |
made changelog view pwetty
Diffstat (limited to 'src')
| -rwxr-xr-x | src/index.tsx | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/index.tsx b/src/index.tsx index d6428a1..c5b9e1a 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,8 @@ import { definePlugin } from "decky-frontend-lib"; import React, { useEffect, useState } from "react"; import { FaClipboardList } from "react-icons/fa"; +import { marked } from "marked"; +import DOMPurify from "dompurify"; function Content() { const [changelog, setChangelog] = useState<string | null>(null); @@ -77,14 +79,50 @@ function Content() { {error} </p> ) : changelog ? ( - <pre + <div style={{ - whiteSpace: "pre-wrap", - wordWrap: "break-word", + backgroundColor: "#1e1e1e", + padding: "10px", + borderRadius: "5px", + color: "#ffffff", + fontFamily: "Arial, sans-serif", + fontSize: "14px", + lineHeight: "1.6", }} > - {changelog} - </pre> + <style> + {` + h1, h2, h3 { + color: #61dafb; + margin: 0 0 10px; + } + p { + margin: 0 0 10px; + } + ul, ol { + margin: 10px 0 10px 20px; + } + li { + margin: 5px 0; + } + pre { + background-color: #282c34; + padding: 10px; + border-radius: 5px; + overflow-x: auto; + color: #dcdcdc; + } + a { + color: #61dafb; + text-decoration: none; + } + a:hover { + text-decoration: underline; + } + `} + </style> + <div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(marked(changelog)) }}></div> + </div> ) : ( <p aria-live="polite">Loading...</p> )} |
