Skip to content

Commit

Permalink
create theme option
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasHiltl committed Oct 25, 2024
1 parent 5e6a9cb commit 49289e6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions widget/next/src/Changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type ChangelogProps = {
pageSize?: number
// your own hosted openchangelog instance, defaults to https://openchangelog.com
baseUrl?: string
theme?: "dark" | "light"
}

async function fetchChangelog(args: ChangelogProps): Promise<string> {
Expand Down Expand Up @@ -37,6 +38,10 @@ export async function Changelog(props: ChangelogProps) {
const html = await fetchChangelog(props)

return (
<div dangerouslySetInnerHTML={{ __html: html }}></div>
);
<>
<div color-scheme={props.theme}>
<div dangerouslySetInnerHTML={{ __html: html }}></div>
</div>
</>
)
}

0 comments on commit 49289e6

Please sign in to comment.