Skip to content

Commit 3c4748d

Browse files
authored
Merge pull request #235 from ensdomains/dev
Deploy to production
2 parents 82a9d9a + bce3fd5 commit 3c4748d

File tree

9 files changed

+155
-70
lines changed

9 files changed

+155
-70
lines changed

src/api/registrar.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,9 @@ export const getEntry = async name => {
201201

202202
try {
203203
let permEntry = await getPermanentEntry(name)
204-
205-
if (ret.registrationDate && permEntry.migrationLockPeriod) {
204+
if (legacyEntry.registrationDate && permEntry.migrationLockPeriod) {
206205
ret.migrationStartDate = new Date(
207-
ret.registrationDate + permEntry.migrationLockPeriod * 1000
206+
legacyEntry.registrationDate + permEntry.migrationLockPeriod * 1000
208207
)
209208
} else {
210209
ret.migrationStartDate = null

src/components/Forms/Button.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ function getButtonStyles({ type }) {
2626
box-shadow: 0 10px 21px 0 rgba(161, 175, 184, 0.89);
2727
}
2828
`
29+
case 'hollow-white':
30+
return `
31+
background: transparent;
32+
color: white;
33+
border: 2px solid #fff;
34+
&:visited {
35+
color: white;
36+
}
37+
&:hover {
38+
cursor: pointer;
39+
border: 2px solid transparent;
40+
background: #2c46a6;
41+
box-shadow: 0 10px 21px 0 rgba(161, 175, 184, 0.89);
42+
}
43+
`
2944
case 'hollow-primary':
3045
return `
3146
color: #5384FE;

src/components/HowToUse/HowToUse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const HowToUse = ({ text = false, className }) => (
106106
title="Register names"
107107
text={
108108
text
109-
? 'Register .eth names for ~$5/year. Renew or cancel your name registration at any time.'
109+
? 'Register .eth names for $5/year. Renew or cancel your name registration at any time.'
110110
: ''
111111
}
112112
/>
Lines changed: 1 addition & 0 deletions
Loading

src/components/SingleName/Name.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,26 @@ function Name({ details: domain, name, pathname, refetch }) {
9595
return (
9696
<QueryAccount>
9797
{({ account }) => {
98+
const hasAnOwner = account !== EMPTY_ADDRESS
9899
const isOwner = isOwnerOfDomain(domain, account)
99100
const isDeedOwner = domain.deedOwner === account
100-
101+
const registrationOpen = isRegistrationOpen(domain, isDeedOwner)
101102
return (
102103
<NameContainer state={isOwner ? 'Yours' : domain.state}>
103104
<TopBar percentDone={percentDone}>
104105
<Title>{name}</Title>
105106
<RightBar>
106107
{isOwner && <Owner>Owner</Owner>}
107108
<Favourite domain={domain} />
108-
{smallBP &&
109-
domain.parent === 'eth' &&
110-
domain.state === 'Owned' && (
111-
<Tabs pathname={pathname} domain={domain} />
112-
)}
109+
{smallBP && hasAnOwner && (
110+
<Tabs pathname={pathname} domain={domain} />
111+
)}
113112
</RightBar>
114113
</TopBar>
115-
{!smallBP &&
116-
domain.parent === 'eth' &&
117-
domain.state === 'Owned' && (
118-
<Tabs pathname={pathname} domain={domain} />
119-
)}
120-
{isRegistrationOpen(domain, isDeedOwner) ? (
114+
{!smallBP && hasAnOwner && (
115+
<Tabs pathname={pathname} domain={domain} />
116+
)}
117+
{registrationOpen ? (
121118
<NameRegister
122119
domain={domain}
123120
pathname={pathname}

src/components/SingleName/TransferRegistrars.js

Lines changed: 66 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import ReleaseDeed from './ReleaseDeed'
1515

1616
const CloseLink = styled('a')`
1717
position: relative;
18-
cursor:pointer;
18+
cursor: pointer;
1919
${mq.small`
2020
top:-46px;
2121
`}
22-
`
22+
`
2323

2424
const MigrationInstruction = styled('h3')`
2525
margin: 0;
@@ -63,7 +63,8 @@ const MigrationIcon = styled(DefaultMigrationIcon)`
6363

6464
const TransferDetail = styled(DetailsItem)`
6565
padding: 20px;
66-
background-color: ${props => props.condition === 'warning' ? '#fef6e9' : '#f0f6fa'};
66+
background-color: ${props =>
67+
props.condition === 'warning' ? '#fef6e9' : '#f0f6fa'};
6768
position: relative;
6869
padding-top: 65px;
6970
margin-bottom: 25px;
@@ -87,37 +88,42 @@ const Action = styled('div')`
8788
`}
8889
`
8990

90-
const LearnMoreLink = styled('a')`
91-
`
91+
const LearnMoreLink = styled('a')``
9292

9393
const LearnMore = () => (
9494
<LearnMoreLink
9595
// Temp link until we get better blog post explaining the detail.
96-
href="https://medium.com/the-ethereum-name-service/the-future-of-ens-as-explained-in-our-ethcc-talks-videos-inside-395fbaaa6cad"
96+
href="https://docs.ens.domains/permanent-registrar-faq"
9797
target="_blank"
9898
>
9999
Learn More
100100
</LearnMoreLink>
101101
)
102102

103-
const ReleaseInstead = ({label, refetch}) =>(
103+
const ReleaseInstead = ({ label, refetch }) => (
104104
<MigrationExplanation>
105105
<ReleaseDeed
106106
label={label}
107107
refetch={refetch}
108-
actionText = 'Release'
109-
actionType = 'link'
110-
explanation = 'You will no longer have ownership of this name'
108+
actionText="Release"
109+
actionType="link"
110+
explanation="You will no longer have ownership of this name"
111111
/>{' '}
112112
the domain to get your locked ETH back if you don’t want it anymore.
113-
</MigrationExplanation>
113+
</MigrationExplanation>
114114
)
115115

116-
function displayMigrationDiralogue({parent, isOwner,isDeedOwner, isNewRegistrar, confirmed}){
116+
function displayMigrationDiralogue({
117+
parent,
118+
isOwner,
119+
isDeedOwner,
120+
isNewRegistrar,
121+
confirmed
122+
}) {
117123
return (
118-
parent === 'eth' &&
119-
((isOwner || isDeedOwner) && !isNewRegistrar)
120-
) || confirmed
124+
(parent === 'eth' && ((isOwner || isDeedOwner) && !isNewRegistrar)) ||
125+
confirmed
126+
)
121127
}
122128

123129
function TransferRegistrars({
@@ -141,8 +147,9 @@ function TransferRegistrars({
141147
Congratulations on Migrating your domain!
142148
</MigrationInstruction>
143149
<MigrationExplanation>
144-
You successfully migrated this domain to the new ENS Permanent Registrar.
145-
We've sent back to you the ETH that you had locked in the older registrar contract.
150+
You successfully migrated this domain to the new ENS Permanent
151+
Registrar. We've sent back to you the ETH that you had locked in the
152+
older registrar contract.
146153
</MigrationExplanation>
147154
</>
148155
)
@@ -153,15 +160,13 @@ function TransferRegistrars({
153160
Be Ready! ENS is migrating to a new Registrar.
154161
</MigrationInstruction>
155162
<MigrationExplanation>
156-
This domain is currently recorded in the old ENS Registrar which will be discontinued after 2019.05.04.
157-
Migrate to the new ENS Registrar between{' '}
163+
This domain is currently recorded in the old ENS Registrar which will be
164+
discontinued after 2019.05.04. Migrate to the new ENS Registrar between{' '}
158165
<strong>
159166
{formatDate(migrationStartDate, true)} -{' '}
160167
{formatDate(transferEndDate, true)}
161-
</strong>
162-
{' '}
163-
if you want to keep your domain.
164-
{' '}<LearnMore />
168+
</strong>{' '}
169+
if you want to keep your domain. <LearnMore />
165170
</MigrationExplanation>
166171
<ReleaseInstead label={label} refetch={refetch} />
167172
</>
@@ -173,22 +178,24 @@ function TransferRegistrars({
173178
Migration period ended {formatDate(transferEndDate, true)}
174179
</MigrationInstruction>
175180
<MigrationExplanation>
176-
You no longer own this name and it has been made available for registration in the new ENS Permanent Registrar.
177-
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.
178-
{' '}<LearnMore />
181+
You no longer own this name and it has been made available for
182+
registration in the new ENS Permanent Registrar. You can release the
183+
domain from the older registrar to get your locked ETH back and register
184+
it again in the new ENS Permanent Registrar. <LearnMore />
179185
</MigrationExplanation>
180186
</>
181187
)
182188

183189
const MigrateNow = (
184190
<>
185191
<MigrationInstruction>
186-
Migrate your name to the Permanent Registrar.
192+
Migrate your name to the Permanent Registrar.
187193
</MigrationInstruction>
188194
<MigrationExplanation>
189-
Migrate now to get your locked ETH back and free registration for one year.
190-
If you do not migrate by <strong>{formatDate(transferEndDate, true)}</strong>, you will lose your domain, and others will be able to register it.
191-
{' '}<LearnMore />
195+
Migrate now to get your locked ETH back and free registration for one
196+
year. If you do not migrate by{' '}
197+
<strong>{formatDate(transferEndDate, true)}</strong>, you will lose your
198+
domain, and others will be able to register it. <LearnMore />
192199
</MigrationExplanation>
193200
<ReleaseInstead label={label} refetch={refetch} />
194201
</>
@@ -198,9 +205,9 @@ function TransferRegistrars({
198205
<ReleaseDeed
199206
label={label}
200207
refetch={refetch}
201-
actionText = 'Release'
202-
actionType = 'button'
203-
explanation = 'You already lost ownership of this name but will get ETH back'
208+
actionText="Release"
209+
actionType="button"
210+
explanation="You already lost ownership of this name but will get ETH back"
204211
/>
205212
)
206213

@@ -222,42 +229,50 @@ function TransferRegistrars({
222229
startPending(Object.values(data)[0])
223230
}}
224231
>
225-
{mutate => <TransferButton
226-
onClick={mutate}
227-
type="hollow-primary"
228-
>Migrate</TransferButton>
229-
}
232+
{mutate => (
233+
<TransferButton onClick={mutate} type="hollow-primary">
234+
Migrate
235+
</TransferButton>
236+
)}
230237
</Mutation>
231238
)}
232239
</>
233240
)
234241

235242
let CurrentMigrationInstruction, CurrentAction, condition
236-
if(confirmed){
243+
if (confirmed) {
237244
CurrentMigrationInstruction = MigrationConfirmed
238245
CurrentAction = <CloseLink onClick={stopEditing}>x</CloseLink>
239-
}else{
246+
} else {
240247
if (currentBlockDate < migrationStartDate) {
241248
CurrentMigrationInstruction = TooEarly
242-
CurrentAction = <TransferButton type="hollow-primary-disabled">Migrate</TransferButton>
249+
CurrentAction = (
250+
<TransferButton type="hollow-primary-disabled">Migrate</TransferButton>
251+
)
243252
condition = 'warning'
244253
} else if (currentBlockDate < transferEndDate) {
245254
CurrentMigrationInstruction = MigrateNow
246255
CurrentAction = MigrateAction
247256
condition = 'warning'
248-
} else if (currentBlockDate >= transferEndDate){
257+
} else if (currentBlockDate >= transferEndDate) {
249258
CurrentMigrationInstruction = TooLate
250259
CurrentAction = ReleaseAction
251-
}
260+
}
252261
}
253-
return (
254-
displayMigrationDiralogue({parent, isOwner, isDeedOwner, isNewRegistrar, confirmed}) ? (
255-
<TransferDetail condition={condition}>
256-
<MigrationIcon />
257-
{CurrentMigrationInstruction}
258-
<Action>{CurrentAction}</Action>
259-
</TransferDetail>
260-
): ''
262+
return displayMigrationDiralogue({
263+
parent,
264+
isOwner,
265+
isDeedOwner,
266+
isNewRegistrar,
267+
confirmed
268+
}) ? (
269+
<TransferDetail condition={condition}>
270+
<MigrationIcon />
271+
{CurrentMigrationInstruction}
272+
<Action>{CurrentAction}</Action>
273+
</TransferDetail>
274+
) : (
275+
''
261276
)
262277
}
263278

src/globalStyles.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ injectGlobal`
77
body {
88
font-family: Overpass;
99
background: #F0F6FA;
10+
margin: 0;
1011
}
1112
1213
a {

0 commit comments

Comments
 (0)