From e317bbe75a46ef3bf853cf85584bcd22ebaacf23 Mon Sep 17 00:00:00 2001 From: realtradam Date: Sat, 29 Jun 2024 00:20:29 -0400 Subject: add games page + rails auth cleanup --- react-frontend/src/components/GameCard.tsx | 43 ++++++++++++++++++++++++++++++ react-frontend/src/components/Layout.tsx | 23 +++++++++++----- 2 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 react-frontend/src/components/GameCard.tsx (limited to 'react-frontend/src/components') diff --git a/react-frontend/src/components/GameCard.tsx b/react-frontend/src/components/GameCard.tsx new file mode 100644 index 0000000..4367977 --- /dev/null +++ b/react-frontend/src/components/GameCard.tsx @@ -0,0 +1,43 @@ +import { Link } from "react-router-dom"; + +export type ImageRendering = "auto" | "crisp-edges" | "pixelated"; +export type Tag = { + id: number, + tag_type: string, + name: string, +}; +export type GameType = { + id: number, + title: string, + titleSlug: string, + description: string, + github_link: string, + img_rendering: ImageRendering, + status: string, + order: number, + created_at: string, + updated_at: string, + user_id: number, + tags: Tag[], + card_img: string, + char_img: string, + title_img: string, +}; +export type GameCardProps = { link: string, game: GameType }; + +export default function GameCard ({ link, game }: GameCardProps) +{ + return ( + <> + +
+
+ +
+ + +
+ + + ); +} diff --git a/react-frontend/src/components/Layout.tsx b/react-frontend/src/components/Layout.tsx index db31b55..274e579 100644 --- a/react-frontend/src/components/Layout.tsx +++ b/react-frontend/src/components/Layout.tsx @@ -1,5 +1,5 @@ import { Dispatch } from 'react'; -import { Outlet, useNavigate } from "react-router-dom"; +import { Outlet, Link, useNavigate } from "react-router-dom"; import { IconButton, Button, ButtonGroup } from 'rsuite'; import { Icon } from '@rsuite/icons'; import { FaUser } from "react-icons/fa6"; @@ -28,22 +28,31 @@ export default function Layout(prop : { userData: userData, setUserData : Dispat const loggedout_element = }>Log In; - const loggedin_element = ; + const loggedin_element = ; console.log(prop); return( <>
-
+
-
- { prop.userData.name ? loggedin_element : loggedout_element } +
+ { prop.userData.name ? loggedin_element : loggedout_element } +
+ +
+
-
+
+ Game Holster +
+
- }>Browse Games + + }>Browse Games + }>Upload Game
-- cgit v1.2.3