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
2fe444f9
Unverified
Commit
2fe444f9
authored
Nov 01, 2022
by
lynn
Committed by
GitHub
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: make addresses clickable (#5040)
* init * fix * change color to primary * fix * respond to comments
parent
155bf2e8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
9 deletions
+53
-9
Activity.css.ts
src/nft/components/collection/Activity.css.ts
+1
-1
Activity.tsx
src/nft/components/collection/Activity.tsx
+4
-3
ActivityCells.tsx
src/nft/components/collection/ActivityCells.tsx
+31
-2
CollectionStats.css.ts
src/nft/components/collection/CollectionStats.css.ts
+3
-3
sprinkles.css.ts
src/nft/css/sprinkles.css.ts
+5
-0
index.tsx
src/nft/pages/collection/index.tsx
+1
-0
darkTheme.ts
src/nft/themes/darkTheme.ts
+4
-0
lightTheme.ts
src/nft/themes/lightTheme.ts
+4
-0
No files found.
src/nft/components/collection/Activity.css.ts
View file @
2fe444f9
...
@@ -98,7 +98,7 @@ export const eventTime = style([
...
@@ -98,7 +98,7 @@ export const eventTime = style([
])
])
export
const
addressCell
=
style
([
export
const
addressCell
=
style
([
subhead
,
buttonTextMedium
,
sprinkles
({
sprinkles
({
color
:
'
textPrimary
'
,
color
:
'
textPrimary
'
,
height
:
'
full
'
,
height
:
'
full
'
,
...
...
src/nft/components/collection/Activity.tsx
View file @
2fe444f9
...
@@ -39,6 +39,7 @@ interface ActivityProps {
...
@@ -39,6 +39,7 @@ interface ActivityProps {
contractAddress
:
string
contractAddress
:
string
rarityVerified
:
boolean
rarityVerified
:
boolean
collectionName
:
string
collectionName
:
string
chainId
?:
number
}
}
const
initialFilterState
=
{
const
initialFilterState
=
{
...
@@ -54,7 +55,7 @@ const reduceFilters = (state: typeof initialFilterState, action: { eventType: Ac
...
@@ -54,7 +55,7 @@ const reduceFilters = (state: typeof initialFilterState, action: { eventType: Ac
const
baseHref
=
(
event
:
ActivityEvent
)
=>
`/#/nfts/asset/
${
event
.
collectionAddress
}
/
${
event
.
tokenId
}
?origin=activity`
const
baseHref
=
(
event
:
ActivityEvent
)
=>
`/#/nfts/asset/
${
event
.
collectionAddress
}
/
${
event
.
tokenId
}
?origin=activity`
export
const
Activity
=
({
contractAddress
,
rarityVerified
,
collectionName
}:
ActivityProps
)
=>
{
export
const
Activity
=
({
contractAddress
,
rarityVerified
,
collectionName
,
chainId
}:
ActivityProps
)
=>
{
const
[
activeFilters
,
filtersDispatch
]
=
useReducer
(
reduceFilters
,
initialFilterState
)
const
[
activeFilters
,
filtersDispatch
]
=
useReducer
(
reduceFilters
,
initialFilterState
)
const
{
const
{
...
@@ -162,8 +163,8 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName }: Ac
...
@@ -162,8 +163,8 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName }: Ac
eventTransactionHash=
{
event
.
transactionHash
}
eventTransactionHash=
{
event
.
transactionHash
}
/>
/>
<
PriceCell
marketplace=
{
event
.
marketplace
}
price=
{
event
.
price
}
/>
<
PriceCell
marketplace=
{
event
.
marketplace
}
price=
{
event
.
price
}
/>
<
AddressCell
address=
{
event
.
fromAddress
}
/>
<
AddressCell
address=
{
event
.
fromAddress
}
chainId=
{
chainId
}
/>
<
AddressCell
address=
{
event
.
toAddress
}
desktopLBreakpoint
/>
<
AddressCell
address=
{
event
.
toAddress
}
chainId=
{
chainId
}
desktopLBreakpoint
/>
<
BuyCell
<
BuyCell
event=
{
event
}
event=
{
event
}
collectionName=
{
collectionName
}
collectionName=
{
collectionName
}
...
...
src/nft/components/collection/ActivityCells.tsx
View file @
2fe444f9
import
{
ChainId
}
from
'
@uniswap/smart-order-router
'
import
{
MouseoverTooltip
}
from
'
components/Tooltip
'
import
{
MouseoverTooltip
}
from
'
components/Tooltip
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
Column
,
Row
}
from
'
nft/components/Flex
'
...
@@ -26,9 +27,31 @@ import { getTimeDifference, isValidDate } from 'nft/utils/date'
...
@@ -26,9 +27,31 @@ import { getTimeDifference, isValidDate } from 'nft/utils/date'
import
{
putCommas
}
from
'
nft/utils/putCommas
'
import
{
putCommas
}
from
'
nft/utils/putCommas
'
import
{
fallbackProvider
,
getRarityProviderLogo
}
from
'
nft/utils/rarity
'
import
{
fallbackProvider
,
getRarityProviderLogo
}
from
'
nft/utils/rarity
'
import
{
MouseEvent
,
useMemo
,
useState
}
from
'
react
'
import
{
MouseEvent
,
useMemo
,
useState
}
from
'
react
'
import
styled
from
'
styled-components/macro
'
import
{
ExternalLink
}
from
'
theme
'
import
{
ExplorerDataType
,
getExplorerLink
}
from
'
utils/getExplorerLink
'
import
*
as
styles
from
'
./Activity.css
'
import
*
as
styles
from
'
./Activity.css
'
const
AddressLink
=
styled
(
ExternalLink
)
`
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
text-decoration: none;
a {
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
text-decoration: none;
}
a:hover {
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
text-decoration: none;
opacity:
${({
theme
})
=>
theme
.
opacity
.
hover
}
;
}
a:focus {
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
text-decoration: none;
opacity:
${({
theme
})
=>
theme
.
opacity
.
click
}
;
}
`
const
formatListingStatus
=
(
status
:
OrderStatus
):
string
=>
{
const
formatListingStatus
=
(
status
:
OrderStatus
):
string
=>
{
switch
(
status
)
{
switch
(
status
)
{
case
OrderStatus
.
EXECUTED
:
case
OrderStatus
.
EXECUTED
:
...
@@ -102,15 +125,21 @@ export const BuyCell = ({
...
@@ -102,15 +125,21 @@ export const BuyCell = ({
interface
AddressCellProps
{
interface
AddressCellProps
{
address
?:
string
address
?:
string
desktopLBreakpoint
?:
boolean
desktopLBreakpoint
?:
boolean
chainId
?:
number
}
}
export
const
AddressCell
=
({
address
,
desktopLBreakpoint
}:
AddressCellProps
)
=>
{
export
const
AddressCell
=
({
address
,
desktopLBreakpoint
,
chainId
}:
AddressCellProps
)
=>
{
return
(
return
(
<
Column
<
Column
display=
{
{
sm
:
'
none
'
,
xl
:
desktopLBreakpoint
?
'
none
'
:
'
flex
'
,
xxl
:
'
flex
'
}
}
display=
{
{
sm
:
'
none
'
,
xl
:
desktopLBreakpoint
?
'
none
'
:
'
flex
'
,
xxl
:
'
flex
'
}
}
className=
{
styles
.
addressCell
}
className=
{
styles
.
addressCell
}
>
>
<
Box
>
{
address
?
shortenAddress
(
address
,
2
,
4
)
:
'
-
'
}
</
Box
>
<
AddressLink
href=
{
getExplorerLink
(
chainId
??
ChainId
.
MAINNET
,
address
??
''
,
ExplorerDataType
.
ADDRESS
)
}
style=
{
{
textDecoration
:
'
none
'
}
}
>
<
Box
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
{
address
?
shortenAddress
(
address
,
2
,
4
)
:
'
-
'
}
</
Box
>
</
AddressLink
>
</
Column
>
</
Column
>
)
)
}
}
...
...
src/nft/components/collection/CollectionStats.css.ts
View file @
2fe444f9
...
@@ -76,13 +76,13 @@ globalStyle(`${description} a[href]`, {
...
@@ -76,13 +76,13 @@ globalStyle(`${description} a[href]`, {
globalStyle
(
`
${
description
}
a[href]:hover`
,
{
globalStyle
(
`
${
description
}
a[href]:hover`
,
{
color
:
`
${
themeVars
.
colors
.
textSecondary
}
`
,
color
:
`
${
themeVars
.
colors
.
textSecondary
}
`
,
opacity
:
'
0.6
'
,
opacity
:
`
${
themeVars
.
opacity
.
hover
}
`
,
textDecoration
:
'
none
'
,
textDecoration
:
'
none
'
,
})
})
globalStyle
(
`
${
description
}
a[href]:
active
`
,
{
globalStyle
(
`
${
description
}
a[href]:
focus
`
,
{
color
:
`
${
themeVars
.
colors
.
textSecondary
}
`
,
color
:
`
${
themeVars
.
colors
.
textSecondary
}
`
,
opacity
:
'
0.4
'
,
opacity
:
`
${
themeVars
.
opacity
.
pressed
}
`
,
textDecoration
:
'
none
'
,
textDecoration
:
'
none
'
,
})
})
...
...
src/nft/css/sprinkles.css.ts
View file @
2fe444f9
...
@@ -37,6 +37,11 @@ const themeContractValues = {
...
@@ -37,6 +37,11 @@ const themeContractValues = {
deep
:
''
,
deep
:
''
,
shallow
:
''
,
shallow
:
''
,
},
},
opacity
:
{
hover
:
'
0.6
'
,
pressed
:
'
0.4
'
,
},
}
}
export
type
Theme
=
typeof
themeContractValues
export
type
Theme
=
typeof
themeContractValues
...
...
src/nft/pages/collection/index.tsx
View file @
2fe444f9
...
@@ -124,6 +124,7 @@ const Collection = () => {
...
@@ -124,6 +124,7 @@ const Collection = () => {
contractAddress=
{
contractAddress
}
contractAddress=
{
contractAddress
}
rarityVerified=
{
collectionStats
?.
rarityVerified
??
false
}
rarityVerified=
{
collectionStats
?.
rarityVerified
??
false
}
collectionName=
{
collectionStats
?.
name
??
''
}
collectionName=
{
collectionStats
?.
name
??
''
}
chainId=
{
chainId
}
/>
/>
)
)
:
contractAddress
&&
:
contractAddress
&&
...
...
src/nft/themes/darkTheme.ts
View file @
2fe444f9
...
@@ -35,4 +35,8 @@ export const darkTheme: Theme = {
...
@@ -35,4 +35,8 @@ export const darkTheme: Theme = {
deep
:
'
12px 16px 24px rgba(0, 0, 0, 0.24), 12px 8px 12px rgba(0, 0, 0, 0.24), 4px 4px 8px rgba(0, 0, 0, 0.32)
'
,
deep
:
'
12px 16px 24px rgba(0, 0, 0, 0.24), 12px 8px 12px rgba(0, 0, 0, 0.24), 4px 4px 8px rgba(0, 0, 0, 0.32)
'
,
shallow
:
'
4px 4px 10px rgba(0, 0, 0, 0.24), 2px 2px 4px rgba(0, 0, 0, 0.12), 1px 2px 2px rgba(0, 0, 0, 0.12)
'
,
shallow
:
'
4px 4px 10px rgba(0, 0, 0, 0.24), 2px 2px 4px rgba(0, 0, 0, 0.12), 1px 2px 2px rgba(0, 0, 0, 0.12)
'
,
},
},
opacity
:
{
hover
:
'
0.6
'
,
pressed
:
'
0.4
'
,
},
}
}
src/nft/themes/lightTheme.ts
View file @
2fe444f9
...
@@ -35,4 +35,8 @@ export const lightTheme: Theme = {
...
@@ -35,4 +35,8 @@ export const lightTheme: Theme = {
deep
:
'
8px 12px 20px rgba(51, 53, 72, 0.04), 4px 6px 12px rgba(51, 53, 72, 0.02), 4px 4px 8px rgba(51, 53, 72, 0.04)
'
,
deep
:
'
8px 12px 20px rgba(51, 53, 72, 0.04), 4px 6px 12px rgba(51, 53, 72, 0.02), 4px 4px 8px rgba(51, 53, 72, 0.04)
'
,
shallow
:
'
4px 4px 10px rgba(0, 0, 0, 0.24), 2px 2px 4px rgba(0, 0, 0, 0.12), 1px 2px 2px rgba(0, 0, 0, 0.12)
'
,
shallow
:
'
4px 4px 10px rgba(0, 0, 0, 0.24), 2px 2px 4px rgba(0, 0, 0, 0.12), 1px 2px 2px rgba(0, 0, 0, 0.12)
'
,
},
},
opacity
:
{
hover
:
'
0.6
'
,
pressed
:
'
0.4
'
,
},
}
}
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