-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
source/js/buyers-guide/components/likelyhood-chart/likelyhood-chart.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// TODO: Inject likely % in .bar and .likelyhood-words | ||
|
||
import React from 'react'; | ||
|
||
export default class LikelyhoodChart extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = this.getInitialState(); | ||
|
||
} | ||
|
||
getInitialState() { | ||
return { | ||
}; | ||
} | ||
|
||
render(){ | ||
return ( | ||
<div> | ||
<table id="likelyhood-score"> | ||
<tbody> | ||
<tr className="likely"> | ||
<th> | ||
<span className="likely-label">Likely</span> | ||
</th> | ||
<td className="likelyhood"> | ||
<span className="bar" style={{width: '95%'}}></span> | ||
<span className="likelyhood-words">95% Likely to buy it</span> | ||
</td> | ||
</tr> | ||
<tr className="unlikely"> | ||
<th> | ||
<span className="likely-label">Not likely</span> | ||
</th> | ||
<td className="likelyhood"> | ||
<span className="bar" style={{width: '5%'}}></span> | ||
<span className="likelyhood-words">5% Not likely to buy it</span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
source/js/buyers-guide/components/likelyhood-chart/likelyhood-chart.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#likelyhood-score { | ||
tbody { | ||
width: 100%; | ||
} | ||
|
||
.bar { | ||
//For some nice animations later on, width set in JSX | ||
transition: width 2.5s ease; | ||
background-color: $light-gray; | ||
position: absolute; | ||
height: 25px; | ||
} | ||
|
||
tr { | ||
position: relative; | ||
display: block; | ||
} | ||
|
||
.likelyhood-words { | ||
position: relative; | ||
} | ||
|
||
.likely-label { | ||
//Make sure screen readers can see the label | ||
clip: rect(1px, 1px, 1px, 1px); | ||
position: absolute; | ||
} | ||
|
||
.likely th::before { | ||
content: '👍'; | ||
} | ||
|
||
.unlikely th::before { | ||
content: '👎'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters