summaryrefslogtreecommitdiffhomepage
path: root/app/javascript/components/Home.jsx
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-05-15 20:35:42 -0400
committerrealtradam <[email protected]>2024-05-15 20:35:42 -0400
commit15bf3d5848aa1b7aeb5177f8b9ca84eb9ff5799f (patch)
treed5c9e7eb61de935e458f0af1d1e2b81d641e0277 /app/javascript/components/Home.jsx
parentd2ad5924bce17e3b07ee0af86a8739559dac3b35 (diff)
downloadgameHolster-15bf3d5848aa1b7aeb5177f8b9ca84eb9ff5799f.tar.gz
gameHolster-15bf3d5848aa1b7aeb5177f8b9ca84eb9ff5799f.zip
more styling improvements and gamecards added
Diffstat (limited to 'app/javascript/components/Home.jsx')
-rw-r--r--app/javascript/components/Home.jsx98
1 files changed, 54 insertions, 44 deletions
diff --git a/app/javascript/components/Home.jsx b/app/javascript/components/Home.jsx
index 6ead779..b67571c 100644
--- a/app/javascript/components/Home.jsx
+++ b/app/javascript/components/Home.jsx
@@ -1,52 +1,62 @@
import React, { } from "react";
-import { Link } from "react-router-dom";
+//import { Link } from "react-router-dom";
+import GameCard from "./GameCard";
//export default () => (
export default function Home () {
- var handleSubmit = (e) => {
- e.preventDefault() //stops submit from happening
+ var handleSubmit = (e) => {
+ e.preventDefault() //stops submit from happening
- const formData = new FormData()
- formData.append('game[title]', e.target.title.value)
- formData.append('game[game_file]', e.target.game_file.files[0], e.target.game_file.value)
+ const formData = new FormData()
+ formData.append('game[title]', e.target.title.value)
+ formData.append('game[game_file]', e.target.game_file.files[0], e.target.game_file.value)
-for (var pair of formData.entries()) {
- console.log(pair[0] + ', ' + pair[1])
-};
-
- fetch('http://127.0.0.1:3000/api/v1/games', {
- method: 'post',
- body: formData,
- });
- }
- return(
- <>
- <div className="vw-100 vh-100 primary-color d-flex align-items-center justify-content-center">
- <div className="jumbotron jumbotron-fluid bg-transparent">
- <div className="container secondary-color">
- <h1 className="display-4">Games!</h1>
- <p className="lead">
- All the games I have worked on that run on the web!
- </p>
- <hr className="my-4" />
- <Link
- to="/games"
- className="btn btn-lg custom-button"
- role="button"
- >
- View Games
- </Link>
- </div>
- <form onSubmit={handleSubmit} action="/upload" method="post">
- <label>Title</label>
- <input type="text" name="title" />
- <label>File</label>
- <input type="file" name="game_file" />
+ for (var pair of formData.entries()) {
+ console.log(pair[0] + ', ' + pair[1])
+ };
- <button type="submit">submit</button>
- </form>
- </div>
- </div>
- </>
-);
+ fetch('http://127.0.0.1:3000/api/v1/games', {
+ method: 'post',
+ body: formData,
+ });
+ }
+ return(
+ <>
+ <div>
+ <div className="flex flex-col gap-16 max-w-6xl shrink">
+ <div className="title font-bold text-6xl font-title">Get To Know Me a Little</div>
+ <div className="">
+ <div className="jumbotron jumbotron-fluid bg-transparent">
+ <div className="container secondary-color">
+ <h1 className="text-2xl">Debug!</h1>
+ <p className="">
+Ea optio vitae culpa voluptatem consectetur. Ab quisquam sed ipsum. Perspiciatis minus odit quas qui consequuntur dicta reiciendis a. Nihil minima sed aliquam.
+ </p>
+ <hr className="my-4" />
+ <form onSubmit={handleSubmit} action="/upload" method="post" className="flex flex-col gap-4">
+ <div>
+ <label>Title</label>
+ <input type="text" name="title" />
+ </div>
+ <div>
+ <label>File</label>
+ <input type="file" name="game_file" />
+ </div>
+ <button type="submit" className="w-32 bg-stone-900 text-stone-50 rounded">submit</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ <div className="flex flex-row flex-wrap gap-20 justify-around">
+ <GameCard />
+ <GameCard />
+ <GameCard />
+ <GameCard />
+ <GameCard />
+ <GameCard />
+ </div>
+ </div>
+ </div>
+ </>
+ );
};