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
c9e2f86e
Unverified
Commit
c9e2f86e
authored
Aug 26, 2022
by
lynn
Committed by
GitHub
Aug 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add i18n to token detail and token explore (#4510)
init
parent
8c019911
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
12 deletions
+25
-12
FooterBalanceSummary.tsx
src/components/Tokens/TokenDetails/FooterBalanceSummary.tsx
+12
-4
ShareButton.tsx
src/components/Tokens/TokenDetails/ShareButton.tsx
+3
-2
TokenDetail.tsx
src/components/Tokens/TokenDetails/TokenDetail.tsx
+2
-2
FavoriteButton.tsx
src/components/Tokens/TokenTable/FavoriteButton.tsx
+4
-1
TokenTable.tsx
src/components/Tokens/TokenTable/TokenTable.tsx
+4
-3
No files found.
src/components/Tokens/TokenDetails/FooterBalanceSummary.tsx
View file @
c9e2f86e
import
{
Trans
}
from
'
@lingui/macro
'
import
{
useToken
}
from
'
hooks/Tokens
'
import
{
useToken
}
from
'
hooks/Tokens
'
import
{
useNetworkTokenBalances
}
from
'
hooks/useNetworkTokenBalances
'
import
{
useNetworkTokenBalances
}
from
'
hooks/useNetworkTokenBalances
'
import
{
useState
}
from
'
react
'
import
{
useState
}
from
'
react
'
...
@@ -152,7 +153,9 @@ export default function FooterBalanceSummary({
...
@@ -152,7 +153,9 @@ export default function FooterBalanceSummary({
)
:
error
?
(
)
:
error
?
(
<
ErrorState
>
<
ErrorState
>
<
AlertTriangle
size=
{
17
}
/>
<
AlertTriangle
size=
{
17
}
/>
<
ErrorText
>
There was an error fetching your balance
</
ErrorText
>
<
ErrorText
>
<
Trans
>
There was an error fetching your balance
</
Trans
>
</
ErrorText
>
</
ErrorState
>
</
ErrorState
>
)
:
(
)
:
(
<
BalanceInfo
>
<
BalanceInfo
>
...
@@ -165,16 +168,21 @@ export default function FooterBalanceSummary({
...
@@ -165,16 +168,21 @@ export default function FooterBalanceSummary({
</
BalanceTotal
>
</
BalanceTotal
>
{
multipleBalances
&&
(
{
multipleBalances
&&
(
<
ViewAll
onClick=
{
()
=>
setShowMultipleBalances
(
!
showMultipleBalances
)
}
>
<
ViewAll
onClick=
{
()
=>
setShowMultipleBalances
(
!
showMultipleBalances
)
}
>
{
showMultipleBalances
?
'
Hide
'
:
'
View
'
}
all balances
<
Trans
>
{
showMultipleBalances
?
'
Hide
'
:
'
View
'
}
all balances
</
Trans
>
</
ViewAll
>
</
ViewAll
>
)
}
)
}
</
BalanceInfo
>
</
BalanceInfo
>
)
}
)
}
<
SwapButton
onClick=
{
()
=>
(
window
.
location
.
href
=
'
https://app.uniswap.org/#/swap
'
)
}
>
Swap
</
SwapButton
>
<
SwapButton
onClick=
{
()
=>
(
window
.
location
.
href
=
'
https://app.uniswap.org/#/swap
'
)
}
>
<
Trans
>
Swap
</
Trans
>
</
SwapButton
>
</
TotalBalancesSection
>
</
TotalBalancesSection
>
{
showMultipleBalances
&&
(
{
showMultipleBalances
&&
(
<
NetworkBalancesSection
>
<
NetworkBalancesSection
>
<
NetworkBalancesLabel
>
Your balances by network
</
NetworkBalancesLabel
>
{
networkBalances
}
<
NetworkBalancesLabel
>
<
Trans
>
Your balances by network
</
Trans
>
</
NetworkBalancesLabel
>
{
'
'
}
{
networkBalances
}
</
NetworkBalancesSection
>
</
NetworkBalancesSection
>
)
}
)
}
<
FakeFooterNavBar
>
**leaving space for updated nav footer**
</
FakeFooterNavBar
>
<
FakeFooterNavBar
>
**leaving space for updated nav footer**
</
FakeFooterNavBar
>
...
...
src/components/Tokens/TokenDetails/ShareButton.tsx
View file @
c9e2f86e
import
{
Trans
}
from
'
@lingui/macro
'
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
'
...
@@ -98,13 +99,13 @@ export default function ShareButton(tokenInfo: TokenInfo) {
...
@@ -98,13 +99,13 @@ export default function ShareButton(tokenInfo: TokenInfo) {
toCopy=
{
window
.
location
.
href
}
toCopy=
{
window
.
location
.
href
}
ref=
{
copyHelperRef
}
ref=
{
copyHelperRef
}
>
>
Copy Link
<
Trans
>
Copy Link
</
Trans
>
</
CopyHelper
>
</
CopyHelper
>
</
ShareAction
>
</
ShareAction
>
<
ShareAction
onClick=
{
shareTweet
}
>
<
ShareAction
onClick=
{
shareTweet
}
>
<
Twitter
color=
{
theme
.
textPrimary
}
size=
{
20
}
strokeWidth=
{
1.5
}
/>
<
Twitter
color=
{
theme
.
textPrimary
}
size=
{
20
}
strokeWidth=
{
1.5
}
/>
Share to Twitter
<
Trans
>
Share to Twitter
</
Trans
>
</
ShareAction
>
</
ShareAction
>
</
ShareActions
>
</
ShareActions
>
)
}
)
}
...
...
src/components/Tokens/TokenDetails/TokenDetail.tsx
View file @
c9e2f86e
...
@@ -245,7 +245,7 @@ export default function LoadedTokenDetail({ address }: { address: string }) {
...
@@ -245,7 +245,7 @@ export default function LoadedTokenDetail({ address }: { address: string }) {
<
StatsSection
>
<
StatsSection
>
<
StatPair
>
<
StatPair
>
<
Stat
>
<
Stat
>
Market cap
<
Trans
>
Market cap
</
Trans
>
<
StatPrice
>
<
StatPrice
>
{
tokenDetailData
.
marketCap
?.
value
?
formatDollarAmount
(
tokenDetailData
.
marketCap
?.
value
)
:
'
-
'
}
{
tokenDetailData
.
marketCap
?.
value
?
formatDollarAmount
(
tokenDetailData
.
marketCap
?.
value
)
:
'
-
'
}
</
StatPrice
>
</
StatPrice
>
...
@@ -275,7 +275,7 @@ export default function LoadedTokenDetail({ address }: { address: string }) {
...
@@ -275,7 +275,7 @@ export default function LoadedTokenDetail({ address }: { address: string }) {
<
AboutSection
address=
{
address
}
tokenDetailData=
{
relevantTokenDetailData
}
/>
<
AboutSection
address=
{
address
}
tokenDetailData=
{
relevantTokenDetailData
}
/>
<
ContractAddressSection
>
<
ContractAddressSection
>
<
Contract
>
<
Contract
>
Contract address
<
Trans
>
Contract address
</
Trans
>
<
ContractAddress
>
<
ContractAddress
>
<
CopyContractAddress
address=
{
address
}
/>
<
CopyContractAddress
address=
{
address
}
/>
</
ContractAddress
>
</
ContractAddress
>
...
...
src/components/Tokens/TokenTable/FavoriteButton.tsx
View file @
c9e2f86e
import
{
Trans
}
from
'
@lingui/macro
'
import
{
useAtom
}
from
'
jotai
'
import
{
useAtom
}
from
'
jotai
'
import
{
Heart
}
from
'
react-feather
'
import
{
Heart
}
from
'
react-feather
'
import
styled
,
{
useTheme
}
from
'
styled-components/macro
'
import
styled
,
{
useTheme
}
from
'
styled-components/macro
'
...
@@ -38,7 +39,9 @@ export default function FavoriteButton() {
...
@@ -38,7 +39,9 @@ export default function FavoriteButton() {
<
StyledFavoriteButton
onClick=
{
()
=>
setShowFavorites
(
!
showFavorites
)
}
active=
{
showFavorites
}
>
<
StyledFavoriteButton
onClick=
{
()
=>
setShowFavorites
(
!
showFavorites
)
}
active=
{
showFavorites
}
>
<
FavoriteButtonContent
>
<
FavoriteButtonContent
>
<
Heart
size=
{
17
}
color=
{
showFavorites
?
theme
.
white
:
theme
.
textPrimary
}
fill=
"transparent"
/>
<
Heart
size=
{
17
}
color=
{
showFavorites
?
theme
.
white
:
theme
.
textPrimary
}
fill=
"transparent"
/>
<
FavoriteText
>
Favorites
</
FavoriteText
>
<
FavoriteText
>
<
Trans
>
Favorites
</
Trans
>
</
FavoriteText
>
</
FavoriteButtonContent
>
</
FavoriteButtonContent
>
</
StyledFavoriteButton
>
</
StyledFavoriteButton
>
)
)
...
...
src/components/Tokens/TokenTable/TokenTable.tsx
View file @
c9e2f86e
import
{
Trans
}
from
'
@lingui/macro
'
import
{
import
{
favoritesAtom
,
favoritesAtom
,
filterStringAtom
,
filterStringAtom
,
...
@@ -161,7 +162,7 @@ export default function TokenTable({ data }: { data: TokenData[] | undefined })
...
@@ -161,7 +162,7 @@ export default function TokenTable({ data }: { data: TokenData[] | undefined })
message=
{
message=
{
<>
<>
<
AlertTriangle
size=
{
16
}
/>
<
AlertTriangle
size=
{
16
}
/>
An error occured loading tokens. Please try again.
<
Trans
>
An error occured loading tokens. Please try again.
</
Trans
>
</>
</>
}
}
/>
/>
...
@@ -169,11 +170,11 @@ export default function TokenTable({ data }: { data: TokenData[] | undefined })
...
@@ -169,11 +170,11 @@ export default function TokenTable({ data }: { data: TokenData[] | undefined })
}
}
if
(
showFavorites
&&
sortedFilteredTokens
?.
length
===
0
)
{
if
(
showFavorites
&&
sortedFilteredTokens
?.
length
===
0
)
{
return
<
NoTokensState
message=
"You have no favorited tokens"
/>
return
<
NoTokensState
message=
{
<
Trans
>
You have no favorited tokens
</
Trans
>
}
/>
}
}
if
(
!
showFavorites
&&
sortedFilteredTokens
?.
length
===
0
)
{
if
(
!
showFavorites
&&
sortedFilteredTokens
?.
length
===
0
)
{
return
<
NoTokensState
message=
"No tokens found"
/>
return
<
NoTokensState
message=
{
<
Trans
>
No tokens found
</
Trans
>
}
/>
}
}
return
(
return
(
...
...
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