Add system variable to character

This commit is contained in:
Calli
2024-04-27 22:26:57 +03:00
parent 7d8c622711
commit cfa0a86b99
6 changed files with 29 additions and 11 deletions

View File

@@ -17,10 +17,12 @@ export const CharacterDialog = ({
}) => {
const [account, setAccount] = useState("");
const [comment, setComment] = useState("");
const [system, setSystem] = useState("");
useEffect(() => {
if (character?.account) setAccount(character.account);
if (character?.comment) setComment(character.comment);
if (character?.system) setSystem(character.system);
}, [character]);
const logout = (character: AccessToken) => {
@@ -52,6 +54,15 @@ export const CharacterDialog = ({
onChange={(event) => setAccount(event.target.value)}
onKeyDown={handleKeyDown}
/>
<TextField
id="outlined-basic"
label="System"
variant="outlined"
value={system ?? ""}
sx={{ margin: 1 }}
minRows={6}
onChange={(event) => setSystem(event.target.value)}
/>
<TextField
id="outlined-basic"
label="Comment / Plan"
@@ -62,10 +73,12 @@ export const CharacterDialog = ({
minRows={6}
onChange={(event) => setComment(event.target.value)}
/>
<DialogActions>
<Button
onClick={() => {
character && updateCharacter(character, { account, comment });
character &&
updateCharacter(character, { account, comment, system });
closeDialog();
}}
variant="contained"