From ffaab1e09f52712fbc97dec3aa1b0b66a28f9afd Mon Sep 17 00:00:00 2001 From: "Delilah C." <23665803+goplayoutside3@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:48:02 -0500 Subject: [PATCH] app-project: Announcements markdown direction (#6308) * minor styling updates to paragraphs used in markdown of announcement banners * address styling for multiple paragraphs with Storybook --- .../GenericAnnouncement.js | 12 ++++--- .../markdownzComponents.js | 7 +++- .../ProjectAnnouncement.stories.js | 32 ++++++++++++++++--- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/packages/app-project/src/components/Announcements/components/GenericAnnouncement/GenericAnnouncement.js b/packages/app-project/src/components/Announcements/components/GenericAnnouncement/GenericAnnouncement.js index fdb1e005b1..5c04742563 100644 --- a/packages/app-project/src/components/Announcements/components/GenericAnnouncement/GenericAnnouncement.js +++ b/packages/app-project/src/components/Announcements/components/GenericAnnouncement/GenericAnnouncement.js @@ -24,13 +24,17 @@ function GenericAnnouncement({ justify='between' > - {announcement} + + {announcement} + + {/* These are buttons passed from AuthenticationInvitation and FinishedAnnouncement */} {children} {dismissable && } diff --git a/packages/app-project/src/components/Announcements/components/GenericAnnouncement/markdownzComponents.js b/packages/app-project/src/components/Announcements/components/GenericAnnouncement/markdownzComponents.js index 3e7a006b89..c134169c97 100644 --- a/packages/app-project/src/components/Announcements/components/GenericAnnouncement/markdownzComponents.js +++ b/packages/app-project/src/components/Announcements/components/GenericAnnouncement/markdownzComponents.js @@ -4,10 +4,15 @@ import styled from 'styled-components' const StyledParagraph = styled(Paragraph)` font-weight: bold; line-height: 1.25; + margin: 0 0 0 0; + + &:not(:first-child) { + margin: 10px 0 0 0; + } ` function MarkdownParagraph(nodeProps) { return ( - + {nodeProps.children} ) diff --git a/packages/app-project/src/components/Announcements/components/ProjectAnnouncement/ProjectAnnouncement.stories.js b/packages/app-project/src/components/Announcements/components/ProjectAnnouncement/ProjectAnnouncement.stories.js index 7b4602fd1e..68687bf902 100644 --- a/packages/app-project/src/components/Announcements/components/ProjectAnnouncement/ProjectAnnouncement.stories.js +++ b/packages/app-project/src/components/Announcements/components/ProjectAnnouncement/ProjectAnnouncement.stories.js @@ -1,13 +1,28 @@ import { Provider } from 'mobx-react' import ProjectAnnouncementConnector from './ProjectAnnouncementConnector' -const ANNOUNCEMENT = - 'Neque magnis massa cum elementum dignissim nibh congue facilisis suscipit dictumst, porta hac porttitor praesent purus velit nullam nascetur eu ultricies libero, ipsum viverra molestie orci mollis faucibus habitant a placerat.' - export const mockStore = { project: { configuration: { - announcement: ANNOUNCEMENT + announcement: + 'Neque magnis massa cum elementum dignissim nibh congue facilisis suscipit dictumst, porta hac porttitor praesent purus velit nullam nascetur eu ultricies libero, ipsum viverra molestie orci mollis faucibus habitant a placerat.' + } + }, + ui: { + dismissProjectAnnouncementBanner: () => {}, + showAnnouncement: true + } +} + +const mockParagraphsStore = { + project: { + configuration: { + announcement: `Welcome to BMT's Documentation Detectives! Check out our project intro video [here](https://www.youtube.com). +Our accession register records may contain offensive and outdated terms. For more information, please see the [Content Note](https://www.zooniverse.org) etc. + +We value your feedback and would love to hear your thoughts about our project! If you would like to tell us more, click here: https://www.surveymonkey.com to take part in our survey. The survey is available until Friday 20th September 2024, 4pm (UK time) + +New subjects sets have been uploaded to the handwritten workflow today, the next upload will be on the 2nd of October.` } }, ui: { @@ -17,7 +32,8 @@ export const mockStore = { } export default { - title: 'Project App / Screens / Project Home / Announcements / ProjectAnnouncement', + title: + 'Project App / Screens / Project Home / Announcements / ProjectAnnouncement', component: ProjectAnnouncementConnector, excludeStories: ['mockStore'] } @@ -27,3 +43,9 @@ export const Default = () => ( ) + +export const MultipleParagraphs = () => ( + + + +)