forked from decentraland/marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: rarity and gender filters + results count * chore: added missing translations * style: reduce padding * chore: address feedback * chore: warning
- Loading branch information
Showing
37 changed files
with
730 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
webapp/src/components/NFTListPage/ArrayFilter/ArrayFilter.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.ArrayFilter { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.ArrayFilter + .ArrayFilter { | ||
margin-top: 14px; | ||
} | ||
|
||
.ArrayFilter .ui.sub.header.name { | ||
margin-bottom: 12px; | ||
font-weight: 600; | ||
} | ||
|
||
.ArrayFilter .options { | ||
display: flex; | ||
flex-flow: wrap; | ||
} | ||
|
||
.ArrayFilter .options .option { | ||
padding: 5px 12px; | ||
background-color: #37333d; | ||
border-radius: 16px; | ||
text-transform: uppercase; | ||
font-weight: 600; | ||
cursor: pointer; | ||
margin-right: 8px; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.ArrayFilter .options .option.selected { | ||
background-color: var(--primary); | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.ArrayFilter { | ||
margin-bottom: 12px; | ||
} | ||
|
||
.ArrayFilter .options .option { | ||
font-size: 13px; | ||
line-height: 18px; | ||
margin-right: 16px; | ||
margin-bottom: 16px; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
webapp/src/components/NFTListPage/ArrayFilter/ArrayFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react' | ||
import { Header } from 'decentraland-ui' | ||
|
||
import { Props } from './ArrayFilter.types' | ||
import './ArrayFilter.css' | ||
|
||
const getClasses = (value: string, values: string[]) => { | ||
const classes = ['option'] | ||
if (values.includes(value)) { | ||
classes.push('selected') | ||
} | ||
return classes.join(' ') | ||
} | ||
|
||
const getNewValues = (value: string, values: string[]) => { | ||
return values.some(x => x === value) | ||
? values.filter(x => x !== value) | ||
: [...values, value] | ||
} | ||
|
||
const ArrayFilter = (props: Props) => { | ||
const { name, values, options, onChange } = props | ||
return ( | ||
<div className="ArrayFilter"> | ||
<Header sub className="name"> | ||
{name} | ||
</Header> | ||
<div className="options"> | ||
{options.map(option => ( | ||
<div | ||
className={getClasses(option.value, values)} | ||
onClick={() => onChange(getNewValues(option.value, values))} | ||
> | ||
{option.label} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ArrayFilter |
6 changes: 6 additions & 0 deletions
6
webapp/src/components/NFTListPage/ArrayFilter/ArrayFilter.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type Props = { | ||
name: string | ||
values: string[] | ||
options: { value: string; label: string }[] | ||
onChange: (newValues: string[]) => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ArrayFilter from './ArrayFilter' | ||
|
||
export { ArrayFilter } |
23 changes: 23 additions & 0 deletions
23
webapp/src/components/NFTListPage/ClearFilter/ClearFilter.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.ClearFilter { | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.ClearFilter .name { | ||
display: inline-block; | ||
color: var(--primary); | ||
font-weight: 600; | ||
text-transform: uppercase; | ||
} | ||
|
||
.ClearFilter .close { | ||
width: 16px; | ||
height: 16px; | ||
background-image: url(../../../images/close.svg); | ||
background-position: center; | ||
background-size: cover; | ||
display: inline-block; | ||
margin-left: 8px; | ||
margin-right: 16px; | ||
} |
16 changes: 16 additions & 0 deletions
16
webapp/src/components/NFTListPage/ClearFilter/ClearFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
|
||
import { Props } from './ClearFilter.types' | ||
import './ClearFilter.css' | ||
|
||
const ClearFilter = (props: Props) => { | ||
const { name, onClear } = props | ||
return ( | ||
<div className="ClearFilter" onClick={onClear}> | ||
<div className="name">{name}</div> | ||
<div className="close" /> | ||
</div> | ||
) | ||
} | ||
|
||
export default ClearFilter |
4 changes: 4 additions & 0 deletions
4
webapp/src/components/NFTListPage/ClearFilter/ClearFilter.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type Props = { | ||
name: string | ||
onClear: () => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ClearFilter from './ClearFilter' | ||
|
||
export { ClearFilter } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.