This commit is contained in:
Gwilym Inzani 2024-04-20 12:40:07 +01:00
parent 7bbb52c449
commit 141a77af80
2 changed files with 31 additions and 18 deletions

View file

@ -1,9 +1,9 @@
"use client"; "use client";
import { useState } from 'react'; import { useState } from "react";
import { ContentBlock } from "../contentBlock"; import { ContentBlock } from "../contentBlock";
import { GameDeveloperSummary } from './gameDeveloperSummary'; import { GameDeveloperSummary } from "./gameDeveloperSummary";
import { styled } from "styled-components"; import { styled } from "styled-components";
import { Debug } from "./debug"; import { Debug } from "./debug";
@ -24,7 +24,7 @@ export function BacktracePage() {
time.{" "} time.{" "}
<strong>Send these to the creator of the game you are playing.</strong> <strong>Send these to the creator of the game you are playing.</strong>
</p> </p>
<BacktraceCopyDisplay backtrace={backtrace} setBacktrace={setBacktrace}/> <BacktraceCopyDisplay backtrace={backtrace} setBacktrace={setBacktrace} />
<p> <p>
<em> <em>
The owners of this website are not necessarily the creators of the The owners of this website are not necessarily the creators of the
@ -38,10 +38,21 @@ export function BacktracePage() {
); );
} }
function BacktraceCopyDisplay({ backtrace, setBacktrace }: { backtrace: string , setBacktrace: (newValue: string) => void}) { function BacktraceCopyDisplay({
backtrace,
setBacktrace,
}: {
backtrace: string;
setBacktrace: (newValue: string) => void;
}) {
return ( return (
<BacktraceWrapper> <BacktraceWrapper>
<BacktraceInputBox type="text" defaultValue="Enter the backtrace code here" onChange={e => setBacktrace(e.target.value)} value={backtrace} /> <BacktraceInputBox
type="text"
defaultValue="Enter the backtrace code here"
onChange={(e) => setBacktrace(e.target.value)}
value={backtrace}
/>
<BacktraceCopyButton <BacktraceCopyButton
onClick={() => { onClick={() => {
navigator.clipboard.writeText(backtrace); navigator.clipboard.writeText(backtrace);
@ -55,7 +66,8 @@ function BacktraceCopyDisplay({ backtrace, setBacktrace }: { backtrace: string ,
const BacktraceInputBox = styled.input` const BacktraceInputBox = styled.input`
font-size: larger; font-size: larger;
background-color: #dddddd; background-color: #eee;
flex-grow: 999; flex-grow: 999;
`; `;
@ -71,7 +83,6 @@ const BacktraceCopyButton = styled.button`
padding: 10px; padding: 10px;
`; `;
function getBacktrace() { function getBacktrace() {
return window.location.hash.slice(1); return window.location.hash.slice(1);
} }

View file

@ -1,7 +1,8 @@
import { styled } from "styled-components"; import { styled } from "styled-components";
export const GameDeveloperSummary = () => { export const GameDeveloperSummary = () => {
return <Details> return (
<Details>
<Summary>For game developers</Summary> <Summary>For game developers</Summary>
<p>If you don&apos;t want players to be sent to this page, you can:</p> <p>If you don&apos;t want players to be sent to this page, you can:</p>
<ol> <ol>
@ -10,7 +11,8 @@ export const GameDeveloperSummary = () => {
<li>Not use the backtrace feature</li> <li>Not use the backtrace feature</li>
</ol> </ol>
</Details> </Details>
} );
};
const Details = styled.details` const Details = styled.details`
margin-top: 10px; margin-top: 10px;