mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 13:56:29 +02:00
Factoring gsheet read
This commit is contained in:
@@ -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)
|
@@ -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",
|
||||
},
|
||||
]}
|
||||
/>
|
@@ -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>
|
24
src/components/JeuxJavList/index.tsx
Normal file
24
src/components/JeuxJavList/index.tsx
Normal 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)
|
@@ -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 }
|
||||
|
Reference in New Issue
Block a user