Rename JavGame to Game because all games are not from or at Jav

This commit is contained in:
pikiou
2022-03-11 13:29:04 +01:00
parent 57057780d8
commit ed8f20072f
17 changed files with 112 additions and 127 deletions

View File

@@ -5,15 +5,15 @@ import { render } from "@testing-library/react"
import { MemoryRouter } from "react-router-dom"
import mockStore from "../../../utils/mockStore"
import JavGameList from "../index"
import GameList from "../index"
describe("<List />", () => {
const renderHelper = (reducer = { readyStatus: "idle" }) => {
const { dispatch, ProviderWithStore } = mockStore({ javGameList: reducer })
const { dispatch, ProviderWithStore } = mockStore({ gameList: reducer })
const { container } = render(
<ProviderWithStore>
<MemoryRouter>
<JavGameList ids={[5]} />
<GameList ids={[5]} />
</MemoryRouter>
</ProviderWithStore>
)
@@ -39,9 +39,6 @@ describe("<List />", () => {
bggPhoto:
"https://cf.geekdo-images.com/thumb/img/lzczxR5cw7an7tRWeHdOrRtLyes=/fit-in/200x150/pic772547.jpg",
bggId: 432,
copies: 1,
lendAvailability: 1,
notStored: 0,
ean: "3421272101313",
},
},

View File

@@ -2,7 +2,7 @@
exports[`<List /> renders 1`] = `
<div
class="JavGameList"
class="GameList"
>
<h4>
Jeux JAV

View File

@@ -10,14 +10,14 @@ interface Props {
ids: EntityId[]
}
const JavGameList = ({ ids }: Props) => {
const { entities: jeuxJav } = useSelector((state: AppState) => state.javGameList, shallowEqual)
const GameList = ({ ids }: Props) => {
const { entities: jeux } = useSelector((state: AppState) => state.gameList, shallowEqual)
return (
<div className={styles.JavGameList}>
<div className={styles.GameList}>
<h4>Jeux JAV</h4>
<ul>
{ids.map((id) => {
const jeu = jeuxJav[id]
const jeu = jeux[id]
if (!jeu) {
return <li key={id}>Le jeu #{id} n&apos;existe pas</li>
}
@@ -33,4 +33,4 @@ const JavGameList = ({ ids }: Props) => {
)
}
export default memo(JavGameList)
export default memo(GameList)

View File

@@ -1,6 +1,6 @@
@import "../../theme/variables";
.JavGameList {
.GameList {
color: $color-white;
ul {

View File

@@ -1,6 +1,6 @@
import AnnouncementLink from "./AnnouncementLink"
import ErrorBoundary from "./ErrorBoundary"
import JavGameList from "./JavGameList"
import GameList from "./GameList"
import Loading from "./Loading"
import LoginForm from "./LoginForm"
import Notifications, { fetchFor as fetchForNotifications } from "./Notifications"
@@ -16,7 +16,7 @@ import WishAdd from "./WishAdd"
export {
AnnouncementLink,
ErrorBoundary,
JavGameList,
GameList,
Loading,
LoginForm,
Notifications,