aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/text-field
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-05-11 07:51:26 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-05-12 03:49:17 +0800
commit2381c0e0f461304265279155176fa655e2eb97b4 (patch)
treec0053ef5a62ee246bf02bc2cf7cfe6dae50ed3c9 /ui/app/components/text-field
parent76ab5c04fae20dc0fd2798ad8a336a0364032aff (diff)
downloadtangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar.gz
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar.bz2
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar.lz
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar.xz
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.tar.zst
tangerine-wallet-browser-2381c0e0f461304265279155176fa655e2eb97b4.zip
Add new unlock screen design
Diffstat (limited to 'ui/app/components/text-field')
-rw-r--r--ui/app/components/text-field/index.js2
-rw-r--r--ui/app/components/text-field/text-field.component.js54
2 files changed, 56 insertions, 0 deletions
diff --git a/ui/app/components/text-field/index.js b/ui/app/components/text-field/index.js
new file mode 100644
index 000000000..171caf7a4
--- /dev/null
+++ b/ui/app/components/text-field/index.js
@@ -0,0 +1,2 @@
+import TextField from './text-field.component'
+module.exports = TextField
diff --git a/ui/app/components/text-field/text-field.component.js b/ui/app/components/text-field/text-field.component.js
new file mode 100644
index 000000000..4a02f76d8
--- /dev/null
+++ b/ui/app/components/text-field/text-field.component.js
@@ -0,0 +1,54 @@
+import React from 'react'
+import PropTypes from 'prop-types'
+import { withStyles } from 'material-ui/styles'
+import { default as MaterialTextField } from 'material-ui/TextField'
+
+const styles = {
+ cssLabel: {
+ '&$cssFocused': {
+ color: '#aeaeae',
+ },
+ fontWeight: '400',
+ color: '#aeaeae',
+ },
+ cssFocused: {},
+ cssUnderline: {
+ '&:after': {
+ backgroundColor: '#f7861c',
+ },
+ },
+}
+
+const TextField = props => {
+ const { error, classes, ...textFieldProps } = props
+
+ return (
+ <MaterialTextField
+ error={Boolean(error)}
+ helperText={error}
+ InputLabelProps={{
+ FormLabelClasses: {
+ root: classes.cssLabel,
+ focused: classes.cssFocused,
+ },
+ }}
+ InputProps={{
+ classes: {
+ underline: classes.cssUnderline,
+ },
+ }}
+ {...textFieldProps}
+ />
+ )
+}
+
+TextField.defaultProps = {
+ error: null,
+}
+
+TextField.propTypes = {
+ error: PropTypes.string,
+ classes: PropTypes.object,
+}
+
+export default withStyles(styles)(TextField)