Skip to content

Commit

Permalink
Merge pull request #406 from systemli/show-telegram-link
Browse files Browse the repository at this point in the history
✨ Show Telegram Link in Description
  • Loading branch information
0x46616c6b authored Oct 6, 2022
2 parents 7a1e01f + 46cfc18 commit 2ea1688
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/components/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ const About: FC<Props> = props => {
type={DescriptionTypes.Facebook}
/>
)}
{props.ticker.information.telegram && (
<DescriptionItem
info={props.ticker.information.telegram}
type={DescriptionTypes.Telegram}
/>
)}
</List>
)

Expand Down
34 changes: 26 additions & 8 deletions src/components/DescriptionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ const DescriptionItem: FC<Props> = props => {
<List.Item>
<List.Icon name="mail" />
<List.Content>
<a
href={`mailto:
${props.info}`}
>
{props.info}
</a>
<a href={`mailto:${props.info}`}>{props.info}</a>
</List.Content>
</List.Item>
)
Expand All @@ -50,7 +45,9 @@ const DescriptionItem: FC<Props> = props => {
<List.Item>
<List.Icon name="linkify" />
<List.Content>
<a href={props.info}>{props.info}</a>
<a href={props.info} rel="noopener noreferrer" target="_blank">
{props.info}
</a>
</List.Content>
</List.Item>
)
Expand All @@ -59,7 +56,28 @@ const DescriptionItem: FC<Props> = props => {
<List.Item>
<List.Icon name="twitter" />
<List.Content>
<a href={`https://twitter.com/${props.info}`}>@{props.info}</a>
<a
href={`https://twitter.com/${props.info}`}
rel="noopener noreferrer"
target="_blank"
>
@{props.info}
</a>
</List.Content>
</List.Item>
)
case DescriptionTypes.Telegram:
return (
<List.Item>
<List.Icon name="telegram" />
<List.Content>
<a
href={`https://t.me/${props.info}`}
rel="noopener noreferrer"
target="_blank"
>
@{props.info}
</a>
</List.Content>
</List.Item>
)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type TickerInformation = {
author: string
email: string
facebook: string
telegram: string
twitter: string
url: string
}
Expand All @@ -37,6 +38,7 @@ export enum DescriptionTypes {
Facebook = 'FACEBOOK',
Homepage = 'HOMEPAGE',
Twitter = 'TWITTER',
Telegram = 'TELEGRAM',
}

export type Message = {
Expand Down

0 comments on commit 2ea1688

Please sign in to comment.