From f0eb581fa1fa3c1ad6fc85fe2097ca0d9c0caefe Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Tue, 10 Jul 2018 17:34:28 -0400 Subject: [PATCH] add both fields to register an address and paste button --- app/components/ens/registerSubDomain.js | 80 ++++++++++++++++--------- app/ui/components/MobileSearch.js | 14 ++++- 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/app/components/ens/registerSubDomain.js b/app/components/ens/registerSubDomain.js index 3b57279..a737822 100644 --- a/app/components/ens/registerSubDomain.js +++ b/app/components/ens/registerSubDomain.js @@ -1,7 +1,8 @@ import web3 from "Embark/web3" import ENSSubdomainRegistry from 'Embark/contracts/ENSSubdomainRegistry'; import React from 'react'; -import { Button } from '../../ui/components'; +import Hidden from '@material-ui/core/Hidden'; +import { Button, MobileSearch } from '../../ui/components'; import { withFormik } from 'formik'; import { hash } from 'eth-ens-namehash'; import { zeroAddress, zeroBytes32, formatPrice } from './utils'; @@ -47,12 +48,12 @@ const InnerForm = ({ button={ @@ -65,29 +66,50 @@ const InnerForm = ({ label="Domain Price" disabled value={values.price ? `${formatPrice(values.price)} SNT` : ''} />} - - setFieldValue('address', web3.eth.defaultAccount)}>Use My Primary Address} - /> - {!isSubmitting ? : } + + + setFieldValue('address', web3.eth.defaultAccount)}>Use My Primary Address} + /> + {!isSubmitting ? : } + + + + setFieldValue('address', web3.eth.defaultAccount)} + required + wide /> + ); diff --git a/app/ui/components/MobileSearch.js b/app/ui/components/MobileSearch.js index c90d0a7..84da7fd 100644 --- a/app/ui/components/MobileSearch.js +++ b/app/ui/components/MobileSearch.js @@ -2,6 +2,7 @@ import React from 'react'; import styled, { css } from 'styled-components'; import theme from '../theme'; import SearchIcon from '@material-ui/icons/Search'; +import Button from '@material-ui/core/Button'; const searchWrapper = { width: '100%', @@ -14,13 +15,19 @@ const searchWrapper = { paddingLeft: '11px', }; +const pasteStyle = { + ...searchWrapper, + paddingLeft: '17em', + color: theme.accent +}; + const MobileInput = styled.input` display: block; border-radius: 4px; background-color: #eef2f5; font-size: 16px; border: none; - height: 7%; + height: 3.5em; width: ${({ wide }) => (wide ? '100%' : 'auto')}; appearance: none; box-shadow: none; @@ -36,7 +43,10 @@ const MobileSearch = props => ( {props.search &&
} - +
+ + {!props.value && props.paste && } +
);