forked from Splyse/NeoLink
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add success page and checkbox component * Finish CreateWalletSuccessPage * Add PropTypes validation * Fix typo in tooltip prop type validation * Passing tests * remove temporary routes * Add history proptype * add aria and role to checkbox * Remove constructor in checkbox and success page
- Loading branch information
1 parent
8e8f407
commit 40fe780
Showing
20 changed files
with
435 additions
and
32 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,28 @@ | ||
.toolTip { | ||
position: relative; | ||
display: inline-block; | ||
width: 30px; | ||
cursor: pointer; | ||
} | ||
|
||
.toolTipImage { | ||
width: 15px; | ||
height: 15px; | ||
} | ||
|
||
.toolTipText { | ||
visibility: hidden; | ||
background-color: #f5f5f5; | ||
box-shadow: 5px 5px 9px rgba(63, 130, 46, 0.4); | ||
color: #585858; | ||
text-align: center; | ||
padding: 5px 0; | ||
border-radius: 3px; | ||
position: absolute; | ||
z-index: 1; | ||
padding: 10px; | ||
} | ||
|
||
.toolTip:hover .toolTipText { | ||
visibility: visible; | ||
} |
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,20 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import style from './ToolTip.css' | ||
|
||
const ToolTip = ({ icon, toolTipText, toolTipTextClassNames, classNames }) => ( | ||
<div className={ `${style.toolTip} ${classNames}` }> | ||
<img src={ icon } alt='tooltip' className={ style.toolTipImage } /> | ||
<span className={ `${style.toolTipText} ${toolTipTextClassNames}` }>{toolTipText}</span> | ||
</div> | ||
) | ||
|
||
ToolTip.propTypes = { | ||
icon: PropTypes.string.isRequired, | ||
toolTipText: PropTypes.string.isRequired, | ||
toolTipTextClassNames: PropTypes.string, | ||
classNames: PropTypes.string, | ||
} | ||
|
||
export default ToolTip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.checkBox { | ||
border: none; | ||
height: 15px; | ||
width: 15px; | ||
border-radius: 3px; | ||
margin-right: 5px; | ||
position: relative; | ||
cursor: pointer; | ||
} | ||
|
||
.checkBox svg { | ||
position: absolute; | ||
top: 12%; | ||
left: 16%; | ||
height: 12px; | ||
width: 12px; | ||
pointer-events: none; | ||
color: #36b049; | ||
} | ||
|
||
.checkBoxLabel { | ||
width: 100%; | ||
font-size: 0.8rem; | ||
} |
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,56 @@ | ||
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import Label from '../Label' | ||
|
||
import style from './CheckBox.css' | ||
|
||
class CheckBox extends Component { | ||
state = { | ||
checked: false, | ||
} | ||
|
||
handleClick = e => { | ||
e.stopPropagation() | ||
this.setState(prevState => ({ checked: !prevState.checked })) | ||
this.props.onClickHandler() | ||
} | ||
|
||
render() { | ||
const { label } = this.props | ||
const { checked } = this.state | ||
const checkMark = checked ? ( | ||
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'> | ||
<path | ||
fill='#585858' | ||
d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z' | ||
/> | ||
</svg> | ||
) : ( | ||
'' | ||
) | ||
|
||
const button = ( | ||
<button className={ style.checkBox } onClick={ this.handleClick } role={ 'checkbox' } aria-checked={ checked }> | ||
{checkMark} | ||
</button> | ||
) | ||
|
||
if (label) { | ||
return ( | ||
<Label labelText={ label } classNames={ style.checkBoxLabel } reversed> | ||
{button} | ||
</Label> | ||
) | ||
} | ||
|
||
return button | ||
} | ||
} | ||
|
||
CheckBox.propTypes = { | ||
onClickHandler: PropTypes.func.isRequired, | ||
label: PropTypes.string, | ||
} | ||
|
||
export default CheckBox |
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
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,28 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
const Label = ({ classNames, labelText, children, reversed }) => { | ||
if (reversed) { | ||
return ( | ||
<label className={ classNames }> | ||
{children} | ||
{labelText} | ||
</label> | ||
) | ||
} | ||
return ( | ||
<label className={ classNames }> | ||
{labelText} | ||
{children} | ||
</label> | ||
) | ||
} | ||
|
||
Label.propTypes = { | ||
classNames: PropTypes.string, | ||
labelText: PropTypes.string, | ||
children: PropTypes.node, | ||
reversed: PropTypes.bool, | ||
} | ||
|
||
export default Label |
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,22 @@ | ||
.textArea { | ||
background-color: #f5f5f5; | ||
border-radius: 3px; | ||
border: none; | ||
min-height: 50px; | ||
margin-bottom: 20px; | ||
font-size: 0.9rem; | ||
padding: 8px; | ||
} | ||
|
||
.textFieldLabelStyles { | ||
margin-top: 8px; | ||
} | ||
|
||
.textAreaLabel { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
color: #585858; | ||
font-size: 0.9rem; | ||
position: relative; | ||
} |
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,50 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import Label from '../Label' | ||
|
||
import style from './TextArea.css' | ||
|
||
const TextArea = ({ classNames, value, disabled, label, labelClassNames = '', children }) => { | ||
const textFieldLabelStyles = label ? style.textFieldLabelStyles : '' | ||
|
||
let textArea | ||
if (disabled) { | ||
textArea = ( | ||
<textarea | ||
className={ `${style.textArea} ${textFieldLabelStyles} ${classNames} ${style.textAreaDisabled}` } | ||
disabled | ||
value={ value } | ||
/> | ||
) | ||
} else { | ||
textArea = ( | ||
<textarea | ||
className={ `${style.textArea} ${textFieldLabelStyles} ${classNames} ${style.textAreaDisabled}` } | ||
value={ value } | ||
/> | ||
) | ||
} | ||
|
||
if (label) { | ||
return ( | ||
<Label classNames={ `${style.textAreaLabel} ${labelClassNames}` } labelText={ label }> | ||
{textArea} | ||
{children} | ||
</Label> | ||
) | ||
} | ||
|
||
return textArea | ||
} | ||
|
||
TextArea.propTypes = { | ||
classNames: PropTypes.string, | ||
value: PropTypes.string.isRequired, | ||
disabled: PropTypes.bool, | ||
label: PropTypes.string, | ||
labelClassNames: PropTypes.string, | ||
children: PropTypes.node, | ||
} | ||
|
||
export default TextArea |
Oops, something went wrong.