Resolve https://twitter links properly (#3062)

This commit is contained in:
Jaco Greeff 2020-06-27 08:46:24 +02:00 committed by GitHub
parent f62a250ad9
commit d75c423719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,11 @@ function Identity ({ address, identity }: Props): React.ReactElement<Props> | nu
? identity.twitter
: (
<a
href={`https://twitter.com/${identity.twitter as string}`}
href={
(identity.twitter as string).startsWith('https://twitter.com/')
? (identity.twitter as string)
: `https://twitter.com/${identity.twitter as string}`
}
rel='noopener noreferrer'
target='_blank'
>