Use a popup for changelog again
This commit is contained in:
6 files changed
+91
-48
No files matched your search
@@ -0,0 +1,34 @@
|
||||
'use client'
|
||||
|
||||
import { useGlobal } from '@/providers/GlobalProvider'
|
||||
import DOMPurify from 'dompurify'
|
||||
|
||||
export default function VersionChangelogPopup () {
|
||||
const { serverVersionList, managingVersion } = useGlobal()
|
||||
|
||||
if (!managingVersion) return <></>
|
||||
|
||||
const versionInfo = serverVersionList?.versions.find(
|
||||
vf => vf.id == managingVersion
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<p className='text-xl text-center'>
|
||||
Viewing changelog {versionInfo?.displayName}
|
||||
</p>
|
||||
<div className='popup-content h-full w-full p-2'>
|
||||
<p
|
||||
className='whitespace-pre-line'
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: DOMPurify.sanitize(
|
||||
atob(versionInfo?.changelog ?? '')
|
||||
.replaceAll('- ', '• ')
|
||||
.replaceAll(/`([^`]+)`/g, '<code>$1</code>')
|
||||
)
|
||||
}}
|
||||
></p>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user