diff --git a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap
index 1d82d7bb9..19c1b6129 100644
--- a/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/loadMore.spec.tsx.snap
@@ -325,278 +325,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
- Sign in
-
-
- Register
-
-
-
-
-
-
-
-
-
- format_bold
-
-
-
-
- format_italic
-
-
-
-
- format_quote
-
-
-
-
- Post a comment
-
-
-
-
-
-
- Sign in and join the conversation
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/permalinkView.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/permalinkView.spec.tsx.snap
index 19ba2686a..89eba3ff5 100644
--- a/src/core/client/stream/test/__snapshots__/permalinkView.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/permalinkView.spec.tsx.snap
@@ -4,78 +4,15 @@ exports[`renders permalink view 1`] = `
-
-
-
-
-
-
- Markus
-
-
- 2018-07-06T18:24:00.000Z
-
-
-
-
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (6:6)
+5: ) {
+6: me(clientAuthRevision: $authRevision) {
+ ^
+7: ...PermalinkViewContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/permalinkViewAssetNotFound.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/permalinkViewAssetNotFound.spec.tsx.snap
index b7f4fc521..d5c3a172c 100644
--- a/src/core/client/stream/test/__snapshots__/permalinkViewAssetNotFound.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/permalinkViewAssetNotFound.spec.tsx.snap
@@ -5,7 +5,14 @@ exports[`renders permalink view with unknown asset 1`] = `
className="Flex-root App-root Flex-flex Flex-justifyCenter"
>
- Asset not found
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (6:6)
+5: ) {
+6: me(clientAuthRevision: $authRevision) {
+ ^
+7: ...PermalinkViewContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap
index 931557b1a..39cd1503f 100644
--- a/src/core/client/stream/test/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/permalinkViewCommentNotFound.spec.tsx.snap
@@ -4,30 +4,15 @@ exports[`renders permalink view with unknown comment 1`] = `
-
-
-
- Comment not found
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (6:6)
+5: ) {
+6: me(clientAuthRevision: $authRevision) {
+ ^
+7: ...PermalinkViewContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap
index dacf75add..97fd167f7 100644
--- a/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/postComment.spec.tsx.snap
@@ -718,301 +718,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
-
- Signed in as
-
- Markus
-
- .
-
-
-
- Not you?
-
-
- Sign Out
-
-
-
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/postReply.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/postReply.spec.tsx.snap
index 63360eccb..a7fce87a7 100644
--- a/src/core/client/stream/test/__snapshots__/postReply.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/postReply.spec.tsx.snap
@@ -1279,301 +1279,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
-
- Signed in as
-
- Markus
-
- .
-
-
-
- Not you?
-
-
- Sign Out
-
-
-
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/renderReplies.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/renderReplies.spec.tsx.snap
index bc69ca2ca..dbdc4fd2e 100644
--- a/src/core/client/stream/test/__snapshots__/renderReplies.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/renderReplies.spec.tsx.snap
@@ -4,374 +4,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
- Sign in
-
-
- Register
-
-
-
-
-
-
-
-
-
- format_bold
-
-
-
-
- format_italic
-
-
-
-
- format_quote
-
-
-
-
- Post a comment
-
-
-
-
-
-
- Sign in and join the conversation
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/renderStream.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/renderStream.spec.tsx.snap
index befacc4ef..dbdc4fd2e 100644
--- a/src/core/client/stream/test/__snapshots__/renderStream.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/renderStream.spec.tsx.snap
@@ -4,262 +4,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
- Sign in
-
-
- Register
-
-
-
-
-
-
-
-
-
- format_bold
-
-
-
-
- format_italic
-
-
-
-
- format_quote
-
-
-
-
- Post a comment
-
-
-
-
-
-
- Sign in and join the conversation
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/stream/test/__snapshots__/showAllReplies.spec.tsx.snap b/src/core/client/stream/test/__snapshots__/showAllReplies.spec.tsx.snap
index d8a24d800..4bfa26a4a 100644
--- a/src/core/client/stream/test/__snapshots__/showAllReplies.spec.tsx.snap
+++ b/src/core/client/stream/test/__snapshots__/showAllReplies.spec.tsx.snap
@@ -4,284 +4,15 @@ exports[`renders comment stream 1`] = `
-
-
-
-
- Sign in
-
-
- Register
-
-
-
-
-
-
-
-
-
- format_bold
-
-
-
-
- format_italic
-
-
-
-
- format_quote
-
-
-
-
- Post a comment
-
-
-
-
-
-
- Sign in and join the conversation
-
-
-
-
+
+ Unknown argument "clientAuthRevision" on field "me" of type "Query".
+
+GraphQL request (5:6)
+4: ) {
+5: me(clientAuthRevision: $authRevision) {
+ ^
+6: ...StreamContainer_me
+
`;
diff --git a/src/core/client/ui/components/ValidationMessage/ValidationMessage.css b/src/core/client/ui/components/Message/Message.css
similarity index 75%
rename from src/core/client/ui/components/ValidationMessage/ValidationMessage.css
rename to src/core/client/ui/components/Message/Message.css
index b3d6a6290..5811ad377 100644
--- a/src/core/client/ui/components/ValidationMessage/ValidationMessage.css
+++ b/src/core/client/ui/components/Message/Message.css
@@ -7,8 +7,15 @@
padding: calc(0.5 * var(--spacing-unit)) var(--spacing-unit);
box-sizing: border-box;
border-radius: var(--round-corners);
+ border-width: 1px;
+ border-style: solid;
border-left-width: calc(0.5 * var(--spacing-unit));
- border-left-style: solid;
+}
+
+.colorGrey {
+ background-color: var(--palette-common-white);
+ border-color: var(--palette-grey-main);
+ color: var(--palette-grey-main);
}
.colorError {
@@ -21,7 +28,3 @@
display: flex;
width: 100%;
}
-
-.icon {
- margin-right: var(--spacing-unit);
-}
diff --git a/src/core/client/ui/components/Message/Message.mdx b/src/core/client/ui/components/Message/Message.mdx
new file mode 100644
index 000000000..828d18036
--- /dev/null
+++ b/src/core/client/ui/components/Message/Message.mdx
@@ -0,0 +1,28 @@
+---
+name: Message
+menu: UI Kit
+---
+
+import { Playground } from 'docz'
+import Message from './Message'
+import MessageIcon from './MessageIcon'
+import HorizontalGutter from '../HorizontalGutter'
+
+# Message
+
+## Basic Use
+
+
+ This is a message
+ Contrary to popular belief, Lorem Ipsum is not simply random text.
+
+
+
+## Usage with icon
+
+
+ alarm Edit: 1 min 23 secs Remaining
+
+
+
+
diff --git a/src/core/client/ui/components/Message/Message.spec.tsx b/src/core/client/ui/components/Message/Message.spec.tsx
new file mode 100644
index 000000000..ac69cea85
--- /dev/null
+++ b/src/core/client/ui/components/Message/Message.spec.tsx
@@ -0,0 +1,25 @@
+import React from "react";
+import TestRenderer from "react-test-renderer";
+
+import { PropTypesOf } from "talk-ui/types";
+
+import Message from "./Message";
+import MessageIcon from "./MessageIcon";
+
+it("renders correctly", () => {
+ const props: PropTypesOf
= {
+ className: "custom",
+ children: "Hello World",
+ };
+ const renderer = TestRenderer.create( );
+ expect(renderer.toJSON()).toMatchSnapshot();
+});
+
+it("renders icon", () => {
+ const renderer = TestRenderer.create(
+
+ alert Alert Message
+
+ );
+ expect(renderer.toJSON()).toMatchSnapshot();
+});
diff --git a/src/core/client/ui/components/Message/Message.tsx b/src/core/client/ui/components/Message/Message.tsx
new file mode 100644
index 000000000..7547d8442
--- /dev/null
+++ b/src/core/client/ui/components/Message/Message.tsx
@@ -0,0 +1,55 @@
+import cn from "classnames";
+import React, { ReactNode, StatelessComponent } from "react";
+import { withStyles } from "talk-ui/hocs";
+import * as styles from "./Message.css";
+
+export interface MessageProps {
+ /**
+ * The content of the component.
+ */
+ children: ReactNode;
+ /**
+ * Convenient prop to override the root styling.
+ */
+ className?: string;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes: typeof styles;
+ /*
+ * If set renders a full width message
+ */
+ fullWidth?: boolean;
+ /*
+ * Name of color, "grey" stays by default - common gray one
+ */
+ color?: "error" | "grey";
+}
+
+const Message: StatelessComponent = props => {
+ const { className, classes, fullWidth, children, color, ...rest } = props;
+
+ const rootClassName = cn(
+ classes.root,
+ {
+ [classes.colorGrey]: color === "grey",
+ [classes.colorError]: color === "error",
+ [classes.fullWidth]: fullWidth,
+ },
+ className
+ );
+
+ return (
+
+ {children}
+
+ );
+};
+
+Message.defaultProps = {
+ color: "grey",
+ fullWidth: false,
+};
+
+const enhanced = withStyles(styles)(Message);
+export default enhanced;
diff --git a/src/core/client/ui/components/Message/MessageIcon.css b/src/core/client/ui/components/Message/MessageIcon.css
new file mode 100644
index 000000000..df730b2de
--- /dev/null
+++ b/src/core/client/ui/components/Message/MessageIcon.css
@@ -0,0 +1,5 @@
+.root {
+ &:first-child {
+ margin-right: calc(0.5 * var(--spacing-unit));
+ }
+}
diff --git a/src/core/client/ui/components/Message/MessageIcon.tsx b/src/core/client/ui/components/Message/MessageIcon.tsx
new file mode 100644
index 000000000..cd4d0ad13
--- /dev/null
+++ b/src/core/client/ui/components/Message/MessageIcon.tsx
@@ -0,0 +1,36 @@
+import cn from "classnames";
+import React, { HTMLAttributes, Ref, StatelessComponent } from "react";
+
+import Icon, { IconProps } from "talk-ui/components/Icon";
+import { withForwardRef, withStyles } from "talk-ui/hocs";
+
+import * as styles from "./MessageIcon.css";
+
+interface InnerProps extends HTMLAttributes {
+ /**
+ * This prop can be used to add custom classnames.
+ * It is handled by the `withStyles `HOC.
+ */
+ classes: typeof styles & IconProps["classes"];
+
+ size?: IconProps["size"];
+
+ /** The name of the icon to render */
+ children: string;
+
+ /** Internal: Forwarded Ref */
+ forwardRef?: Ref;
+}
+
+export const MessageIcon: StatelessComponent = props => {
+ const { classes, className, forwardRef, ...rest } = props;
+ const rootClassName = cn(classes.root, className);
+ return ;
+};
+
+MessageIcon.defaultProps = {
+ size: "sm",
+};
+
+const enhanced = withForwardRef(withStyles(styles)(MessageIcon));
+export default enhanced;
diff --git a/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap b/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap
new file mode 100644
index 000000000..38381f0c6
--- /dev/null
+++ b/src/core/client/ui/components/Message/__snapshots__/Message.spec.tsx.snap
@@ -0,0 +1,23 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`renders correctly 1`] = `
+
+ Hello World
+
+`;
+
+exports[`renders icon 1`] = `
+
+
+ alert
+
+ Alert Message
+
+`;
diff --git a/src/core/client/ui/components/Message/index.ts b/src/core/client/ui/components/Message/index.ts
new file mode 100644
index 000000000..a6d22dd86
--- /dev/null
+++ b/src/core/client/ui/components/Message/index.ts
@@ -0,0 +1 @@
+export { default } from "./Message";
diff --git a/src/core/client/ui/components/ValidationMessage/ValidationMessage.mdx b/src/core/client/ui/components/ValidationMessage/ValidationMessage.mdx
index c8e7b11ad..28bbec5a6 100644
--- a/src/core/client/ui/components/ValidationMessage/ValidationMessage.mdx
+++ b/src/core/client/ui/components/ValidationMessage/ValidationMessage.mdx
@@ -4,7 +4,7 @@ menu: UI Kit
---
import { Playground } from 'docz'
-import ValidationMessage from './ValidationMessage.tsx'
+import ValidationMessage from './ValidationMessage'
import HorizontalGutter from '../HorizontalGutter'
# ValidationMessage
diff --git a/src/core/client/ui/components/ValidationMessage/ValidationMessage.tsx b/src/core/client/ui/components/ValidationMessage/ValidationMessage.tsx
index 0cc781560..8d1343f8b 100644
--- a/src/core/client/ui/components/ValidationMessage/ValidationMessage.tsx
+++ b/src/core/client/ui/components/ValidationMessage/ValidationMessage.tsx
@@ -1,10 +1,6 @@
-import cn from "classnames";
import React, { ReactNode, StatelessComponent } from "react";
-
-import { withStyles } from "talk-ui/hocs";
-
-import Icon from "../Icon";
-import * as styles from "./ValidationMessage.css";
+import Message from "../Message";
+import MessageIcon from "../Message/MessageIcon";
export interface ValidationMessageProps {
/**
@@ -16,34 +12,24 @@ export interface ValidationMessageProps {
*/
className?: string;
/**
- * Override or extend the styles applied to the component.
+ * If set renders a full width message
*/
- classes: typeof styles;
- /*
- * If set renders a full width message
- */
fullWidth?: boolean;
}
const ValidationMessage: StatelessComponent = props => {
- const { className, classes, fullWidth, children, ...rest } = props;
-
- const rootClassName = cn(
- classes.root,
- classes.colorError,
- {
- [classes.fullWidth]: fullWidth,
- },
- className
- );
+ const { className, fullWidth, children, ...rest } = props;
return (
-
-
- warning
-
+
+ warning
{children}
-
+
);
};
@@ -51,5 +37,4 @@ ValidationMessage.defaultProps = {
fullWidth: false,
};
-const enhanced = withStyles(styles)(ValidationMessage);
-export default enhanced;
+export default ValidationMessage;
diff --git a/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap b/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap
index 7f03e37e0..c0e1861bb 100644
--- a/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap
+++ b/src/core/client/ui/components/ValidationMessage/__snapshots__/ValidationMessage.spec.tsx.snap
@@ -2,11 +2,11 @@
exports[`renders correctly 1`] = `
warning
diff --git a/src/core/client/ui/components/index.ts b/src/core/client/ui/components/index.ts
index 28a3f5c36..78261d408 100644
--- a/src/core/client/ui/components/index.ts
+++ b/src/core/client/ui/components/index.ts
@@ -20,4 +20,5 @@ export { default as Spinner } from "./Spinner";
export { default as HorizontalGutter } from "./HorizontalGutter";
export { default as Icon } from "./Icon";
export { default as AriaInfo } from "./AriaInfo";
+export { default as Message } from "./Message";
export { Tab, TabBar, TabContent, TabPane } from "./Tabs";