From 3dc3e1435af0ab33e0b3055f2914cda915ae968e Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 24 Aug 2018 19:11:56 +0200 Subject: [PATCH] Use HorizontalGutter component, simplify Flex --- .../stream/components/Comment/Username.tsx | 2 +- .../stream/components/PermalinkView.tsx | 8 +-- .../stream/components/PostCommentForm.css | 2 - .../stream/components/PostCommentForm.tsx | 72 ++++++++++--------- .../client/stream/components/PoweredBy.tsx | 14 ++-- .../client/stream/components/ReplyList.tsx | 8 +-- src/core/client/stream/components/Stream.tsx | 22 +++--- .../components/UserBoxAuthenticated.tsx | 47 +++++------- .../components/UserBoxUnauthenticated.tsx | 4 +- src/core/client/stream/index.tsx | 4 +- .../client/ui/components/Button/Button.mdx | 8 +-- .../client/ui/components/CallOut/CallOut.mdx | 6 +- src/core/client/ui/components/Flex/Flex.css | 6 +- src/core/client/ui/components/Flex/Flex.tsx | 37 +++++++--- .../ui/components/FormField/FormField.tsx | 11 ++- .../HorizontalGutter/HorizontalGutter.css | 27 +++++++ .../HorizontalGutter/HorizontalGutter.mdx | 42 +++++++++++ .../HorizontalGutter/HorizontalGutter.tsx | 37 ++++++++++ .../ui/components/HorizontalGutter/index.ts | 1 + .../ui/components/InputLabel/InputLabel.mdx | 6 +- .../ui/components/TextField/TextField.mdx | 6 +- .../ui/components/ToggleShow/ToogleShow.mdx | 6 +- .../ui/components/Typography/Typography.mdx | 14 ++-- .../ui/components/Typography/Typography.tsx | 26 ++++--- .../ValidationMessage/ValidationMessage.mdx | 6 +- .../ValidationMessage/ValidationMessage.tsx | 5 +- src/core/client/ui/components/index.ts | 1 + src/locales/en-US/stream.ftl | 6 ++ 28 files changed, 286 insertions(+), 148 deletions(-) create mode 100644 src/core/client/ui/components/HorizontalGutter/HorizontalGutter.css create mode 100644 src/core/client/ui/components/HorizontalGutter/HorizontalGutter.mdx create mode 100644 src/core/client/ui/components/HorizontalGutter/HorizontalGutter.tsx create mode 100644 src/core/client/ui/components/HorizontalGutter/index.ts diff --git a/src/core/client/stream/components/Comment/Username.tsx b/src/core/client/stream/components/Comment/Username.tsx index f19c23024..728944ea2 100644 --- a/src/core/client/stream/components/Comment/Username.tsx +++ b/src/core/client/stream/components/Comment/Username.tsx @@ -16,7 +16,7 @@ const Username: StatelessComponent = props => { {props.children} diff --git a/src/core/client/stream/components/PermalinkView.tsx b/src/core/client/stream/components/PermalinkView.tsx index 4d3035b8d..362efa562 100644 --- a/src/core/client/stream/components/PermalinkView.tsx +++ b/src/core/client/stream/components/PermalinkView.tsx @@ -1,7 +1,7 @@ import { Localized } from "fluent-react/compat"; import React, { MouseEvent, StatelessComponent } from "react"; -import { Button, Flex, Typography } from "talk-ui/components"; +import { Button, Typography } from "talk-ui/components"; import CommentContainer from "../containers/CommentContainer"; import * as styles from "./PermalinkView.css"; @@ -41,11 +41,7 @@ const PermalinkView: StatelessComponent = ({ Comment not found )} - {comment && ( - - - - )} + {comment && } ); }; diff --git a/src/core/client/stream/components/PostCommentForm.css b/src/core/client/stream/components/PostCommentForm.css index 954a4de74..6c6c47b29 100644 --- a/src/core/client/stream/components/PostCommentForm.css +++ b/src/core/client/stream/components/PostCommentForm.css @@ -1,6 +1,5 @@ .root { width: 100%; - padding-bottom: var(--spacing-unit); } .textarea { @@ -9,7 +8,6 @@ height: 150px; width: 100%; box-sizing: border-box; - margin-bottom: var(--spacing-unit); padding: var(--spacing-unit); border-radius: var(--round-corners); resize: vertical; diff --git a/src/core/client/stream/components/PostCommentForm.tsx b/src/core/client/stream/components/PostCommentForm.tsx index 5493519f5..36e7d8be4 100644 --- a/src/core/client/stream/components/PostCommentForm.tsx +++ b/src/core/client/stream/components/PostCommentForm.tsx @@ -3,7 +3,7 @@ import React, { StatelessComponent } from "react"; import { Field, Form } from "react-final-form"; import { OnSubmit } from "talk-framework/lib/form"; import { required } from "talk-framework/lib/validation"; -import { Button, Typography } from "talk-ui/components"; +import { Button, Flex, HorizontalGutter, Typography } from "talk-ui/components"; import * as styles from "./PostCommentForm.css"; import PoweredBy from "./PoweredBy"; @@ -19,38 +19,44 @@ const PostCommentForm: StatelessComponent = props => (
{({ handleSubmit, submitting }) => ( - - {({ input, meta }) => ( -
-