Skip to content

Commit

Permalink
Discussion pre-moderation warning dark mode (#10809)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielCliftonGuardian authored Mar 4, 2024
1 parent b706b98 commit c6cf9f1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 13 deletions.
51 changes: 38 additions & 13 deletions dotcom-rendering/src/components/Discussion/CommentForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { css } from '@emotion/react';
import { space, text, textSans } from '@guardian/source-foundations';
import { Link } from '@guardian/source-react-components';
import { InfoSummary } from '@guardian/source-react-components-development-kitchen';
import { useEffect, useRef, useState } from 'react';
import type {
CommentType,
Expand Down Expand Up @@ -75,7 +77,7 @@ const blackPlaceholder = css`
`;

const headerTextStyles = css`
margin: 0;
margin: 0 0 10px 0;
${textSans.xxsmall()};
`;

Expand Down Expand Up @@ -123,6 +125,25 @@ const commentAddOns = css`
list-style-type: none;
`;

const preModMessage = css`
& div {
color: inherit;
${textSans.xxsmall({
fontWeight: 'bold',
})};
svg {
fill: ${schemedPalette('--discussion-pre-mod')};
}
}
`;

const preModLink = css`
color: ${schemedPalette('--discussion-pre-mod')};
${textSans.xxsmall({
fontWeight: 'bold',
})};
`;

const bottomContainer = css`
width: 100%;
display: flex;
Expand Down Expand Up @@ -449,18 +470,22 @@ export const CommentForm = ({
</p>

{user.profile.privateFields?.isPremoderated && (
<p css={[errorTextStyles, linkStyles]}>
Your comments are currently being pre-moderated
(
<a
href="/community-faqs#311"
target="_blank"
rel="nofollow"
>
why?
</a>
)
</p>
<InfoSummary
message={
'Your comments are currently being pre-moderated'
}
context={
<Link
href="/community-faqs#311"
target="_blank"
rel="nofollow"
cssOverrides={preModLink}
>
(why?)
</Link>
}
cssOverrides={preModMessage}
/>
)}
</div>
)}
Expand Down
7 changes: 7 additions & 0 deletions dotcom-rendering/src/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5040,6 +5040,9 @@ const interactiveAtomBackgroundLight: PaletteFunction = () => 'transparent';
const interactiveAtomBackgroundDark: PaletteFunction = () =>
sourcePalette.neutral[100];

const discussionPreModLight: PaletteFunction = () => sourcePalette.brand[500];
const discussionPreModDark: PaletteFunction = () => sourcePalette.brand[800];

// ----- Palette ----- //

/**
Expand Down Expand Up @@ -5973,6 +5976,10 @@ const paletteColours = {
light: shareButtonBorderXSmallLight,
dark: shareButtonBorderXSmallLight,
},
'--discussion-pre-mod': {
light: discussionPreModLight,
dark: discussionPreModDark,
},
} satisfies PaletteColours;

/**
Expand Down

0 comments on commit c6cf9f1

Please sign in to comment.