Skip to content

Commit

Permalink
Make social links clickable (Joystream#4670)
Browse files Browse the repository at this point in the history
* clickable link

* import order

* yarn lint

* vscode
  • Loading branch information
akiowebstar authored Dec 8, 2023
1 parent 4644cfc commit 0cc8324
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components'

import { BlockTime } from '@/common/components/BlockTime'
import { TransferSymbol } from '@/common/components/icons/symbols'
import { Link } from '@/common/components/Link'
import { Loading } from '@/common/components/Loading'
import {
SidePaneTable,
Expand Down Expand Up @@ -36,6 +37,15 @@ export const MemberDetails = React.memo(({ member }: Props) => {
initiatingLeaving = '-',
} = useMemberExtraInfo(member)

const externalResourceLink: any = {
TELEGRAM: 'https://web.telegram.org/k/#@',
TWITTER: 'https://twitter.com/',
FACEBOOK: 'https://facebook.com/',
YOUTUBE: 'https://youtube.com/user/',
LINKEDIN: 'https://www.linkedin.com/in/',
GITHUB: 'https://github.com/',
}

if (isLoading || !memberDetails) {
return (
<EmptyBody>
Expand Down Expand Up @@ -132,7 +142,18 @@ export const MemberDetails = React.memo(({ member }: Props) => {
memberDetails.externalResources.map((externalResource) => (
<SidePaneRow key={`${externalResource.source}-externalResources`}>
<SidePaneLabel text={socialTitle(externalResource.source)} />
<SidePaneText>{externalResource.value}</SidePaneText>
<SidePaneText>
{externalResourceLink[externalResource.source] ? (
<Link
href={`${externalResourceLink[externalResource.source]}${externalResource.value}`}
target="_blank"
>
{externalResource.value}
</Link>
) : (
externalResource.value
)}{' '}
</SidePaneText>
</SidePaneRow>
))}
</SidePaneTable>
Expand Down

0 comments on commit 0cc8324

Please sign in to comment.