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 { Pico8Console } from "./pico8-client/Pico8Console";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { DbRelease } from "../server/dbal/dbal";
|
import { DbRelease } from "../server/dbal/dbal";
|
||||||
@ -11,6 +11,7 @@ type Info = {
|
|||||||
|
|
||||||
export const GamePage = () => {
|
export const GamePage = () => {
|
||||||
const {author, slug, version} = useParams();
|
const {author, slug, version} = useParams();
|
||||||
|
const navigate = useNavigate();
|
||||||
const [info, setInfo] = useState<Info | null>(null);
|
const [info, setInfo] = useState<Info | null>(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchInfo = async () => {
|
const fetchInfo = async () => {
|
||||||
@ -51,11 +52,13 @@ export const GamePage = () => {
|
|||||||
`}>
|
`}>
|
||||||
<div className={css`
|
<div className={css`
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
width: max-content;
|
||||||
`}>
|
`}>
|
||||||
<h1>{info.release.manifest.title ?? slug!.split("-").map(word => word[0].toUpperCase()+word.slice(1)).join(" ")}</h1>
|
<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`
|
<div className={css`
|
||||||
max-width: 512px;
|
width: 512px;
|
||||||
|
max-width: 100%;
|
||||||
`}>
|
`}>
|
||||||
<Pico8Console carts={info.release.carts} />
|
<Pico8Console carts={info.release.carts} />
|
||||||
</div>
|
</div>
|
||||||
@ -63,7 +66,7 @@ export const GamePage = () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
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 => (
|
info.versions.map(v => (
|
||||||
<option key={v} value={v}>{v}</option>
|
<option key={v} value={v}>{v}</option>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user