Skip to content

Commit c441d9c

Browse files
authored
Merge pull request #636 from ensdomains/dev
Deploy to live
2 parents 0188c3b + deb9fa6 commit c441d9c

File tree

8 files changed

+83
-29
lines changed

8 files changed

+83
-29
lines changed

src/components/Links/ContentHashLink.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ContentHashLink = ({ value, contentType }) => {
4545
externalLink = `https://swarm-gateways.net/bzz://${decoded}`
4646
url = `bzz://${decoded}`
4747
} else if (protocolType === 'onion' || protocolType === 'onion3') {
48-
externalLink = `https://${decoded}.onion`
48+
externalLink = `http://${decoded}.onion`
4949
url = `onion://${decoded}`
5050
} else {
5151
console.warn(`Unsupported protocol ${protocolType}`)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react'
2+
import styled from '@emotion/styled'
3+
import { ReactComponent as ExternalLinkIcon } from '../Icons/externalLink.svg'
4+
5+
const LinkContainer = styled('a')`
6+
display: inline-block;
7+
align-items: center;
8+
text-overflow: ellipsis;
9+
white-space: nowrap;
10+
overflow: hidden;
11+
svg {
12+
margin-left: 10px;
13+
transition: 0.1s;
14+
opacity: 0;
15+
}
16+
17+
&:hover {
18+
svg {
19+
opacity: 1;
20+
}
21+
}
22+
`
23+
24+
const TextRecordLink = ({ textKey, value }) => {
25+
let url
26+
switch (textKey) {
27+
case 'url':
28+
url = `${value}`
29+
break
30+
case 'vnd.twitter':
31+
url = `twitter.com/${value}`
32+
break
33+
case 'vnd.github':
34+
url = `github.com/${value}`
35+
break
36+
default:
37+
}
38+
if (url && !url.match(/http[s]?:\/\//)) {
39+
url = 'https://' + url
40+
}
41+
return url ? (
42+
<LinkContainer target="_blank" href={url}>
43+
{value}
44+
<ExternalLinkIcon />
45+
</LinkContainer>
46+
) : (
47+
value
48+
)
49+
}
50+
51+
export default TextRecordLink

src/components/SingleName/DNSNameRegister/NameRegister.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import You from '../../Icons/You'
1212

1313
const EtherScanLink = styled(DefaultEtherScanLink)`
1414
display: flex;
15+
overflow: hidden;
1516
svg {
1617
flex-grow: 1;
1718
}

src/components/SingleName/NameDetails.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState } from 'react'
22
import { useQuery } from 'react-apollo'
33
import styled from '@emotion/styled'
44
import { Link, Route } from 'react-router-dom'
5+
import mq from 'mediaQuery'
56

67
import {
78
SET_OWNER,
@@ -53,12 +54,17 @@ const Button = styled(DefaultButton)`
5354
`
5455

5556
const ButtonContainer = styled('div')`
56-
margin-top: 0;
57-
position: absolute;
58-
right: ${props => (props.outOfSync ? '195px' : '180px')};
59-
-webkit-transform: translate(0, -65%);
60-
-ms-transform: translate(0, -65%);
61-
transform: translate(0, -65%);
57+
margin-top: 20px;
58+
height: 50px;
59+
${mq.small`
60+
height: 50px;
61+
width: 50px;
62+
position: absolute;
63+
right: 128px;
64+
-webkit-transform: translate(0, -65%);
65+
-ms-transform: translate(0, -65%);
66+
transform: translate(0, -65%);
67+
`}
6268
`
6369

6470
const ExpirationDetailsValue = styled(DetailsValue)`
@@ -75,7 +81,11 @@ const Explainer = styled('div')`
7581
color: #adbbcd;
7682
display: flex;
7783
padding: 1em 0;
78-
margin-left: 180px;
84+
margin-left: 0px;
85+
${mq.small`
86+
margin-left: 180px;
87+
`}
88+
7989
margin-bottom: 45px;
8090
padding-left 24px;
8191
`
@@ -100,7 +110,7 @@ const EtherScanLinkContainer = styled('span')`
100110
`
101111

102112
const LinkToLearnMore = styled('a')`
103-
margin-right: ${props => (props.outOfSync ? '' : '2em')};
113+
margin-right: ${props => (props.outOfSync ? '' : '')};
104114
font-size: 14px;
105115
letter-spacing: 0.58px;
106116
text-align: center;

src/components/SingleName/ResolverAndRecords/KeyValueRecord/KeyValueRecord.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useEffect, useState } from 'react'
22
import styled from '@emotion/styled'
33
import { useMutation, useQuery, Mutation } from 'react-apollo'
4+
import TextRecordLink from '../../../Links/TextRecordLink'
45
import mq from 'mediaQuery'
56

67
import {
@@ -67,16 +68,12 @@ const RecordsListItem = styled('div')`
6768
`}
6869
`
6970

70-
const Value = styled(RecordsValue)`
71-
padding-right: 0;
72-
`
73-
7471
const KeyValuesContent = styled(RecordsContent)`
7572
display: grid;
7673
width: 100%;
7774
grid-template-columns: 1fr;
7875
padding-right: 30px;
79-
76+
overflow: hidden;
8077
${mq.small`
8178
grid-template-columns: 150px 1fr;
8279
`}
@@ -148,7 +145,7 @@ const Editable = ({
148145
<KeyValueItem editing={editing} hasRecord={true} noBorder>
149146
<KeyValuesContent editing={editing}>
150147
<RecordsSubKey>{textKey}</RecordsSubKey>
151-
<Value editableSmall>{value}</Value>
148+
<TextRecordLink textKey={textKey} value={value} />
152149

153150
{pending && !confirmed && txHash ? (
154151
<PendingTx

src/components/SingleName/ResolverAndRecords/RecordsItem.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ export const RecordsItem = styled(DetailsItem)`
4040
`
4141

4242
export const RecordsContent = styled('div')`
43-
display: flex;
43+
display: grid;
4444
justify-content: flex-start;
4545
align-items: center;
4646
position: relative;
47+
${mq.medium`
48+
display: flex;
49+
`}
4750
${({ editing }) => editing && 'margin-bottom: 30px'};
4851
`
4952

@@ -74,6 +77,10 @@ export const RecordsSubKey = styled('div')`
7477

7578
export const RecordsValue = styled(DetailsValue)`
7679
font-size: 14px;
80+
margin-top: 1em;
81+
${mq.small`
82+
margin-top: 0;
83+
`}
7784
`
7885

7986
const EditRecord = styled('div')`

src/components/SingleName/ResolverAndRecords/TextRecord/TextRecord.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import TEXT_RECORD_KEYS from 'constants/textRecords'
33
import KeyValueRecord from '../KeyValueRecord'
4-
import { Query, useQuery } from 'react-apollo'
4+
import { useQuery } from 'react-apollo'
55
import { getNamehash } from '@ensdomains/ui'
66
import { GET_RESOLVER_FROM_SUBGRAPH } from 'graphql/queries'
77

src/components/SingleName/ResolverAndRecords/TextRecord/constants.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)