Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add link to tweet #432

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading