From d3d7045227c502b45924234f63347704742cf4b7 Mon Sep 17 00:00:00 2001 From: Benjamin Goering Date: Wed, 5 Apr 2017 16:39:48 -0700 Subject: [PATCH] IgnoreUserWizard steps and proper chevron --- client/coral-embed-stream/src/Comment.css | 27 ++++++++++++- client/coral-embed-stream/src/Comment.js | 48 +++++++++++++++++++---- 2 files changed, 67 insertions(+), 8 deletions(-) diff --git a/client/coral-embed-stream/src/Comment.css b/client/coral-embed-stream/src/Comment.css index 1e75887f2..a1f7b8654 100644 --- a/client/coral-embed-stream/src/Comment.css +++ b/client/coral-embed-stream/src/Comment.css @@ -54,4 +54,29 @@ .IgnoreUserWizard header { font-weight: bold; -} \ No newline at end of file +} + +.IgnoreUserWizard .textAlignRight { + text-align: right; +} + +/** + * Up/Down Chevrons for the top right menu + */ +.chevron { +} +.chevron:before { + content: '⌃'; + display: inline-block; + position: relative; + top: 0.25em; +} + +/* Down Arrow */ +.chevron.down:before { + display: inline-block; + position: relative; + transform: rotate(180deg); + top: 0; + /*top: -0.25em;*/ +} diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 59d82c5ab..26ff01f0f 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -23,6 +23,7 @@ import LoadMore from 'coral-embed-stream/src/LoadMore'; import {Slot} from 'coral-framework'; import styles from './Comment.css'; +import classnames from 'classnames'; const getActionSummary = (type, comment) => comment.action_summaries .filter((a) => a.__typename === type)[0]; @@ -154,23 +155,56 @@ class Comment extends React.Component { } constructor(props) { super(props); - this.state = {}; + this.state = { + + // what step of the wizard is the user on + step: 1 + }; this.onClickCancel = this.onClickCancel.bind(this); } onClickCancel() { this.props.cancel(); } render() { - return ( -
+ const {user} = this.props; + const goToStep = (stepNum) => this.setState({step: stepNum}); + const step1 = ( +
Ignore User

When you ignore a user, all comments they wrote on the site will be hidden from you. You can undo this later from the Profile tab.

-
+
- +
); + const step2Confirmation = ( +
+
Ignore User
+

Are you sure you want to ignore { user.name }?

+
+ + +
+
+ ); + const step3Confirmed = ( +
+
User Ignored
+

You will no longer see comments from { user.name }. You can undo this later from the Profile tab

+
+ +
+
+ ); + const elsForStep = [step1, step2Confirmation, step3Confirmed]; + const {step} = this.state; + const elForThisStep = elsForStep[step - 1]; + return ( +
+ { elForThisStep } +
+ ); } } @@ -357,8 +391,8 @@ class Comment extends React.Component { } // TODO (bengo): use arrows that match designs, probably with css borders http://stackoverflow.com/questions/15938933/creating-a-chevron-in-css -const upArrow = String.fromCharCode(0x25B2); -const downArrow = String.fromCharCode(0x25BC); +const upArrow = ; +const downArrow = ; class Toggleable extends React.Component { constructor(props) { super(props);