More slight fixes
This commit is contained in:
parent
f1dc322162
commit
79ec9f4eff
@ -1,4 +1,4 @@
|
||||
import { useParams } from "react-router-dom"
|
||||
import { useNavigate, useParams } from "react-router-dom"
|
||||
import { Pico8Console } from "./pico8-client/Pico8Console";
|
||||
import { useEffect, useState } from "react";
|
||||
import { DbRelease } from "../server/dbal/dbal";
|
||||
@ -11,6 +11,7 @@ type Info = {
|
||||
|
||||
export const GamePage = () => {
|
||||
const {author, slug, version} = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [info, setInfo] = useState<Info | null>(null);
|
||||
useEffect(() => {
|
||||
const fetchInfo = async () => {
|
||||
@ -51,11 +52,13 @@ export const GamePage = () => {
|
||||
`}>
|
||||
<div className={css`
|
||||
margin: auto;
|
||||
width: max-content;
|
||||
`}>
|
||||
<h1>{info.release.manifest.title ?? slug!.split("-").map(word => word[0].toUpperCase()+word.slice(1)).join(" ")}</h1>
|
||||
<h2>By: {info.release.author}</h2>
|
||||
<h2>By {info.release.author}</h2>
|
||||
<div className={css`
|
||||
max-width: 512px;
|
||||
width: 512px;
|
||||
max-width: 100%;
|
||||
`}>
|
||||
<Pico8Console carts={info.release.carts} />
|
||||
</div>
|
||||
@ -63,7 +66,7 @@ export const GamePage = () => {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
`}>
|
||||
Version: <select defaultValue={info.release.version}>
|
||||
Version: <select defaultValue={info.release.version} onChange={(ev) => navigate(`/api/release?author=${author}&slug=${slug}&version=${ev.target.value}`)}>
|
||||
{
|
||||
info.versions.map(v => (
|
||||
<option key={v} value={v}>{v}</option>
|
||||
|
Loading…
x
Reference in New Issue
Block a user