summaryrefslogtreecommitdiffhomepage
path: root/src/components/Games.jsx
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-05-23 16:55:59 -0400
committerrealtradam <[email protected]>2024-05-23 16:55:59 -0400
commit7a38eef00de0bb35565dda3ddb1efa748c22ea47 (patch)
treef94e4fb29bedf5f05dcb6913b77932a077bf0216 /src/components/Games.jsx
parent5f1b0bb1883a8021c7261dad59e063824849fd81 (diff)
downloadmalcz.com-7a38eef00de0bb35565dda3ddb1efa748c22ea47.tar.gz
malcz.com-7a38eef00de0bb35565dda3ddb1efa748c22ea47.zip
improve games
Diffstat (limited to 'src/components/Games.jsx')
-rw-r--r--src/components/Games.jsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/components/Games.jsx b/src/components/Games.jsx
index a0646be..173b3b7 100644
--- a/src/components/Games.jsx
+++ b/src/components/Games.jsx
@@ -16,13 +16,14 @@ export default function Games () {
}).then((response) => setGames(response))//.catch(() => navigate("/"));
}, []);
const allGames = games.map((game) => (
- <GameCard game={game} key={game.id}/>
+ <GameCard link={`/game/${game.titleSlug}`} game={game} key={game.id}/>
));
var handleSubmit = (e) => {
e.preventDefault() //stops submit from happening
const form = e.target;
const formData = new FormData()
formData.append('game[title]', form.title.value)
+ formData.append('game[img_rendering]', form.img_rendering.value)
for(let i =0; i < form.game_files.files.length; i++)
{
formData.append('game[game_files][]', form.game_files.files[i], form.game_files.files[i].value);
@@ -35,7 +36,7 @@ export default function Games () {
console.log(pair[0] + ', ' + pair[1])
};
- fetch('${import.meta.env.VITE_API_TITLE}/api/v1/games', {
+ fetch(`${import.meta.env.VITE_API_TITLE}/api/v1/games`, {
method: 'post',
body: formData,
});
@@ -54,6 +55,13 @@ export default function Games () {
<input type="text" name="title" />
</div>
<div>
+ <label>Image Rendering</label>
+ <select name="img_rendering">
+ <option value="pixelated">Pixelated</option>
+ <option value="crisp-edges">Crisp Edges</option>
+ </select>
+ </div>
+ <div>
<label>Files</label>
<input type="file" multiple="multiple" name="game_files" />
</div>
@@ -77,14 +85,8 @@ export default function Games () {
</div>
</div>
</div>
- { allGames }
<div className="flex flex-row flex-wrap gap-20 justify-around">
- <GameCard />
- <GameCard />
- <GameCard />
- <GameCard />
- <GameCard />
- <GameCard />
+ { allGames }
</div>
</div>
</div>