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
155bf2e8
Unverified
Commit
155bf2e8
authored
Nov 01, 2022
by
Jack Short
Committed by
GitHub
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: updated collection cards (#5047)
parent
6e282a6d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
187 deletions
+231
-187
Card.css.ts
src/nft/components/collection/Card.css.ts
+16
-6
Card.tsx
src/nft/components/collection/Card.tsx
+168
-123
CollectionAsset.tsx
src/nft/components/collection/CollectionAsset.tsx
+41
-42
CollectionAssetLoading.tsx
src/nft/components/collection/CollectionAssetLoading.tsx
+0
-5
icons.tsx
src/nft/components/icons.tsx
+5
-10
sprinkles.css.ts
src/nft/css/sprinkles.css.ts
+1
-1
No files found.
src/nft/components/collection/Card.css.ts
View file @
155bf2e8
...
@@ -7,6 +7,8 @@ export const card = style([
...
@@ -7,6 +7,8 @@ export const card = style([
overflow
:
'
hidden
'
,
overflow
:
'
hidden
'
,
borderStyle
:
'
solid
'
,
borderStyle
:
'
solid
'
,
borderWidth
:
'
1px
'
,
borderWidth
:
'
1px
'
,
paddingBottom
:
'
12
'
,
boxShadow
:
'
shallow
'
,
}),
}),
{
{
boxSizing
:
'
border-box
'
,
boxSizing
:
'
border-box
'
,
...
@@ -20,9 +22,6 @@ export const card = style([
...
@@ -20,9 +22,6 @@ export const card = style([
},
},
},
},
},
},
'
:hover
'
:
{
boxShadow
:
themeVars
.
shadows
.
deep
,
},
},
},
])
])
...
@@ -34,8 +33,13 @@ export const notSelectedCard = style([
...
@@ -34,8 +33,13 @@ export const notSelectedCard = style([
card
,
card
,
sprinkles
({
sprinkles
({
backgroundColor
:
'
backgroundSurface
'
,
backgroundColor
:
'
backgroundSurface
'
,
borderColor
:
'
transparent
'
,
borderColor
:
'
backgroundOutline
'
,
}),
}),
{
'
:hover
'
:
{
backgroundColor
:
themeVars
.
colors
.
stateOverlayHover
,
},
},
])
])
export
const
cardImageHover
=
style
({
export
const
cardImageHover
=
style
({
...
@@ -45,9 +49,15 @@ export const cardImageHover = style({
...
@@ -45,9 +49,15 @@ export const cardImageHover = style({
export
const
selectedCard
=
style
([
export
const
selectedCard
=
style
([
card
,
card
,
sprinkles
({
sprinkles
({
background
:
'
lightGrayOverlay
'
,
background
:
'
backgroundSurface
'
,
borderColor
:
'
backgroundOutline
'
,
borderColor
:
'
accentAction
'
,
borderWidth
:
'
3px
'
,
}),
}),
{
'
:hover
'
:
{
backgroundColor
:
themeVars
.
colors
.
stateOverlayHover
,
},
},
])
])
export
const
button
=
style
([
export
const
button
=
style
([
...
...
src/nft/components/collection/Card.tsx
View file @
155bf2e8
This diff is collapsed.
Click to expand it.
src/nft/components/collection/CollectionAsset.tsx
View file @
155bf2e8
...
@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
...
@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import
{
useBag
}
from
'
nft/hooks
'
import
{
useBag
}
from
'
nft/hooks
'
import
{
GenieAsset
,
Markets
,
UniformHeight
}
from
'
nft/types
'
import
{
GenieAsset
,
Markets
,
UniformHeight
}
from
'
nft/types
'
import
{
formatWeiToDecimal
,
isAudio
,
isVideo
,
rarityProviderLogo
}
from
'
nft/utils
'
import
{
formatWeiToDecimal
,
isAudio
,
isVideo
,
rarityProviderLogo
}
from
'
nft/utils
'
import
{
MouseEvent
,
useMemo
}
from
'
react
'
import
{
useMemo
}
from
'
react
'
import
*
as
Card
from
'
./Card
'
import
*
as
Card
from
'
./Card
'
...
@@ -73,24 +73,45 @@ export const CollectionAsset = ({
...
@@ -73,24 +73,45 @@ export const CollectionAsset = ({
},
[
asset
])
},
[
asset
])
return
(
return
(
<
Card
.
Container
asset=
{
asset
}
selected=
{
isSelected
}
>
<
Card
.
Container
{
assetMediaType
===
AssetMediaType
.
Image
?
(
asset=
{
asset
}
<
Card
.
Image
uniformHeight=
{
uniformHeight
}
setUniformHeight=
{
setUniformHeight
}
/>
selected=
{
isSelected
}
)
:
assetMediaType
===
AssetMediaType
.
Video
?
(
addAssetToBag=
{
()
=>
{
<
Card
.
Video
addAssetsToBag
([
asset
])
uniformHeight=
{
uniformHeight
}
!
bagExpanded
&&
!
isMobile
&&
toggleBag
()
setUniformHeight=
{
setUniformHeight
}
}
}
shouldPlay=
{
mediaShouldBePlaying
}
removeAssetFromBag=
{
()
=>
{
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
removeAssetsFromBag
([
asset
])
/>
}
}
)
:
(
>
<
Card
.
Audio
<
Card
.
ImageContainer
>
uniformHeight=
{
uniformHeight
}
{
asset
.
tokenType
===
'
ERC1155
'
&&
quantity
>
0
&&
<
Card
.
Erc1155Controls
quantity=
{
quantity
.
toString
()
}
/>
}
setUniformHeight=
{
setUniformHeight
}
{
asset
.
rarity
&&
provider
&&
provider
.
rank
&&
(
shouldPlay=
{
mediaShouldBePlaying
}
<
Card
.
Ranking
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
rarity=
{
asset
.
rarity
}
/>
provider=
{
provider
}
)
}
rarityVerified=
{
!!
rarityVerified
}
rarityLogo=
{
rarityLogo
}
/>
)
}
{
assetMediaType
===
AssetMediaType
.
Image
?
(
<
Card
.
Image
uniformHeight=
{
uniformHeight
}
setUniformHeight=
{
setUniformHeight
}
/>
)
:
assetMediaType
===
AssetMediaType
.
Video
?
(
<
Card
.
Video
uniformHeight=
{
uniformHeight
}
setUniformHeight=
{
setUniformHeight
}
shouldPlay=
{
mediaShouldBePlaying
}
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
/>
)
:
(
<
Card
.
Audio
uniformHeight=
{
uniformHeight
}
setUniformHeight=
{
setUniformHeight
}
shouldPlay=
{
mediaShouldBePlaying
}
setCurrentTokenPlayingMedia=
{
setCurrentTokenPlayingMedia
}
/>
)
}
</
Card
.
ImageContainer
>
<
Card
.
DetailsContainer
>
<
Card
.
DetailsContainer
>
<
Card
.
InfoContainer
>
<
Card
.
InfoContainer
>
<
Card
.
PrimaryRow
>
<
Card
.
PrimaryRow
>
...
@@ -98,14 +119,7 @@ export const CollectionAsset = ({
...
@@ -98,14 +119,7 @@ export const CollectionAsset = ({
<
Card
.
PrimaryInfo
>
{
asset
.
name
?
asset
.
name
:
`#${asset.tokenId}`
}
</
Card
.
PrimaryInfo
>
<
Card
.
PrimaryInfo
>
{
asset
.
name
?
asset
.
name
:
`#${asset.tokenId}`
}
</
Card
.
PrimaryInfo
>
{
asset
.
susFlag
&&
<
Card
.
Suspicious
/>
}
{
asset
.
susFlag
&&
<
Card
.
Suspicious
/>
}
</
Card
.
PrimaryDetails
>
</
Card
.
PrimaryDetails
>
{
asset
.
rarity
&&
provider
&&
provider
.
rank
&&
(
<
Card
.
DetailsLink
/>
<
Card
.
Ranking
rarity=
{
asset
.
rarity
}
provider=
{
provider
}
rarityVerified=
{
!!
rarityVerified
}
rarityLogo=
{
rarityLogo
}
/>
)
}
</
Card
.
PrimaryRow
>
</
Card
.
PrimaryRow
>
<
Card
.
SecondaryRow
>
<
Card
.
SecondaryRow
>
<
Card
.
SecondaryDetails
>
<
Card
.
SecondaryDetails
>
...
@@ -119,21 +133,6 @@ export const CollectionAsset = ({
...
@@ -119,21 +133,6 @@ export const CollectionAsset = ({
)
}
)
}
</
Card
.
SecondaryRow
>
</
Card
.
SecondaryRow
>
</
Card
.
InfoContainer
>
</
Card
.
InfoContainer
>
<
Card
.
Button
quantity=
{
quantity
}
selectedChildren=
{
'
Remove
'
}
onClick=
{
(
e
:
MouseEvent
)
=>
{
e
.
preventDefault
()
addAssetsToBag
([
asset
])
!
bagExpanded
&&
!
isMobile
&&
toggleBag
()
}
}
onSelectedClick=
{
(
e
:
MouseEvent
)
=>
{
e
.
preventDefault
()
removeAssetsFromBag
([
asset
])
}
}
>
{
'
Buy now
'
}
</
Card
.
Button
>
</
Card
.
DetailsContainer
>
</
Card
.
DetailsContainer
>
</
Card
.
Container
>
</
Card
.
Container
>
)
)
...
...
src/nft/components/collection/CollectionAssetLoading.tsx
View file @
155bf2e8
...
@@ -14,14 +14,9 @@ export const CollectionAssetLoading = () => {
...
@@ -14,14 +14,9 @@ export const CollectionAssetLoading = () => {
</
Box
>
</
Box
>
<
Row
justifyContent=
"space-between"
marginTop=
"12"
paddingLeft=
"12"
paddingRight=
"12"
>
<
Row
justifyContent=
"space-between"
marginTop=
"12"
paddingLeft=
"12"
paddingRight=
"12"
>
<
Box
as=
"div"
className=
{
loadingAsset
}
height=
"12"
width=
"120"
></
Box
>
<
Box
as=
"div"
className=
{
loadingAsset
}
height=
"12"
width=
"120"
></
Box
>
<
Box
as=
"div"
className=
{
loadingAsset
}
width=
"36"
height=
"12"
></
Box
>
</
Row
>
</
Row
>
<
Row
justifyContent=
"space-between"
marginTop=
"12"
paddingLeft=
"12"
paddingRight=
"12"
>
<
Row
justifyContent=
"space-between"
marginTop=
"12"
paddingLeft=
"12"
paddingRight=
"12"
>
<
Box
as=
"div"
className=
{
loadingAsset
}
height=
"16"
width=
"80"
></
Box
>
<
Box
as=
"div"
className=
{
loadingAsset
}
height=
"16"
width=
"80"
></
Box
>
<
Box
as=
"div"
className=
{
loadingAsset
}
width=
"16"
height=
"16"
borderRadius=
"4"
></
Box
>
</
Row
>
<
Row
marginTop=
"12"
paddingLeft=
"12"
paddingRight=
"12"
>
<
Box
as=
"div"
className=
{
loadingAsset
}
width=
"full"
height=
"32"
></
Box
>
</
Row
>
</
Row
>
</
Box
>
</
Box
>
)
)
...
...
src/nft/components/icons.tsx
View file @
155bf2e8
...
@@ -1239,20 +1239,15 @@ export const SuspiciousIcon20 = (props: SVGProps) => (
...
@@ -1239,20 +1239,15 @@ export const SuspiciousIcon20 = (props: SVGProps) => (
)
)
export
const
MinusIconLarge
=
(
props
:
SVGProps
)
=>
(
export
const
MinusIconLarge
=
(
props
:
SVGProps
)
=>
(
<
svg
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
{
...
props
}
>
<
svg
{
...
props
}
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
path
<
path
d=
"M5 12H19"
stroke=
"currentColor"
strokeWidth=
"2"
strokeLinecap=
"round"
strokeLinejoin=
"round"
/>
d=
"M8.72879 16.7601H23.2734C23.8862 16.7601 24.4085 16.2478 24.4085 15.615C24.4085 14.9922 23.8862 14.4699 23.2734 14.4699H8.72879C8.13616 14.4699 7.59375 14.9922 7.59375 15.615C7.59375 16.2478 8.13616 16.7601 8.72879 16.7601Z"
fill=
"currentColor"
/>
</
svg
>
</
svg
>
)
)
export
const
PlusIconLarge
=
(
props
:
SVGProps
)
=>
(
export
const
PlusIconLarge
=
(
props
:
SVGProps
)
=>
(
<
svg
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
{
...
props
}
>
<
svg
{
...
props
}
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
path
<
path
d=
"M12 5V19"
stroke=
"currentColor"
strokeWidth=
"2"
strokeLinecap=
"round"
strokeLinejoin=
"round"
/>
d=
"M8.72712 16.75H14.8544V22.8772C14.8544 23.5 15.3666 24.0223 15.9994 24.0223C16.6323 24.0223 17.1445 23.5 17.1445 22.8772V16.75H23.2718C23.8945 16.75 24.4169 16.2377 24.4169 15.6049C24.4169 14.9721 23.8945 14.4598 23.2718 14.4598H17.1445V8.33259C17.1445 7.70982 16.6323 7.1875 15.9994 7.1875C15.3666 7.1875 14.8544 7.70982 14.8544 8.33259V14.4598H8.72712C8.10435 14.4598 7.58203 14.9721 7.58203 15.6049C7.58203 16.2377 8.10435 16.75 8.72712 16.75Z"
<
path
d=
"M5 12H19"
stroke=
"currentColor"
strokeWidth=
"2"
strokeLinecap=
"round"
strokeLinejoin=
"round"
/>
fill=
"currentColor"
/>
</
svg
>
</
svg
>
)
)
...
...
src/nft/css/sprinkles.css.ts
View file @
155bf2e8
...
@@ -265,7 +265,7 @@ const flexAlignment = [
...
@@ -265,7 +265,7 @@ const flexAlignment = [
const
overflow
=
[
'
hidden
'
,
'
inherit
'
,
'
scroll
'
,
'
visible
'
,
'
auto
'
]
as
const
const
overflow
=
[
'
hidden
'
,
'
inherit
'
,
'
scroll
'
,
'
visible
'
,
'
auto
'
]
as
const
const
borderWidth
=
[
'
0px
'
,
'
0.5px
'
,
'
1px
'
,
'
1.5px
'
,
'
2px
'
,
'
4px
'
]
const
borderWidth
=
[
'
0px
'
,
'
0.5px
'
,
'
1px
'
,
'
1.5px
'
,
'
2px
'
,
'
3px
'
,
'
4px
'
]
const
borderStyle
=
[
'
none
'
,
'
solid
'
]
as
const
const
borderStyle
=
[
'
none
'
,
'
solid
'
]
as
const
...
...
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