From 7a373ac57f0f74bcf367a8dec4b5a5834bf78302 Mon Sep 17 00:00:00 2001 From: nick-funk Date: Tue, 21 Apr 2020 15:40:24 -0600 Subject: [PATCH] Update configure checkboxes to new branding CORL-903 --- .../ConfigureStream/ConfigureStream.css | 17 ++- .../ConfigureStream/ConfigureStream.tsx | 66 +++++------ .../ConfigureStream/ToggleConfig.css | 8 ++ .../ConfigureStream/ToggleConfig.tsx | 8 +- .../WidthLimitedDescription.css | 9 +- .../WidthLimitedDescription.tsx | 8 +- .../renderConfigure.spec.tsx.snap | 112 +++++++++--------- .../configure/streamConfiguration.spec.tsx | 2 +- src/locales/en-US/stream.ftl | 3 +- 9 files changed, 126 insertions(+), 107 deletions(-) diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.css b/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.css index 0d8f16aeb1..dd60e4e4c0 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.css +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.css @@ -1,3 +1,18 @@ .heading { - padding-bottom: calc(2 * var(--mini-unit)); + font-family: var(--v2-font-family-primary); + font-weight: var(--v2-font-weight-primary-semi-bold); + font-size: var(--v2-font-size-4); + line-height: var(--v2-line-height-5); + + color: var(--v2-colors-mono-500); + + margin-bottom: var(--v2-spacing-3); +} + +.liveUpdates { + margin-bottom: var(--v2-spacing-4); +} + +.footer { + margin-bottom: var(--v2-spacing-6); } diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.tsx b/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.tsx index dad2fda882..e1f6d9a9cd 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.tsx +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/ConfigureStream.tsx @@ -6,13 +6,8 @@ import { Form } from "react-final-form"; import { purgeMetadata } from "coral-framework/lib/relay"; import { PropTypesOf } from "coral-framework/types"; import CLASSES from "coral-stream/classes"; -import { - Button, - CallOut, - Flex, - HorizontalGutter, - Typography, -} from "coral-ui/components"; +import { Icon } from "coral-ui/components/v2"; +import { Button, CallOut } from "coral-ui/components/v3"; import { LiveUpdatesConfigContainer } from "./LiveUpdatesConfig"; import MessageBoxConfigContainer from "./MessageBoxConfig"; @@ -41,33 +36,10 @@ const ConfigureStream: FunctionComponent = ({ onSubmit={handleSubmit} id="configure-form" > - - - - Configure this Stream - - - - - - - - {submitError && ( - - {submitError} - - )} + +
Configure this Stream
+
+
= ({ - +
+ + + +
+ {submitError && ( + error} + titleWeight="semiBold" + title={submitError} + /> + )} +
)} diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.css b/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.css index d67258ca6c..8b4a443c3d 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.css +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.css @@ -1,3 +1,11 @@ +.title { + font-family: var(--v2-font-family-primary); + font-style: normal; + font-weight: var(--v2-font-weight-primary-regular); + font-size: var(--v2-font-size-3); + line-height: 1.15rem; + } + .details { margin-top: 2.5px; margin-left: 25px; diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.tsx b/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.tsx index 848ecd72a3..736aed8284 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.tsx +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/ToggleConfig.tsx @@ -1,7 +1,7 @@ import React, { FunctionComponent } from "react"; import { PropTypesOf } from "coral-framework/types"; -import { CheckBox, Typography } from "coral-ui/components"; +import { CheckBox } from "coral-ui/components/v2"; import styles from "./ToggleConfig.css"; @@ -14,10 +14,8 @@ const ToggleConfig: FunctionComponent = (props) => { const { title, children, ...rest } = props; return (
- - - {title} - + +
{title}
{children &&
{children}
}
diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.css b/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.css index b190ba289f..5f8f25031c 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.css +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.css @@ -1,3 +1,10 @@ .root { - max-width: 350px; + font-family: var(--v2-font-family-primary); + font-weight: var(--v2-font-weight-primary-regular); + font-size: var(--v2-font-size-2); + line-height: var(--v2-line-heigh-4); + + color: var(--v2-colors-mono-100); + + margin-bottom: var(--v2-spacing-3); } diff --git a/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.tsx b/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.tsx index d860d9193a..83cecd7450 100644 --- a/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.tsx +++ b/src/core/client/stream/tabs/Configure/ConfigureStream/WidthLimitedDescription.tsx @@ -1,7 +1,7 @@ import React, { FunctionComponent } from "react"; import { PropTypesOf } from "coral-framework/types"; -import { CheckBox, Typography } from "coral-ui/components"; +import { CheckBox } from "coral-ui/components/v2"; import styles from "./WidthLimitedDescription.css"; @@ -10,11 +10,7 @@ export interface Props extends Omit, "children"> { } const WidthLimitedDescription: FunctionComponent = (props) => { - return ( - - {props.children} - - ); + return
{props.children}
; }; export default WidthLimitedDescription; diff --git a/src/core/client/stream/test/configure/__snapshots__/renderConfigure.spec.tsx.snap b/src/core/client/stream/test/configure/__snapshots__/renderConfigure.spec.tsx.snap index 57408f1996..2783f88d71 100644 --- a/src/core/client/stream/test/configure/__snapshots__/renderConfigure.spec.tsx.snap +++ b/src/core/client/stream/test/configure/__snapshots__/renderConfigure.spec.tsx.snap @@ -76,38 +76,20 @@ exports[`renders configure 1`] = ` onSubmit={[Function]} >
-

- Configure this Stream -

- + Configure this Stream
-

When enabled, the comments will be updated instantly as new comments and replies are submitted, instead of requiring a page refresh. You can disable this in the unusual situation of an article getting so much traffic that the comments are loading slowly. -

+
-

Moderators must approve any comment before it is published to this story. -

+
-

Moderators must approve any comment that contains a link before it is published to this story. -

+
@@ -272,17 +254,33 @@ unusual situation of an article getting so much traffic that the comments are lo
-

Add a message to the top of the comment box for your readers. Use this to suggest a discussion topic, ask a question or make announcements relating to the comments on this story. -

+
+ +

within(testRenderer.root).getByTestID("current-tab-pane") ); - const applyButton = within(tabPane).getByText("Apply"); + const applyButton = within(tabPane).getByTestID("configure-stream-apply"); const form = findParentWithType(applyButton, "form")!; return { testRenderer, tabPane, applyButton, form }; diff --git a/src/locales/en-US/stream.ftl b/src/locales/en-US/stream.ftl index 0dca9aca5a..16ae3993f2 100644 --- a/src/locales/en-US/stream.ftl +++ b/src/locales/en-US/stream.ftl @@ -482,7 +482,8 @@ profile-changeUsername-close = Close configure-stream-title = Configure this Comment Stream configure-stream-title-configureThisStream = Configure this Stream -configure-stream-apply = Apply +configure-stream-apply = +configure-stream-update = Update configure-premod-title = Enable Pre-Moderation configure-premod-description =