-
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.
- Loading branch information
1 parent
fed7589
commit d0be683
Showing
26 changed files
with
193 additions
and
83 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
8 changes: 4 additions & 4 deletions
8
...c/components/Artists/Artists.component.js → ...s/Attributes/Artists/Artists.component.js
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React, { Fragment } from "react" | ||
import Artist from "Components/Artist" | ||
|
||
const Artists = ({ artists }) => | ||
artists && | ||
artists.map((artist, index) => ( | ||
const Artists = ({ value }) => | ||
value && | ||
value.map((artist, index) => ( | ||
<Fragment key={artist.artist.id}> | ||
<Artist artist={artist.artist} /> | ||
{index < artists.length - 1 && " " + artist.delimiter + " "} | ||
{index < value.length - 1 && " " + artist.delimiter + " "} | ||
</Fragment> | ||
)) | ||
export default Artists |
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
frontend/src/components/Attributes/Formats/Formats.component.js
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,28 @@ | ||
import React, { Fragment } from "react" | ||
import { useTranslation } from "react-i18next" | ||
import "./Formats.scss" | ||
|
||
const Formats = ({ value, filterFormat }) => { | ||
const { t, i18n } = useTranslation() | ||
return value | ||
? value | ||
.filter(format => format.name !== "All-Media") | ||
.map((format, index) => ( | ||
<Fragment key={index}> | ||
{(index && ", ") || null} | ||
<span | ||
className="format" | ||
onClick={e => { | ||
e.stopPropagation() | ||
filterFormat(format) | ||
}} | ||
key={index} | ||
> | ||
{(format.qty > 1 ? format.qty + "x" : "") + t("format." + format.name, format.name)} | ||
</span> | ||
</Fragment> | ||
)) | ||
: null | ||
} | ||
|
||
export default Formats |
11 changes: 11 additions & 0 deletions
11
frontend/src/components/Attributes/Formats/Formats.container.js
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,11 @@ | ||
import { connect } from "react-redux" | ||
import { addFilter } from "Actions" | ||
import Formats from "./Formats.component" | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
filterFormat: format => { | ||
dispatch(addFilter({ attribute: "formats", compare: "seq", value: format.name })) | ||
}, | ||
}) | ||
|
||
export default connect(null, mapDispatchToProps)(Formats) |
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 @@ | ||
.format { | ||
color: #0000aa; | ||
cursor: pointer; | ||
} |
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 @@ | ||
export { default } from "./Formats.container" |
23 changes: 23 additions & 0 deletions
23
frontend/src/components/Attributes/Genres/Genres.component.js
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 @@ | ||
import React, { Fragment } from "react" | ||
import "./Genres.scss" | ||
|
||
const Genres = ({ value, filterGenre }) => | ||
value | ||
? value.map((genre, index) => ( | ||
<Fragment key={index}> | ||
{(index && ", ") || null} | ||
<span | ||
className="genre" | ||
onClick={e => { | ||
e.stopPropagation() | ||
filterGenre(genre) | ||
}} | ||
key={index} | ||
> | ||
{genre} | ||
</span> | ||
</Fragment> | ||
)) | ||
: null | ||
|
||
export default Genres |
11 changes: 11 additions & 0 deletions
11
frontend/src/components/Attributes/Genres/Genres.container.js
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,11 @@ | ||
import { connect } from "react-redux" | ||
import { addFilter } from "Actions" | ||
import Genres from "./Genres.component" | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
filterGenre: genre => { | ||
dispatch(addFilter({ attribute: "genres", compare: "seq", value: genre })) | ||
}, | ||
}) | ||
|
||
export default connect(null, mapDispatchToProps)(Genres) |
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 @@ | ||
.genre { | ||
color: #0000aa; | ||
cursor: pointer; | ||
} |
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 @@ | ||
export { default } from "./Genres.container" |
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,5 @@ | ||
import React from "react" | ||
|
||
const Price = ({ value, rate }) => <>{value && (value * rate).toFixed(2)}</> | ||
|
||
export default Price |
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,8 @@ | ||
import { connect } from "react-redux" | ||
import Price from "./Price.component" | ||
|
||
const mapStateToProps = state => ({ | ||
rate: state.collection.rate, | ||
}) | ||
|
||
export default connect(mapStateToProps)(Price) |
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 @@ | ||
export { default } from "./Price.container" |
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,17 @@ | ||
import React from "react" | ||
import "./Year.scss" | ||
|
||
const Year = ({ value, filterYear }) => | ||
value ? ( | ||
<span | ||
className="year" | ||
onClick={e => { | ||
e.stopPropagation() | ||
filterYear(value) | ||
}} | ||
> | ||
{value} | ||
</span> | ||
) : null | ||
|
||
export default Year |
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,11 @@ | ||
import { connect } from "react-redux" | ||
import { addFilter } from "Actions" | ||
import Year from "./Year.component" | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
filterYear: year => { | ||
dispatch(addFilter({ attribute: "year", compare: "eq", value: year })) | ||
}, | ||
}) | ||
|
||
export default connect(null, mapDispatchToProps)(Year) |
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 @@ | ||
.year { | ||
color: #0000aa; | ||
cursor: pointer; | ||
} |
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 @@ | ||
export { default } from "./Year.container" |
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,5 @@ | ||
export { default as Artists } from "./Artists" | ||
export { default as Formats } from "./Formats" | ||
export { default as Genres } from "./Genres" | ||
export { default as Price } from "./Price" | ||
export { default as Year } from "./Year" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
import { connect } from "react-redux" | ||
import { showRecord, filterYear } from "Actions" | ||
import { showRecord } from "Actions" | ||
import Record from "./Record.component" | ||
|
||
const mapStateToProps = state => ({ | ||
gridView: state.ui.gridView, | ||
gridColumns: state.ui.gridColumns, | ||
rate: state.collection.rate, | ||
}) | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
handleClick: rec => { | ||
dispatch(showRecord(rec)) | ||
}, | ||
handleYearClick: year => { | ||
dispatch(filterYear(year)) | ||
}, | ||
}) | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(Record) |
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
Oops, something went wrong.