From b85912691f38fcbc14ee10d054d49d9580f8b2b2 Mon Sep 17 00:00:00 2001 From: Beebles <102569435+beebls@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:46:18 -0600 Subject: further work on modal --- frontend/src/components/AnnouncementsDisplay.tsx | 144 ++++++++++++++--------- 1 file changed, 86 insertions(+), 58 deletions(-) (limited to 'frontend/src/components/AnnouncementsDisplay.tsx') diff --git a/frontend/src/components/AnnouncementsDisplay.tsx b/frontend/src/components/AnnouncementsDisplay.tsx index 226f63d8..e3a07e2d 100644 --- a/frontend/src/components/AnnouncementsDisplay.tsx +++ b/frontend/src/components/AnnouncementsDisplay.tsx @@ -4,6 +4,7 @@ import { FaInfo, FaTimes } from 'react-icons/fa'; import { Announcement, getAnnouncements } from '../store'; import { useSetting } from '../utils/hooks/useSetting'; +import WithSuspense from './WithSuspense'; const SEVERITIES = { High: { @@ -30,8 +31,8 @@ const welcomeAnnouncement: Announcement = { const welcomeAnnouncement2: Announcement = { id: 'welcomeAnnouncement2', - title: 'Welcome to Decky 2!', - text: '', + title: 'Test With mkdown content and a slightly long title', + text: '# Lorem Ipsum\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n## Features\n\n- **Bold text** for emphasis\n- *Italic text* for style\n- `Code snippets` for technical content\n\n### Getting Started\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n\n> This is a blockquote with some important information.\n\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', created: Date.now().toString(), updated: Date.now().toString(), }; @@ -82,7 +83,7 @@ export function AnnouncementsDisplay() { return ( - + {currentlyDisplayingAnnouncements.map((announcement) => ( - {announcement.title} - - {announcement.title} + + + showModal( + { + console.log('On Hide'); + }} + />, + ) + } + > + - showModal( - { - console.log('On Hide'); - }} - />, - ) - } - > - - - + + onHide()} + > + onHide()} - > - - - + /> + + ); } @@ -178,15 +179,42 @@ function AnnouncementModal({ }) { return ( - {announcement.title} - { - console.log('Dismiss'); - closeModal?.(); - }} - > - {announcement.text} - + +

{announcement.title}

+ + { + console.log('Dismiss'); + closeModal?.(); + }} + > + {announcement.text} + + + + onHide()}>Close Popup + onHide()}>Close and Hide Announcement +
); } -- cgit v1.2.3