Skip to content

Commit

Permalink
fix new game form (hackclub#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
recursiveforte authored Sep 19, 2024
1 parent 735f87f commit 6408db5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/popups-etc/project-name-creation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ export default function ProjectNameCreator() {
<div></div>
<div class={styles.containerInner}>

<form class={styles.inner}>
<form class={styles.inner} onSubmit={(e) => {
e.preventDefault();
setLoading(true)
window.location.href= `/~/new?name=${stateName}`;
}}>
<h1 class={styles.header}>Create Game</h1>
<p>Please input a game name</p>
<input type={"text"} class={styles.input} autofocus={true} value={stateName} placeholder="Untitled" onInput={(e)=>{setStateName((e.target as HTMLTextAreaElement)?.value )}}/>
<div class={styles.buttonContainer}>
<Button type="submit" disabled={loading || stateName.length===0} accent class={styles.done} onClick={()=>{
setLoading(true)
window.location.href= `/~/new?name=${stateName}`;
}}><span>{!loading ? "Create" : "Creating..."}</span></Button>
<Button type="submit" disabled={loading || stateName.length===0} accent class={styles.done}><span>{!loading ? "Create" : "Creating..."}</span></Button>
</div>
</form>
</div>
Expand Down

0 comments on commit 6408db5

Please sign in to comment.