Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier506 committed Jan 4, 2023
2 parents f620a18 + b7ec7c0 commit 3813181
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/Voters/Body/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ const Body: React.FC<BodyVoters> = ({ searchValue = '' }) => {
[rankSize]
)

const formatTelegramUserId = telegram => {
return telegram?.replace(
telegram?.includes('https://t.me/') ? 'https://t.me/' : '@',
''
)
}

useEffect(() => {
getMembers({
variables: {
Expand Down Expand Up @@ -106,14 +113,13 @@ const Body: React.FC<BodyVoters> = ({ searchValue = '' }) => {
<Image src={telegramLogo} height={14} width={14} />
<a
className={classes.aStyle}
href={`https://www.t.me/${delegate?.profile?.social?.telegram?.replace(
'@',
''
href={`https://www.t.me/${formatTelegramUserId(
delegate?.profile?.social?.telegram
)}`}
rel='noreferrer'
target='_blank'
>
{delegate?.profile?.social?.telegram?.replace('@', '')}
{formatTelegramUserId(delegate?.profile?.social?.telegram)}
</a>
</div>
}
Expand Down

0 comments on commit 3813181

Please sign in to comment.