From 15bf3d5848aa1b7aeb5177f8b9ca84eb9ff5799f Mon Sep 17 00:00:00 2001 From: realtradam Date: Wed, 15 May 2024 20:35:42 -0400 Subject: more styling improvements and gamecards added --- app/javascript/components/Button.jsx | 4 +- app/javascript/components/GameCard.jsx | 19 +++++++ app/javascript/components/Home.jsx | 98 +++++++++++++++++++--------------- app/javascript/components/Layout.jsx | 79 ++++++++------------------- 4 files changed, 97 insertions(+), 103 deletions(-) create mode 100644 app/javascript/components/GameCard.jsx (limited to 'app/javascript') diff --git a/app/javascript/components/Button.jsx b/app/javascript/components/Button.jsx index f9505f8..de199d0 100644 --- a/app/javascript/components/Button.jsx +++ b/app/javascript/components/Button.jsx @@ -1,11 +1,11 @@ import React from "react"; import { Link } from "react-router-dom"; -export default function Button ({ link }) +export default function Button ({ link, width = 36, height = 16, spinner = 4 }) { return ( <> -
+
{ link }
diff --git a/app/javascript/components/GameCard.jsx b/app/javascript/components/GameCard.jsx new file mode 100644 index 0000000..6b79630 --- /dev/null +++ b/app/javascript/components/GameCard.jsx @@ -0,0 +1,19 @@ +import React from "react"; +//import { Link } from "react-router-dom"; + +export default function GameCard ({ link = "./", width = "72" }) +{ + return ( + <> + +
+
+ +
+ + +
+
+ + ) +}; 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( - <> -
-
-
-

Games!

-

- All the games I have worked on that run on the web! -

-
- - View Games - -
-
- - - - + 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( + <> +
+
+
Get To Know Me a Little
+
+
+
+

Debug!

+

+Ea optio vitae culpa voluptatem consectetur. Ab quisquam sed ipsum. Perspiciatis minus odit quas qui consequuntur dicta reiciendis a. Nihil minima sed aliquam. +

+
+
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + + + + + +
+
+
+ + ); }; diff --git a/app/javascript/components/Layout.jsx b/app/javascript/components/Layout.jsx index 0c5d5b6..01ec055 100644 --- a/app/javascript/components/Layout.jsx +++ b/app/javascript/components/Layout.jsx @@ -7,76 +7,41 @@ export default function Layout ({userData}) //const [userData, setUserData] = useState({ name: "" }); return ( <> -
- -
-
-
-
-
- -
- -
) -- cgit v1.2.3