Factoring gsheet read

This commit is contained in:
forceoranj
2021-10-18 20:46:32 +02:00
parent 40640ef544
commit 3398f4f42d
21 changed files with 2414 additions and 212 deletions

View File

@@ -1,24 +0,0 @@
import { memo } from "react"
import { Link } from "react-router-dom"
import { JavGame } from "../../services/javGames"
import styles from "./styles.module.scss"
interface Props {
items: JavGame[]
}
const List = ({ items }: Props) => (
<div className={styles.JavGameList}>
<h4>JAV Games</h4>
<ul>
{items.map(({ id, titre }) => (
<li key={id}>
<Link to={`/UserInfo/${id}`}>{titre}</Link>
</li>
))}
</ul>
</div>
)
export default memo(List)

View File

@@ -22,14 +22,13 @@ describe("<List />", () => {
duree: 45,
type: "Ambiance",
poufpaf: "0-9-2/6-qui-prend-6-nimmt",
photo: "https://cf.geekdo-images.com/thumb/img/lzczxR5cw7an7tRWeHdOrRtLyes=/fit-in/200x150/pic772547.jpg",
bggPhoto: "",
bggId: 432,
exemplaires: 1,
dispoPret: 1,
nonRangee: 0,
horodatage: "0000-00-00",
ean: "3421272101313",
bggPhoto:
"https://cf.geekdo-images.com/thumb/img/lzczxR5cw7an7tRWeHdOrRtLyes=/fit-in/200x150/pic772547.jpg",
},
]}
/>

View File

@@ -2,18 +2,17 @@
exports[`<List /> renders 1`] = `
<div
class="JavGameList"
class="JeuxJavList"
>
<h4>
JAV Games
Jeux JAV
</h4>
<ul>
<li>
<a
href="/UserInfo/5"
>
6 qui prend!
</a>
6 qui prend!
- [
432
]
</li>
</ul>
</div>

View File

@@ -0,0 +1,24 @@
import { memo } from "react"
// import { Link } from "react-router-dom"
import { JeuxJav } from "../../services/jeuxJav"
import styles from "./styles.module.scss"
interface Props {
items: JeuxJav[]
}
const List = ({ items }: Props) => (
<div className={styles.JeuxJavList}>
<h4>Jeux JAV</h4>
<ul>
{items.map(({ id, titre, bggId }) => (
<li key={id}>
{titre} - [{bggId}]
</li>
))}
</ul>
</div>
)
export default memo(List)

View File

@@ -1,7 +1,7 @@
import List from "./List"
import JavGameList from "./JavGameList"
import JeuxJavList from "./JeuxJavList"
import Info from "./Info"
import ErrorBoundary from "./ErrorBoundary"
import Loading from "./Loading"
export { List, JavGameList, Info, ErrorBoundary, Loading }
export { List, JeuxJavList, Info, ErrorBoundary, Loading }