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
a57c19bb
Unverified
Commit
a57c19bb
authored
Nov 03, 2022
by
Greg Bugyis
Committed by
GitHub
Nov 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Collection Activity mobile fixes (#5073)
parent
9fd6ab01
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
Activity.css.ts
src/nft/components/collection/Activity.css.ts
+1
-1
Activity.tsx
src/nft/components/collection/Activity.tsx
+9
-1
ActivityCells.tsx
src/nft/components/collection/ActivityCells.tsx
+11
-4
collection.ts
src/nft/types/collection/collection.ts
+4
-4
No files found.
src/nft/components/collection/Activity.css.ts
View file @
a57c19bb
...
...
@@ -29,7 +29,7 @@ export const eventRow = style([
baseRow
,
sprinkles
({
paddingY
:
'
12
'
,
paddingX
:
'
16
'
,
paddingX
:
{
sm
:
'
4
'
,
md
:
'
16
'
}
,
color
:
'
textPrimary
'
,
cursor
:
'
pointer
'
,
borderWidth
:
'
1px
'
,
...
...
src/nft/components/collection/Activity.tsx
View file @
a57c19bb
...
...
@@ -156,11 +156,19 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName, chai
>
{
events
.
map
((
event
,
i
)
=>
(
<
Box
as=
"a"
href=
{
baseHref
(
event
)
}
className=
{
styles
.
eventRow
}
key=
{
i
}
>
<
ItemCell
event=
{
event
}
rarityVerified=
{
rarityVerified
}
collectionName=
{
collectionName
}
/>
<
ItemCell
event=
{
event
}
rarityVerified=
{
rarityVerified
}
collectionName=
{
collectionName
}
eventTimestamp=
{
event
.
eventTimestamp
}
isMobile=
{
isMobile
}
/>
<
EventCell
eventType=
{
event
.
eventType
}
eventTimestamp=
{
event
.
eventTimestamp
}
eventTransactionHash=
{
event
.
transactionHash
}
price=
{
event
.
price
}
isMobile=
{
isMobile
}
/>
<
PriceCell
marketplace=
{
event
.
marketplace
}
price=
{
event
.
price
}
/>
<
AddressCell
address=
{
event
.
fromAddress
}
chainId=
{
chainId
}
/>
...
...
src/nft/components/collection/ActivityCells.tsx
View file @
a57c19bb
...
...
@@ -204,6 +204,8 @@ interface EventCellProps {
eventType
:
ActivityEventType
eventTimestamp
?:
number
eventTransactionHash
?:
string
price
?:
string
isMobile
:
boolean
}
const
renderEventIcon
=
(
eventType
:
ActivityEventType
)
=>
{
...
...
@@ -241,19 +243,21 @@ const eventColors = (eventType: ActivityEventType) => {
return
activityEvents
[
eventType
]
as
'
gold
'
|
'
green
'
|
'
violet
'
|
'
accentFailure
'
}
export
const
EventCell
=
({
eventType
,
eventTimestamp
,
eventTransactionHash
}:
EventCellProps
)
=>
{
export
const
EventCell
=
({
eventType
,
eventTimestamp
,
eventTransactionHash
,
price
,
isMobile
}:
EventCellProps
)
=>
{
const
formattedPrice
=
useMemo
(()
=>
(
price
?
putCommas
(
formatEthPrice
(
price
))?.
toString
()
:
null
),
[
price
])
return
(
<
Column
height=
"full"
justifyContent=
"center"
gap=
"4"
>
<
Row
className=
{
styles
.
eventDetail
}
color=
{
eventColors
(
eventType
)
}
>
{
renderEventIcon
(
eventType
)
}
{
ActivityEventTypeDisplay
[
eventType
]
}
</
Row
>
{
eventTimestamp
&&
isValidDate
(
eventTimestamp
)
&&
(
{
eventTimestamp
&&
isValidDate
(
eventTimestamp
)
&&
!
isMobile
&&
(
<
Row
className=
{
styles
.
eventTime
}
>
{
getTimeDifference
(
eventTimestamp
.
toString
())
}
{
eventTransactionHash
&&
<
ExternalLinkIcon
transactionHash=
{
eventTransactionHash
}
/>
}
</
Row
>
)
}
{
isMobile
&&
price
&&
<
Row
fontSize=
"16"
fontWeight=
"normal"
color=
"textPrimary"
>
{
`${formattedPrice} ETH`
}
</
Row
>
}
</
Column
>
)
}
...
...
@@ -262,6 +266,8 @@ interface ItemCellProps {
event
:
ActivityEvent
rarityVerified
:
boolean
collectionName
:
string
isMobile
:
boolean
eventTimestamp
?:
number
}
const
NoContentContainer
=
()
=>
(
...
...
@@ -335,7 +341,7 @@ const getItemImage = (tokenMetadata?: TokenMetadata): string | undefined => {
return
tokenMetadata
?.
smallImageUrl
||
tokenMetadata
?.
imageUrl
}
export
const
ItemCell
=
({
event
,
rarityVerified
,
collectionName
}:
ItemCellProps
)
=>
{
export
const
ItemCell
=
({
event
,
rarityVerified
,
collectionName
,
eventTimestamp
,
isMobile
}:
ItemCellProps
)
=>
{
const
[
loaded
,
setLoaded
]
=
useState
(
false
)
const
[
noContent
,
setNoContent
]
=
useState
(
!
getItemImage
(
event
.
tokenMetadata
))
...
...
@@ -359,13 +365,14 @@ export const ItemCell = ({ event, rarityVerified, collectionName }: ItemCellProp
)
}
<
Column
height=
"full"
justifyContent=
"center"
overflow=
"hidden"
whiteSpace=
"nowrap"
marginRight=
"24"
>
<
Box
className=
{
styles
.
detailsName
}
>
{
event
.
tokenMetadata
?.
name
||
event
.
tokenId
}
</
Box
>
{
event
.
tokenMetadata
?.
rarity
&&
(
{
event
.
tokenMetadata
?.
rarity
&&
!
isMobile
&&
(
<
Ranking
rarity=
{
event
.
tokenMetadata
?.
rarity
}
rarityVerified=
{
rarityVerified
}
collectionName=
{
collectionName
}
/>
)
}
{
isMobile
&&
eventTimestamp
&&
isValidDate
(
eventTimestamp
)
&&
getTimeDifference
(
eventTimestamp
.
toString
())
}
</
Column
>
</
Row
>
)
...
...
src/nft/types/collection/collection.ts
View file @
a57c19bb
...
...
@@ -48,10 +48,10 @@ export enum ActivityEventType {
}
export
enum
ActivityEventTypeDisplay
{
'
LISTING
'
=
'
List
ing
'
,
'
SALE
'
=
'
S
ale
'
,
'
TRANSFER
'
=
'
Transfer
'
,
'
CANCEL_LISTING
'
=
'
Cancel
'
,
'
LISTING
'
=
'
List
ed
'
,
'
SALE
'
=
'
S
old
'
,
'
TRANSFER
'
=
'
Transfer
red
'
,
'
CANCEL_LISTING
'
=
'
Cancel
led
'
,
}
export
enum
OrderStatus
{
...
...
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