mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-04 20:54:21 +03:00
parent
cc6adb3ffd
commit
52e5d4a011
@ -67,6 +67,7 @@ export const LinkItem = (props: LinkItemProps): ReactElement => {
|
||||
const size = node.children ? node.children.size : 0;
|
||||
const contents = node.post.contents;
|
||||
const hostname = URLparser.exec(contents[1].url) ? URLparser.exec(contents[1].url)[4] : null;
|
||||
const href = URLparser.exec(contents[1].url) ? contents[1].url : `http://${contents[1].url}`
|
||||
|
||||
const baseUrl = props.baseUrl || `/~404/${resource}`;
|
||||
|
||||
@ -120,7 +121,7 @@ export const LinkItem = (props: LinkItemProps): ReactElement => {
|
||||
<RemoteContent
|
||||
ref={r => { remoteRef.current = r }}
|
||||
renderUrl={false}
|
||||
url={contents[1].url}
|
||||
url={href}
|
||||
text={contents[0].text}
|
||||
unfold={true}
|
||||
onLoad={onMeasure}
|
||||
@ -145,7 +146,7 @@ export const LinkItem = (props: LinkItemProps): ReactElement => {
|
||||
}}
|
||||
/>
|
||||
<Text color="gray" p={2} flexShrink={0}>
|
||||
<Anchor target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'none' }} href={contents[1].url}>
|
||||
<Anchor target="_blank" rel="noopener noreferrer" style={{ textDecoration: 'none' }} href={href}>
|
||||
<Box display='flex'>
|
||||
<Icon icon='ArrowExternal' mr={1} />{hostname}
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user