From 96502db1015c78c99c001c0da8578e1bfc83e072 Mon Sep 17 00:00:00 2001 From: Alexander Pantyuhov Date: Fri, 19 Oct 2018 15:33:50 +0200 Subject: [PATCH] #60 & #61: UI must handle reserved names; Remove "Already have a Status subdomain?" block from main screen (#63) --- app/components/ens/nameLookup.js | 47 ++++++++++++++++++++++++------- app/components/ens/welcome.css | 8 ------ app/components/ens/welcome.js | 1 - app/ui/components/MobileSearch.js | 26 ++++++++++------- 4 files changed, 53 insertions(+), 29 deletions(-) diff --git a/app/components/ens/nameLookup.js b/app/components/ens/nameLookup.js index d414574..824bf58 100644 --- a/app/components/ens/nameLookup.js +++ b/app/components/ens/nameLookup.js @@ -35,6 +35,7 @@ import { YOUR_CONTACT_CODE } from './constants'; import DisplayBox from './DisplayBox'; import styled from "styled-components"; import { Route } from "react-router-dom"; +import { ReservedUsernames } from '../../../config/ens-usernames/reservedNames' const normalizer = new IDNANormalizer(); const invalidSuffix = '0000000000000000000000000000000000000000' @@ -72,7 +73,7 @@ const pastReleaseDate = timestamp => new Date > new Date(timestamp * 1000); const MobileAddressDisplay = ({ domainName, address, statusAccount, expirationTime, creationTime, defaultAccount, isOwner, edit, onSubmit, handleChange, values, handleSubmit }) => ( - + ( )); +class WarningBlock extends React.Component { + render() { + const { status } = this.props; + + if (status && status.domainNameStatus === DomainNameStatus.InvalidName) { + return Names are made with
letters and numbers only
+ } + else if (status) { + return This name is reserved for security purposes. Please try another. + } + return null; + } +} + class LookupForm extends React.Component { render() { - const { handleSubmit, values, handleChange, isWarningDisplayed } = this.props; + const { handleSubmit, values, handleChange, warningCanBeDisplayed } = this.props; return ( @@ -306,14 +321,13 @@ class LookupForm extends React.Component { - {isWarningDisplayed && Names are made with
letters and numbers only
} + {warningCanBeDisplayed && }
} );