forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminDomainCard.js
More file actions
37 lines (35 loc) · 1.04 KB
/
AdminDomainCard.js
File metadata and controls
37 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import { Trans } from '@lingui/macro'
import { string } from 'prop-types'
import { Grid, Link, ListItem, Stack, Text } from '@chakra-ui/react'
import { ExternalLinkIcon } from '@chakra-ui/icons'
import { sanitizeUrl } from '../utilities/sanitizeUrl'
export function AdminDomainCard({ url, ...rest }) {
return (
<ListItem {...rest}>
<Grid
templateColumns={{ base: 'auto', md: '40% 60%' }}
columnGap="1.5rem"
>
<Stack isInline>
<Text fontWeight="bold">
<Trans>Domain:</Trans>
</Text>
<Link
ml="auto"
// TODO: have the API enforce a scheme
// so we don't need to guess badly here.
href={`http://${sanitizeUrl(url)}`}
isExternal
target="_blank"
rel="noopener noreferrer"
>
{url}
<ExternalLinkIcon mx="2px" aria-hidden="true" />
</Link>
</Stack>
</Grid>
</ListItem>
)
}
AdminDomainCard.propTypes = { url: string }