Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: storybook related improvements #93

Draft
wants to merge 9 commits into
base: edge-civictechto
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,4 @@ Comment.propTypes = {
currentItem: PropTypes.bool
}

export default connect((state) => {
return {
conversation: state.zid_metadata.zid_metadata
}
})(Comment)
export default connect((state) => ({ conversation: state.zid_metadata.zid_metadata }))(Comment)
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,4 @@ ModerateCommentsAccepted.propTypes = {
accepted_comments: PropTypes.arrayOf(PropTypes.object)
}

const mapStateToProps = (state) => ({
dispatch: state.mod_comments_accepted.dispatch,
accepted_comments: state.mod_comments_accepted.accepted_comments,
});
export default connect(mapStateToProps)(ModerateCommentsAccepted)
export default connect((state) => state.mod_comments_accepted)(ModerateCommentsAccepted)
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,5 @@ ModerateCommentsRejected.propTypes = {
dispatch: PropTypes.func,
rejected_comments: PropTypes.arrayOf(PropTypes.object)
}
const mapStateToProps = (state) => ({
dispatch: state.mod_comments_rejected.dispatch,
rejected_comments: state.mod_comments_rejected.rejected_comments,
});
export default connect(mapStateToProps)(ModerateCommentsRejected)

export default connect((state) => state.mod_comments_rejected)(ModerateCommentsRejected)
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,4 @@ ModerateCommentsTodo.propTypes = {
unmoderated_comments: PropTypes.arrayOf(PropTypes.object)
}

const mapStateToProps = (state) => ({
dispatch: state.mod_comments_unmoderated.dispatch,
unmoderated_comments: state.mod_comments_unmoderated.unmoderated_comments,
});

export default connect(mapStateToProps)(ModerateCommentsTodo)
export default connect((state) => state.mod_comments_unmoderated)(ModerateCommentsTodo)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
}

@connect((state) => state.seed_comments_tweet)
@Radium
class ModerateCommentsSeed extends React.Component {
constructor(props) {
super(props)
Expand Down Expand Up @@ -134,6 +133,7 @@
})
}

ModerateCommentsSeed = Radium(ModerateCommentsSeed)

Check failure on line 136 in client-admin/src/components/conversation-admin/seed-tweet.js

View workflow job for this annotation

GitHub Actions / eslint

'ModerateCommentsSeed' is a class
export default ModerateCommentsSeed

/*
Expand Down
3 changes: 2 additions & 1 deletion client-admin/src/components/landers/createuser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const fbAppId = process.env.FB_APP_ID

@connect((state) => state.signin)
// @connect((state) => state.signin)
class Createuser extends React.Component {
getDest() {
return this.props.location.pathname.slice('/createuser'.length)
Expand Down Expand Up @@ -224,5 +224,6 @@
)
}
}
Createuser = connect((state) => state.signin)(Createuser)

Check failure on line 227 in client-admin/src/components/landers/createuser.js

View workflow job for this annotation

GitHub Actions / eslint

'Createuser' is a class

export default Createuser
4 changes: 2 additions & 2 deletions client-admin/src/components/landers/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const fbAppId = process.env.FB_APP_ID

@connect((state) => state.signin)
//@connect((state) => state.signin)

Check failure on line 15 in client-admin/src/components/landers/signin.js

View workflow job for this annotation

GitHub Actions / eslint

Expected space or tab after '//' in comment
class SignIn extends React.Component {
// eslint-disable-next-line node/handle-callback-err
static getDerivedStateFromError(error) {
Expand Down Expand Up @@ -186,5 +186,5 @@
)
}
}

SignIn = connect((state) => state.signin)(SignIn)

Check failure on line 189 in client-admin/src/components/landers/signin.js

View workflow job for this annotation

GitHub Actions / eslint

'SignIn' is a class
export default SignIn
3 changes: 2 additions & 1 deletion client-admin/src/components/landers/signout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { doSignout } from '../../actions'

@connect((state) => state.signout)
// @connect((state) => state.signout)
class SignOut extends React.Component {
componentDidMount() {
this.props.dispatch(doSignout('/home'))
Expand All @@ -29,4 +29,5 @@
dispatch: PropTypes.func
}

SignOut = connect((state) => state.signout)(SignOut)

Check failure on line 32 in client-admin/src/components/landers/signout.js

View workflow job for this annotation

GitHub Actions / eslint

'SignOut' is a class
export default SignOut
4 changes: 2 additions & 2 deletions client-participation/vis2/components/curate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from "lodash";
import React from "react";
import * as globals from "./globals";

class Button extends React.Component {
export class Button extends React.Component {

handleClick() {
this.props.handleCurateButtonClick(this.props.identifier)
Expand All @@ -29,7 +29,7 @@ class Button extends React.Component {
}
}

class Curate extends React.Component {
export class Curate extends React.Component {

constructor(props) {
super(props);
Expand Down
4 changes: 2 additions & 2 deletions client-participation/vis2/components/exploreTid.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import BarChart from "./barChart";
const checkmark = "M1299 813l-422 422q-19 19-45 19t-45-19l-294-294q-19-19-19-45t19-45l102-102q19-19 45-19t45 19l147 147 275-275q19-19 45-19t45 19l102 102q19 19 19 45t-19 45zm141 83q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z";
const ban = "M1440 893q0-161-87-295l-754 753q137 89 297 89 111 0 211.5-43.5t173.5-116.5 116-174.5 43-212.5zm-999 299l755-754q-135-91-300-91-148 0-273 73t-198 199-73 274q0 162 89 299zm1223-299q0 157-61 300t-163.5 246-245 164-298.5 61-298.5-61-245-164-163.5-246-61-300 61-299.5 163.5-245.5 245-164 298.5-61 298.5 61 245 164 163.5 245.5 61 299.5z";

const DataSentence = ({ math, selectedTidCuration, selectedComment, repfulFor, Strings }) => {
export const DataSentence = ({math, selectedTidCuration, selectedComment, repfulFor, Strings}) => {

let markup = null;

Expand Down Expand Up @@ -93,7 +93,7 @@ const DataSentence = ({ math, selectedTidCuration, selectedComment, repfulFor, S
return markup;
}

class ExploreTid extends React.Component {
export class ExploreTid extends React.Component {

handleAgree() {
this.props.onVoteClicked({
Expand Down
4 changes: 2 additions & 2 deletions client-participation/vis2/components/graphComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as globals from "./globals";

/* https://bl.ocks.org/mbostock/2206590 */

class GraphComment extends React.Component {
export class GraphComment extends React.Component {
getRectX() {
let x = -7;

Expand Down Expand Up @@ -54,7 +54,7 @@ class GraphComment extends React.Component {
}
}

class GraphComments extends React.Component {
export class GraphComments extends React.Component {

drawComments() {
let shouldShowOnlyOneGroup = _.isNumber(this.props.showOnlyGroup);
Expand Down
4 changes: 2 additions & 2 deletions client-participation/vis2/components/graphParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import _ from "lodash";
import * as globals from "./globals";
import {VictoryAnimation} from "victory-core";

const Participant = ({ptpt, tweenX, tweenY}) => {
export const Participant = ({ptpt, tweenX, tweenY}) => {
let picSize = ptpt.picture_size;
return (
<g
Expand Down Expand Up @@ -33,7 +33,7 @@ const Participant = ({ptpt, tweenX, tweenY}) => {
);
}

const Bucket = ({pt}) => {
export const Bucket = ({pt}) => {
return <circle
r={0}
fill={/* globals.groupColor(pt.gid)*/ "rgb(180,180,180)"}
Expand Down
4 changes: 2 additions & 2 deletions client-participation/vis2/components/hull.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as globals from "./globals";
import {VictoryAnimation} from "victory-core";
import * as d3 from "../../js/3rdparty/d3.v4.min.js";

class Hull extends React.Component {
export class Hull extends React.Component {
render () {
return (
<g>
Expand All @@ -19,7 +19,7 @@ class Hull extends React.Component {
}
};

class Hulls extends React.Component {
export class Hulls extends React.Component {
render () {
const line = d3.line(); // .curve(d3.curveBasis);
return (
Expand Down
6 changes: 3 additions & 3 deletions client-participation/vis2/components/hullLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getBackgroundRectWidth = (ptptCount) => {
return width;
}

const Users = ({selectedGroup}) => {
export const Users = ({selectedGroup}) => {
return (
<g width={7} fill={selectedGroup ? "white" : "black"} transform={`translate(0,-9)`}>
<ellipse cx="1.99335548" cy="1.42348754" rx="1.32890365" ry="1.42348754"></ellipse>
Expand All @@ -24,7 +24,7 @@ const Users = ({selectedGroup}) => {
)
}

const Label = ({ptptCount, centroid, gid, selectedGroup, handleClick}) => {
export const Label = ({ptptCount, centroid, gid, selectedGroup, handleClick}) => {
return (
<g
transform={`translate(${centroid.x},${centroid.y})`}
Expand Down Expand Up @@ -63,7 +63,7 @@ const Label = ({ptptCount, centroid, gid, selectedGroup, handleClick}) => {
)
}

const HullLabels = ({groups, centroids, selectedGroup, handleClick}) => {
export const HullLabels = ({groups, centroids, selectedGroup, handleClick}) => {

if (!centroids || !groups) { return null }

Expand Down
4 changes: 2 additions & 2 deletions client-participation/vis2/components/tidCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import * as globals from "./globals";
import _ from "lodash";

class PaginateButton extends React.Component {
export class PaginateButton extends React.Component {

render() {
return (
Expand All @@ -27,7 +27,7 @@ class PaginateButton extends React.Component {
}


class TidCarousel extends React.Component {
export class TidCarousel extends React.Component {

constructor(props) {
super(props);
Expand Down
2 changes: 1 addition & 1 deletion client-participation/vis2/vis2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ReactDOM from 'react-dom';



class Root extends React.Component {
export class Root extends React.Component {
render() {

let comments = this.props.comments;
Expand Down
Loading
Loading