Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
bf16dfa0
Unverified
Commit
bf16dfa0
authored
Oct 11, 2022
by
lynn
Committed by
GitHub
Oct 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix twitter links (#4868)
* fix twitter links * fix
parent
910e86d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
ChartSection.tsx
src/components/Tokens/TokenDetails/ChartSection.tsx
+1
-3
ShareButton.tsx
src/components/Tokens/TokenDetails/ShareButton.tsx
+6
-4
No files found.
src/components/Tokens/TokenDetails/ChartSection.tsx
View file @
bf16dfa0
...
@@ -119,9 +119,7 @@ export default function ChartSection({
...
@@ -119,9 +119,7 @@ export default function ChartSection({
{
!
warning
&&
<
VerifiedIcon
size=
"16px"
/>
}
{
!
warning
&&
<
VerifiedIcon
size=
"16px"
/>
}
</
TokenNameCell
>
</
TokenNameCell
>
<
TokenActions
>
<
TokenActions
>
{
token
.
name
&&
token
.
symbol
&&
token
.
address
&&
(
{
token
.
name
&&
token
.
symbol
&&
token
.
address
&&
<
ShareButton
token=
{
token
}
isNative=
{
!!
nativeCurrency
}
/>
}
<
ShareButton
tokenName=
{
token
.
name
}
tokenSymbol=
{
token
.
symbol
}
tokenAddress=
{
token
.
address
}
/>
)
}
{
useFavoriteTokensFlag
()
===
FavoriteTokensVariant
.
Enabled
&&
(
{
useFavoriteTokensFlag
()
===
FavoriteTokensVariant
.
Enabled
&&
(
<
ClickFavorited
onClick=
{
toggleFavorite
}
>
<
ClickFavorited
onClick=
{
toggleFavorite
}
>
<
FavoriteIcon
isFavorited=
{
isFavorited
}
/>
<
FavoriteIcon
isFavorited=
{
isFavorited
}
/>
...
...
src/components/Tokens/TokenDetails/ShareButton.tsx
View file @
bf16dfa0
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Trans
}
from
'
@lingui/macro
'
import
{
NATIVE_CHAIN_ID
}
from
'
constants/tokens
'
import
{
SingleTokenData
}
from
'
graphql/data/Token
'
import
{
useOnClickOutside
}
from
'
hooks/useOnClickOutside
'
import
{
useOnClickOutside
}
from
'
hooks/useOnClickOutside
'
import
{
useRef
}
from
'
react
'
import
{
useRef
}
from
'
react
'
import
{
Twitter
}
from
'
react-feather
'
import
{
Twitter
}
from
'
react-feather
'
...
@@ -62,9 +64,8 @@ const ShareAction = styled.div`
...
@@ -62,9 +64,8 @@ const ShareAction = styled.div`
`
`
interface
TokenInfo
{
interface
TokenInfo
{
tokenName
:
string
token
:
NonNullable
<
SingleTokenData
>
tokenSymbol
:
string
isNative
:
boolean
tokenAddress
:
string
}
}
export
default
function
ShareButton
(
tokenInfo
:
TokenInfo
)
{
export
default
function
ShareButton
(
tokenInfo
:
TokenInfo
)
{
...
@@ -75,11 +76,12 @@ export default function ShareButton(tokenInfo: TokenInfo) {
...
@@ -75,11 +76,12 @@ export default function ShareButton(tokenInfo: TokenInfo) {
useOnClickOutside
(
node
,
open
?
toggleShare
:
undefined
)
useOnClickOutside
(
node
,
open
?
toggleShare
:
undefined
)
const
positionX
=
(
window
.
screen
.
width
-
TWITTER_WIDTH
)
/
2
const
positionX
=
(
window
.
screen
.
width
-
TWITTER_WIDTH
)
/
2
const
positionY
=
(
window
.
screen
.
height
-
TWITTER_HEIGHT
)
/
2
const
positionY
=
(
window
.
screen
.
height
-
TWITTER_HEIGHT
)
/
2
const
tokenAddress
=
tokenInfo
.
isNative
?
NATIVE_CHAIN_ID
:
tokenInfo
.
token
.
address
const
shareTweet
=
()
=>
{
const
shareTweet
=
()
=>
{
toggleShare
()
toggleShare
()
window
.
open
(
window
.
open
(
`https://twitter.com/intent/tweet?text=Check%20out%20
${
tokenInfo
.
token
Name
}
%20(
${
tokenInfo
.
tokenSymbol
}
)%20https://app.uniswap.org/%23/tokens/
${
tokenInfo
.
tokenAddress
}
%20via%20@uniswap`
,
`https://twitter.com/intent/tweet?text=Check%20out%20
${
tokenInfo
.
token
.
name
}
%20(
${
tokenInfo
.
token
.
symbol
}
)%20https://app.uniswap.org/%23/tokens/
${
tokenInfo
.
token
.
chain
}
/
${
tokenAddress
}
%20via%20@uniswap`
,
'
newwindow
'
,
'
newwindow
'
,
`left=
${
positionX
}
, top=
${
positionY
}
, width=
${
TWITTER_WIDTH
}
, height=
${
TWITTER_HEIGHT
}
`
`left=
${
positionX
}
, top=
${
positionY
}
, width=
${
TWITTER_WIDTH
}
, height=
${
TWITTER_HEIGHT
}
`
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment