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
1195be57
Unverified
Commit
1195be57
authored
Nov 29, 2022
by
lynn
Committed by
GitHub
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: button colors (#5435)
* init * fix * respond to comments * respond * fix
parent
3aa98d62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
18 deletions
+28
-18
Activity.css.ts
src/nft/components/collection/Activity.css.ts
+0
-9
Activity.tsx
src/nft/components/collection/Activity.tsx
+17
-5
AssetDetails.tsx
src/nft/components/details/AssetDetails.tsx
+11
-4
No files found.
src/nft/components/collection/Activity.css.ts
View file @
1195be57
...
@@ -173,15 +173,6 @@ export const filter = style([
...
@@ -173,15 +173,6 @@ export const filter = style([
},
},
])
])
export
const
activeFilter
=
style
([
filter
,
sprinkles
({
borderWidth
:
'
1px
'
,
borderStyle
:
'
solid
'
,
borderColor
:
'
genieBlue
'
,
}),
])
export
const
marketplaceIcon
=
style
([
export
const
marketplaceIcon
=
style
([
sprinkles
({
sprinkles
({
width
:
'
16
'
,
width
:
'
16
'
,
...
...
src/nft/components/collection/Activity.tsx
View file @
1195be57
import
clsx
from
'
clsx
'
import
{
OpacityHoverState
}
from
'
components/Common
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
Box
}
from
'
nft/components/Box
'
import
{
LoadingSparkle
}
from
'
nft/components/common/Loading/LoadingSparkle
'
import
{
LoadingSparkle
}
from
'
nft/components/common/Loading/LoadingSparkle
'
import
{
Center
,
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
Center
,
Column
,
Row
}
from
'
nft/components/Flex
'
import
{
themeVars
,
vars
}
from
'
nft/css/sprinkles.css
'
import
{
useBag
,
useIsMobile
}
from
'
nft/hooks
'
import
{
useBag
,
useIsMobile
}
from
'
nft/hooks
'
import
{
ActivityFetcher
}
from
'
nft/queries/genie/ActivityFetcher
'
import
{
ActivityFetcher
}
from
'
nft/queries/genie/ActivityFetcher
'
import
{
ActivityEvent
,
ActivityEventResponse
,
ActivityEventType
}
from
'
nft/types
'
import
{
ActivityEvent
,
ActivityEventResponse
,
ActivityEventType
}
from
'
nft/types
'
...
@@ -9,6 +10,8 @@ import { fetchPrice } from 'nft/utils/fetchPrice'
...
@@ -9,6 +10,8 @@ import { fetchPrice } from 'nft/utils/fetchPrice'
import
{
useCallback
,
useEffect
,
useMemo
,
useReducer
,
useState
}
from
'
react
'
import
{
useCallback
,
useEffect
,
useMemo
,
useReducer
,
useState
}
from
'
react
'
import
InfiniteScroll
from
'
react-infinite-scroll-component
'
import
InfiniteScroll
from
'
react-infinite-scroll-component
'
import
{
useInfiniteQuery
}
from
'
react-query
'
import
{
useInfiniteQuery
}
from
'
react-query
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
styled
from
'
styled-components/macro
'
import
*
as
styles
from
'
./Activity.css
'
import
*
as
styles
from
'
./Activity.css
'
import
{
AddressCell
,
BuyCell
,
EventCell
,
ItemCell
,
PriceCell
}
from
'
./ActivityCells
'
import
{
AddressCell
,
BuyCell
,
EventCell
,
ItemCell
,
PriceCell
}
from
'
./ActivityCells
'
...
@@ -22,6 +25,12 @@ enum ColumnHeaders {
...
@@ -22,6 +25,12 @@ enum ColumnHeaders {
To
=
'
To
'
,
To
=
'
To
'
,
}
}
const
FilterBox
=
styled
.
div
<
{
backgroundColor
:
string
}
>
`
display: flex;
background:
${({
backgroundColor
})
=>
backgroundColor
}
;
${
OpacityHoverState
}
;
`
export
const
HeaderRow
=
()
=>
{
export
const
HeaderRow
=
()
=>
{
return
(
return
(
<
Box
className=
{
styles
.
headerRow
}
>
<
Box
className=
{
styles
.
headerRow
}
>
...
@@ -106,6 +115,7 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName, chai
...
@@ -106,6 +115,7 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName, chai
const
toggleCart
=
useBag
((
state
)
=>
state
.
toggleBag
)
const
toggleCart
=
useBag
((
state
)
=>
state
.
toggleBag
)
const
isMobile
=
useIsMobile
()
const
isMobile
=
useIsMobile
()
const
[
ethPriceInUSD
,
setEthPriceInUSD
]
=
useState
(
0
)
const
[
ethPriceInUSD
,
setEthPriceInUSD
]
=
useState
(
0
)
const
isDarkMode
=
useIsDarkMode
()
useEffect
(()
=>
{
useEffect
(()
=>
{
fetchPrice
().
then
((
price
)
=>
{
fetchPrice
().
then
((
price
)
=>
{
...
@@ -116,17 +126,19 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName, chai
...
@@ -116,17 +126,19 @@ export const Activity = ({ contractAddress, rarityVerified, collectionName, chai
const
Filter
=
useCallback
(
const
Filter
=
useCallback
(
function
ActivityFilter
({
eventType
}:
{
eventType
:
ActivityEventType
})
{
function
ActivityFilter
({
eventType
}:
{
eventType
:
ActivityEventType
})
{
const
isActive
=
activeFilters
[
eventType
]
const
isActive
=
activeFilters
[
eventType
]
const
activeBackgroundColor
=
isDarkMode
?
vars
.
color
.
gray500
:
vars
.
color
.
gray200
return
(
return
(
<
Box
<
FilterBox
className=
{
clsx
(
styles
.
filter
,
isActive
&&
styles
.
activeFilter
)
}
className=
{
styles
.
filter
}
backgroundColor=
{
isActive
?
activeBackgroundColor
:
themeVars
.
colors
.
backgroundInteractive
}
onClick=
{
()
=>
filtersDispatch
({
eventType
})
}
onClick=
{
()
=>
filtersDispatch
({
eventType
})
}
>
>
{
eventType
.
charAt
(
0
)
+
eventType
.
slice
(
1
).
toLowerCase
()
+
'
s
'
}
{
eventType
.
charAt
(
0
)
+
eventType
.
slice
(
1
).
toLowerCase
()
+
'
s
'
}
</
Box
>
</
Filter
Box
>
)
)
},
},
[
activeFilters
]
[
activeFilters
,
isDarkMode
]
)
)
return
(
return
(
...
...
src/nft/components/details/AssetDetails.tsx
View file @
1195be57
...
@@ -6,6 +6,7 @@ import { reduceFilters } from 'nft/components/collection/Activity'
...
@@ -6,6 +6,7 @@ import { reduceFilters } from 'nft/components/collection/Activity'
import
{
LoadingSparkle
}
from
'
nft/components/common/Loading/LoadingSparkle
'
import
{
LoadingSparkle
}
from
'
nft/components/common/Loading/LoadingSparkle
'
import
{
AssetPriceDetails
}
from
'
nft/components/details/AssetPriceDetails
'
import
{
AssetPriceDetails
}
from
'
nft/components/details/AssetPriceDetails
'
import
{
Center
}
from
'
nft/components/Flex
'
import
{
Center
}
from
'
nft/components/Flex
'
import
{
themeVars
,
vars
}
from
'
nft/css/sprinkles.css
'
import
{
ActivityFetcher
}
from
'
nft/queries/genie/ActivityFetcher
'
import
{
ActivityFetcher
}
from
'
nft/queries/genie/ActivityFetcher
'
import
{
ActivityEventResponse
,
ActivityEventType
,
CollectionInfoForAsset
,
GenieAsset
}
from
'
nft/types
'
import
{
ActivityEventResponse
,
ActivityEventType
,
CollectionInfoForAsset
,
GenieAsset
}
from
'
nft/types
'
import
{
shortenAddress
}
from
'
nft/utils/address
'
import
{
shortenAddress
}
from
'
nft/utils/address
'
...
@@ -18,6 +19,7 @@ import { useCallback, useMemo, useReducer, useState } from 'react'
...
@@ -18,6 +19,7 @@ import { useCallback, useMemo, useReducer, useState } from 'react'
import
InfiniteScroll
from
'
react-infinite-scroll-component
'
import
InfiniteScroll
from
'
react-infinite-scroll-component
'
import
{
useInfiniteQuery
,
useQuery
}
from
'
react-query
'
import
{
useInfiniteQuery
,
useQuery
}
from
'
react-query
'
import
{
Link
as
RouterLink
}
from
'
react-router-dom
'
import
{
Link
as
RouterLink
}
from
'
react-router-dom
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
AssetActivity
from
'
./AssetActivity
'
import
AssetActivity
from
'
./AssetActivity
'
...
@@ -122,9 +124,9 @@ const ContentNotAvailable = styled.div`
...
@@ -122,9 +124,9 @@ const ContentNotAvailable = styled.div`
height: 450px;
height: 450px;
`
`
const
FilterBox
=
styled
.
div
<
{
isActive
?:
boolean
}
>
`
const
FilterBox
=
styled
.
div
<
{
backgroundColor
:
string
}
>
`
box-sizing: border-box;
box-sizing: border-box;
background-color:
${({
theme
})
=>
theme
.
backgroundInteractive
}
;
background-color:
${({
backgroundColor
})
=>
backgroundColor
}
;
font-size: 14px;
font-size: 14px;
font-weight: 600;
font-weight: 600;
line-height: 14px;
line-height: 14px;
...
@@ -133,7 +135,6 @@ const FilterBox = styled.div<{ isActive?: boolean }>`
...
@@ -133,7 +135,6 @@ const FilterBox = styled.div<{ isActive?: boolean }>`
border-radius: 12px;
border-radius: 12px;
cursor: pointer;
cursor: pointer;
box-sizing: border-box;
box-sizing: border-box;
border:
${({
isActive
,
theme
})
=>
(
isActive
?
`1px solid
${
theme
.
accentActive
}
`
:
undefined
)}
;
${
OpacityHoverState
}
;
${
OpacityHoverState
}
;
`
`
...
@@ -287,9 +288,15 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
...
@@ -287,9 +288,15 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => {
const
Filter
=
useCallback
(
const
Filter
=
useCallback
(
function
ActivityFilter
({
eventType
}:
{
eventType
:
ActivityEventType
})
{
function
ActivityFilter
({
eventType
}:
{
eventType
:
ActivityEventType
})
{
const
isActive
=
activeFilters
[
eventType
]
const
isActive
=
activeFilters
[
eventType
]
const
isDarkMode
=
useIsDarkMode
()
return
(
return
(
<
FilterBox
isActive=
{
isActive
}
onClick=
{
()
=>
filtersDispatch
({
eventType
})
}
>
<
FilterBox
backgroundColor=
{
isActive
?
(
isDarkMode
?
vars
.
color
.
gray500
:
vars
.
color
.
gray200
)
:
themeVars
.
colors
.
backgroundInteractive
}
onClick=
{
()
=>
filtersDispatch
({
eventType
})
}
>
{
eventType
===
ActivityEventType
.
CancelListing
{
eventType
===
ActivityEventType
.
CancelListing
?
'
Cancellations
'
?
'
Cancellations
'
:
eventType
.
charAt
(
0
)
+
eventType
.
slice
(
1
).
toLowerCase
()
+
'
s
'
}
:
eventType
.
charAt
(
0
)
+
eventType
.
slice
(
1
).
toLowerCase
()
+
'
s
'
}
...
...
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