@mooretodd/survey
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -5,6 +5,7 @@ import React from 'react'; | ||
import styles from './styles.css'; | ||
import R from 'ramda'; | ||
const Description = React.createClass({ | ||
render() { | ||
const {label, rating} = this.props; | ||
const {label, rating, total} = this.props; | ||
return ( | ||
@@ -15,3 +16,5 @@ <tr key={uuid.v4()}> | ||
</td> | ||
<td className={styles.responses}>{rating.count}</td> | ||
<td className={styles.responses}> | ||
{`${Math.floor(R.multiply(100, R.divide(rating.count, total)))}%`} | ||
</td> | ||
<td className={styles.rating}> | ||
@@ -18,0 +21,0 @@ <Rating |
{ | ||
"name": "@mooretodd/survey", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,2 +7,3 @@ import React from 'react'; | ||
import classNames from 'classnames/bind'; | ||
import spinner from './spinner.css'; | ||
@@ -48,2 +49,3 @@ import Theme from './../theme/Theme.react.js'; | ||
<Theme | ||
total={this.props.participant_count} | ||
key={uuid.v4()} | ||
@@ -59,4 +61,3 @@ title={theme} | ||
const surveyClasses = cx({ | ||
survey: true, | ||
loading: loading | ||
survey: true | ||
}); | ||
@@ -67,8 +68,26 @@ | ||
<div> | ||
<div>{this.props.name}</div> | ||
<header> | ||
<h2 className={styles.surveyTitle}>{this.props.name}</h2> | ||
<aside className={styles.participants}> | ||
<dl> | ||
<dt>Participants</dt> | ||
<dd>{this.props.participant_count}</dd> | ||
</dl> | ||
</aside> | ||
</header> | ||
<div> | ||
<Heading>Themes</Heading> | ||
<ul> | ||
{themes.map(this.renderTheme)} | ||
</ul> | ||
{loading ? | ||
<div className={spinner.spinner}> | ||
<div className={spinner.rect1}></div> | ||
<div className={spinner.rect2}></div> | ||
<div className={spinner.rect3}></div> | ||
<div className={spinner.rect4}></div> | ||
<div className={spinner.rect5}></div> | ||
</div> : | ||
<ul> | ||
{themes.map(this.renderTheme)} | ||
</ul> | ||
} | ||
</div> | ||
@@ -75,0 +94,0 @@ </div> |
@@ -29,2 +29,3 @@ import React from 'react'; | ||
return (<Description | ||
total={this.props.total} | ||
key={uuid.v4()} | ||
@@ -43,10 +44,10 @@ label={label} | ||
<thead> | ||
<tr> | ||
<th>Question</th> | ||
<th>Responses</th> | ||
<th>Rating</th> | ||
</tr> | ||
<tr> | ||
<th>Question</th> | ||
<th>Engagement</th> | ||
<th>Rating</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{descriptions.map(this.renderDescription)} | ||
{descriptions.map(this.renderDescription)} | ||
</tbody> | ||
@@ -53,0 +54,0 @@ <caption className={styles.caption}> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12059
11
399