Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion pre-moderation warning dark mode #10809

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 37 additions & 12 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 @@ -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
Loading