add a theme query parameter to the the release notes url to make it (#1258)

theme aware

Co-authored-by: Vibe Kanban <noreply@vibekanban.com>
This commit is contained in:
Britannio Jarrett
2025-11-17 10:28:37 +00:00
committed by GitHub
parent d02dbdcf8c
commit 143a0f0686

View File

@@ -1,4 +1,4 @@
import { useState } from 'react'; import { useState, useMemo } from 'react';
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
@@ -9,15 +9,25 @@ import {
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { AlertCircle, ExternalLink } from 'lucide-react'; import { AlertCircle, ExternalLink } from 'lucide-react';
import NiceModal, { useModal } from '@ebay/nice-modal-react'; import NiceModal, { useModal } from '@ebay/nice-modal-react';
import { useTheme } from '@/components/theme-provider';
import { getActualTheme } from '@/utils/theme';
const RELEASE_NOTES_URL = 'https://vibekanban.com/release-notes'; const RELEASE_NOTES_BASE_URL = 'https://vibekanban.com/release-notes';
export const ReleaseNotesDialog = NiceModal.create(() => { export const ReleaseNotesDialog = NiceModal.create(() => {
const modal = useModal(); const modal = useModal();
const [iframeError, setIframeError] = useState(false); const [iframeError, setIframeError] = useState(false);
const { theme } = useTheme();
const releaseNotesUrl = useMemo(() => {
const actualTheme = getActualTheme(theme);
const url = new URL(RELEASE_NOTES_BASE_URL);
url.searchParams.set('theme', actualTheme);
return url.toString();
}, [theme]);
const handleOpenInBrowser = () => { const handleOpenInBrowser = () => {
window.open(RELEASE_NOTES_URL, '_blank'); window.open(releaseNotesUrl, '_blank');
modal.resolve(); modal.resolve();
}; };
@@ -57,7 +67,7 @@ export const ReleaseNotesDialog = NiceModal.create(() => {
</div> </div>
) : ( ) : (
<iframe <iframe
src={RELEASE_NOTES_URL} src={releaseNotesUrl}
className="flex-1 w-full border-0" className="flex-1 w-full border-0"
sandbox="allow-scripts allow-same-origin allow-popups" sandbox="allow-scripts allow-same-origin allow-popups"
referrerPolicy="no-referrer" referrerPolicy="no-referrer"