extract dialog component
This commit is contained in:
parent
5fc21494ef
commit
a952d4227d
1 changed files with 31 additions and 17 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import {useState} from 'react';
|
||||
import './JoinForm.css';
|
||||
import {useMutation} from '@tanstack/react-query';
|
||||
|
||||
import {makeApiUrl} from './serverCalls';
|
||||
import Column from './components/Column.tsx';
|
||||
import Button from './components/Button.tsx';
|
||||
import TextInput from './components/TextInput.tsx';
|
||||
import {useMutation} from '@tanstack/react-query';
|
||||
import Dialog from './components/Dialog.tsx';
|
||||
import './JoinForm.css';
|
||||
|
||||
export default function JoinForm({onDone}: {
|
||||
onDone: (name: string) => void;
|
||||
|
|
@ -29,7 +30,7 @@ export default function JoinForm({onDone}: {
|
|||
|
||||
const confirm = () => postPlayer.mutate({name});
|
||||
|
||||
return <Column className="JoinForm">
|
||||
return <Dialog className="JoinForm">
|
||||
<h3> Enter your name to play </h3>
|
||||
<TextInput
|
||||
value={name}
|
||||
|
|
@ -42,5 +43,5 @@ export default function JoinForm({onDone}: {
|
|||
disabled={disableButtons}
|
||||
text="INSERT COIN"/>
|
||||
{postPlayer.isError && <p>{postPlayer.error.message}</p>}
|
||||
</Column>;
|
||||
</Dialog>;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue