Skip to content

Commit

Permalink
feat: add link to tweet
Browse files Browse the repository at this point in the history
  • Loading branch information
Расул authored and Расул committed Sep 26, 2023
1 parent 2b732ac commit 01f7ecd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/components/App/SideBar/TwitData/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ export const TwitData = () => {

const twitId: string = selectedNode?.tweet_id || ''

const openLinkInNewWindow = () => {
// Replace 'linkUrl' with the URL you want to open in a new window
const linkUrl = 'https://example.com'

// Use window.open() to open the link in a new window
window.open(linkUrl, '_blank')
}

return (
selectedNode && (
<Flex direction="column" px={24} py={16}>
Expand All @@ -39,8 +31,10 @@ export const TwitData = () => {
</Flex>
<TweetText>{selectedNode.text}</TweetText>
</TweetContainer>
<Flex>
<Button onClick={openLinkInNewWindow}>View more</Button>
<Flex align="center">
<a href={`https://twitter.com/Interior/status/${twitId}?open=system`}>
<Button>View comments </Button>
</a>
</Flex>
</>
)}
Expand Down

0 comments on commit 01f7ecd

Please sign in to comment.