From 05605d6d50f44781de6545a7c85c74bf3c5ceba1 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 19 Jul 2018 19:47:01 -0300 Subject: [PATCH] Implement new button api --- .../stream/components/PostCommentForm.tsx | 2 +- .../client/stream/components/ReplyList.tsx | 3 +- src/core/client/stream/components/Stream.tsx | 3 +- .../__snapshots__/ReplyList.spec.tsx.snap | 6 +- .../__snapshots__/Stream.spec.tsx.snap | 6 +- .../test/__snapshots__/loadMore.spec.tsx.snap | 24 +- .../__snapshots__/renderReplies.spec.tsx.snap | 12 +- .../__snapshots__/renderStream.spec.tsx.snap | 10 +- .../showAllReplies.spec.tsx.snap | 22 +- .../ui/components/BaseButton/BaseButton.tsx | 3 - .../client/ui/components/Button/Button.css | 275 ++++++++++++++---- .../client/ui/components/Button/Button.mdx | 71 +++-- .../ui/components/Button/Button.spec.tsx | 49 ++++ .../client/ui/components/Button/Button.tsx | 49 ++-- .../Button/__snapshots__/Button.spec.tsx.snap | 43 +++ src/core/client/ui/components/Button/index.ts | 3 +- src/core/client/ui/components/Flex/Flex.tsx | 4 + .../Flex/__snapshots__/Flex.spec.tsx.snap | 8 +- src/core/client/ui/shared/typography.css | 10 + src/core/client/ui/theme/variables.ts | 15 +- 20 files changed, 452 insertions(+), 166 deletions(-) create mode 100644 src/core/client/ui/components/Button/Button.spec.tsx create mode 100644 src/core/client/ui/components/Button/__snapshots__/Button.spec.tsx.snap diff --git a/src/core/client/stream/components/PostCommentForm.tsx b/src/core/client/stream/components/PostCommentForm.tsx index 09db70e39..a05afb73a 100644 --- a/src/core/client/stream/components/PostCommentForm.tsx +++ b/src/core/client/stream/components/PostCommentForm.tsx @@ -41,7 +41,7 @@ const PostCommentForm: StatelessComponent = props => (
- diff --git a/src/core/client/stream/components/ReplyList.tsx b/src/core/client/stream/components/ReplyList.tsx index 17ad32ed2..6f4380769 100644 --- a/src/core/client/stream/components/ReplyList.tsx +++ b/src/core/client/stream/components/ReplyList.tsx @@ -34,8 +34,7 @@ const ReplyList: StatelessComponent = props => { aria-controls={`talk-comments-replyList-log--${props.commentID}`} onClick={props.onShowAll} disabled={props.disableShowAll} - secondary - invert + variant="outlined" fullWidth > Show All Replies diff --git a/src/core/client/stream/components/Stream.tsx b/src/core/client/stream/components/Stream.tsx index da55050f5..9dbb21c5b 100644 --- a/src/core/client/stream/components/Stream.tsx +++ b/src/core/client/stream/components/Stream.tsx @@ -42,8 +42,7 @@ const Stream: StatelessComponent = props => { + + + + + - - - - - - - - - - - - - - - -## Button with Icon - - - - + +## Filled Button + + + + + + + + + + + + + +## Outlined Button + + + + + + + + + + + + + + +## Ghost Button + + + + + + + + + + + + + diff --git a/src/core/client/ui/components/Button/Button.spec.tsx b/src/core/client/ui/components/Button/Button.spec.tsx new file mode 100644 index 000000000..da00c72e2 --- /dev/null +++ b/src/core/client/ui/components/Button/Button.spec.tsx @@ -0,0 +1,49 @@ +import React from "react"; +import ShallowRenderer from "react-test-renderer/shallow"; + +import { PropTypesOf } from "talk-framework/types"; + +import { Button } from "./Button"; + +it("renders correctly", () => { + const props: PropTypesOf = { + classes: { + mouseHover: "mouseHover", + keyboardFocus: "keyboardFocus", + } as any, + children: "Push me", + }; + const renderer = ShallowRenderer.createRenderer(); + renderer.render(