diff --git a/src/api/registrar.js b/src/api/registrar.js index c78d32bec..a8946bca6 100644 --- a/src/api/registrar.js +++ b/src/api/registrar.js @@ -201,10 +201,9 @@ export const getEntry = async name => { try { let permEntry = await getPermanentEntry(name) - - if (ret.registrationDate && permEntry.migrationLockPeriod) { + if (legacyEntry.registrationDate && permEntry.migrationLockPeriod) { ret.migrationStartDate = new Date( - ret.registrationDate + permEntry.migrationLockPeriod * 1000 + legacyEntry.registrationDate + permEntry.migrationLockPeriod * 1000 ) } else { ret.migrationStartDate = null diff --git a/src/components/Forms/Button.js b/src/components/Forms/Button.js index c1929066c..d4db9ea50 100644 --- a/src/components/Forms/Button.js +++ b/src/components/Forms/Button.js @@ -26,6 +26,21 @@ function getButtonStyles({ type }) { box-shadow: 0 10px 21px 0 rgba(161, 175, 184, 0.89); } ` + case 'hollow-white': + return ` + background: transparent; + color: white; + border: 2px solid #fff; + &:visited { + color: white; + } + &:hover { + cursor: pointer; + border: 2px solid transparent; + background: #2c46a6; + box-shadow: 0 10px 21px 0 rgba(161, 175, 184, 0.89); + } + ` case 'hollow-primary': return ` color: #5384FE; diff --git a/src/components/HowToUse/HowToUse.js b/src/components/HowToUse/HowToUse.js index 2880b4376..33fce866e 100644 --- a/src/components/HowToUse/HowToUse.js +++ b/src/components/HowToUse/HowToUse.js @@ -106,7 +106,7 @@ const HowToUse = ({ text = false, className }) => ( title="Register names" text={ text - ? 'Register .eth names for ~$5/year. Renew or cancel your name registration at any time.' + ? 'Register .eth names for $5/year. Renew or cancel your name registration at any time.' : '' } /> diff --git a/src/components/Icons/PermanentRegistrar.svg b/src/components/Icons/PermanentRegistrar.svg new file mode 100644 index 000000000..4a35394c1 --- /dev/null +++ b/src/components/Icons/PermanentRegistrar.svg @@ -0,0 +1 @@ + diff --git a/src/components/SingleName/Name.js b/src/components/SingleName/Name.js index 9a1fd7026..85d629d59 100644 --- a/src/components/SingleName/Name.js +++ b/src/components/SingleName/Name.js @@ -95,9 +95,10 @@ function Name({ details: domain, name, pathname, refetch }) { return ( {({ account }) => { + const hasAnOwner = account !== EMPTY_ADDRESS const isOwner = isOwnerOfDomain(domain, account) const isDeedOwner = domain.deedOwner === account - + const registrationOpen = isRegistrationOpen(domain, isDeedOwner) return ( @@ -105,19 +106,15 @@ function Name({ details: domain, name, pathname, refetch }) { {isOwner && Owner} - {smallBP && - domain.parent === 'eth' && - domain.state === 'Owned' && ( - - )} + {smallBP && hasAnOwner && ( + + )} - {!smallBP && - domain.parent === 'eth' && - domain.state === 'Owned' && ( - - )} - {isRegistrationOpen(domain, isDeedOwner) ? ( + {!smallBP && hasAnOwner && ( + + )} + {registrationOpen ? ( props.condition === 'warning' ? '#fef6e9' : '#f0f6fa'}; + background-color: ${props => + props.condition === 'warning' ? '#fef6e9' : '#f0f6fa'}; position: relative; padding-top: 65px; margin-bottom: 25px; @@ -87,37 +88,42 @@ const Action = styled('div')` `} ` -const LearnMoreLink = styled('a')` -` +const LearnMoreLink = styled('a')`` const LearnMore = () => ( Learn More ) -const ReleaseInstead = ({label, refetch}) =>( +const ReleaseInstead = ({ label, refetch }) => ( {' '} the domain to get your locked ETH back if you don’t want it anymore. - + ) -function displayMigrationDiralogue({parent, isOwner,isDeedOwner, isNewRegistrar, confirmed}){ +function displayMigrationDiralogue({ + parent, + isOwner, + isDeedOwner, + isNewRegistrar, + confirmed +}) { return ( - parent === 'eth' && - ((isOwner || isDeedOwner) && !isNewRegistrar) - ) || confirmed + (parent === 'eth' && ((isOwner || isDeedOwner) && !isNewRegistrar)) || + confirmed + ) } function TransferRegistrars({ @@ -141,8 +147,9 @@ function TransferRegistrars({ Congratulations on Migrating your domain! - You successfully migrated this domain to the new ENS Permanent Registrar. - We've sent back to you the ETH that you had locked in the older registrar contract. + You successfully migrated this domain to the new ENS Permanent + Registrar. We've sent back to you the ETH that you had locked in the + older registrar contract. ) @@ -153,15 +160,13 @@ function TransferRegistrars({ Be Ready! ENS is migrating to a new Registrar. - This domain is currently recorded in the old ENS Registrar which will be discontinued after 2019.05.04. - Migrate to the new ENS Registrar between{' '} + This domain is currently recorded in the old ENS Registrar which will be + discontinued after 2019.05.04. Migrate to the new ENS Registrar between{' '} {formatDate(migrationStartDate, true)} -{' '} {formatDate(transferEndDate, true)} - - {' '} - if you want to keep your domain. - {' '} + {' '} + if you want to keep your domain. @@ -173,9 +178,10 @@ function TransferRegistrars({ Migration period ended {formatDate(transferEndDate, true)} - You no longer own this name and it has been made available for registration in the new ENS Permanent Registrar. - You can release the domain from the older registrar to get your locked ETH back and register it again in the new ENS Permanent Registrar. - {' '} + You no longer own this name and it has been made available for + registration in the new ENS Permanent Registrar. You can release the + domain from the older registrar to get your locked ETH back and register + it again in the new ENS Permanent Registrar. ) @@ -183,12 +189,13 @@ function TransferRegistrars({ const MigrateNow = ( <> - Migrate your name to the Permanent Registrar. + Migrate your name to the Permanent Registrar. - Migrate now to get your locked ETH back and free registration for one year. - If you do not migrate by {formatDate(transferEndDate, true)}, you will lose your domain, and others will be able to register it. - {' '} + Migrate now to get your locked ETH back and free registration for one + year. If you do not migrate by{' '} + {formatDate(transferEndDate, true)}, you will lose your + domain, and others will be able to register it. @@ -198,9 +205,9 @@ function TransferRegistrars({ ) @@ -222,42 +229,50 @@ function TransferRegistrars({ startPending(Object.values(data)[0]) }} > - {mutate => Migrate - } + {mutate => ( + + Migrate + + )} )} ) let CurrentMigrationInstruction, CurrentAction, condition - if(confirmed){ + if (confirmed) { CurrentMigrationInstruction = MigrationConfirmed CurrentAction = x - }else{ + } else { if (currentBlockDate < migrationStartDate) { CurrentMigrationInstruction = TooEarly - CurrentAction = Migrate + CurrentAction = ( + Migrate + ) condition = 'warning' } else if (currentBlockDate < transferEndDate) { CurrentMigrationInstruction = MigrateNow CurrentAction = MigrateAction condition = 'warning' - } else if (currentBlockDate >= transferEndDate){ + } else if (currentBlockDate >= transferEndDate) { CurrentMigrationInstruction = TooLate CurrentAction = ReleaseAction - } + } } - return ( - displayMigrationDiralogue({parent, isOwner, isDeedOwner, isNewRegistrar, confirmed}) ? ( - - - {CurrentMigrationInstruction} - {CurrentAction} - - ): '' + return displayMigrationDiralogue({ + parent, + isOwner, + isDeedOwner, + isNewRegistrar, + confirmed + }) ? ( + + + {CurrentMigrationInstruction} + {CurrentAction} + + ) : ( + '' ) } diff --git a/src/globalStyles.js b/src/globalStyles.js index d67ba0ce3..bf884f50a 100644 --- a/src/globalStyles.js +++ b/src/globalStyles.js @@ -7,6 +7,7 @@ injectGlobal` body { font-family: Overpass; background: #F0F6FA; + margin: 0; } a { diff --git a/src/routes/Home.js b/src/routes/Home.js index 501761cb6..3a4d08148 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -8,12 +8,13 @@ import SearchDefault from '../components/SearchName/Search' import NoAccountsDefault from '../components/NoAccounts/NoAccountsModal' import bg from '../assets/heroBG.jpg' import NetworkInfoQuery from '../components/NetworkInformation/NetworkInfoQuery' -import { ButtonLink } from '../components/Forms/Button' +import { ExternalButtonLink, ButtonLink } from '../components/Forms/Button' import TextBubbleDefault from '../components/Icons/TextBubble' import QuestionMarkDefault from '../components/Icons/QuestionMark' import HowToUseDefault from '../components/HowToUse/HowToUse' import Alice from '../components/HomePage/Alice' import ENSLogo from '../components/HomePage/images/ENSLogo.svg' +import { ReactComponent as DefaultPermanentRegistrarIcon } from '../components/Icons/PermanentRegistrar.svg' const HowToUse = styled(HowToUseDefault)` padding: 70px; @@ -172,12 +173,48 @@ const QuestionMark = styled(QuestionMarkDefault)` const LogoLarge = styled('img')` width: 50%; - margin: 0 auto 50px; + margin: 0 auto 0; ${mq.medium` width: 223px; `} ` +const PermanentRegistrarLogo = styled('h1')` + font-family: Overpass; + font-weight: 800; + font-size: 18px; + text-transform: uppercase; + color: #4258d3; + letter-spacing: 1.8px; + text-align: right; + line-height: 24px; + margin-top: 10px; + margin-bottom: 50px; + text-align: center; +` + +const PermanentRegistrar = styled('div')` + background-image: linear-gradient(24deg, #52e5ff 0%, #513eff 100%); + padding: 80px 0; + display: flex; + flex-direction: column; + align-items: center; +` + +const PermanentRegistrarIcon = styled(DefaultPermanentRegistrarIcon)` + margin-left: 15px; +` + +const PermanentRegistrarTitle = styled('h2')` + font-family: Overpass; + font-weight: 500; + font-size: 30px; + color: #ffffff; + text-align: center; + line-height: 38px; + max-width: 500px; +` + export default props => ( @@ -209,6 +246,14 @@ export default props => ( }} src={ENSLogo} /> + + Permanent Registrar + )} @@ -253,5 +298,17 @@ export default props => ( + + + + Learn about the Permanent Registrar and the migration process. + + + Learn more + + ) diff --git a/src/routes/SingleName.js b/src/routes/SingleName.js index f74d5f219..c7b4df040 100644 --- a/src/routes/SingleName.js +++ b/src/routes/SingleName.js @@ -33,7 +33,7 @@ function SingleName({ _type = parseSearchTerm(searchTerm) } setType(_type) - if (_type === 'supported') { + if (_type === 'supported' || _type === 'tld') { setValid(true) } else { setValid(false)