diff --git a/frontend/src/components/login/createAccount.js b/frontend/src/components/login/createAccount.js index 7805472..541ea5c 100644 --- a/frontend/src/components/login/createAccount.js +++ b/frontend/src/components/login/createAccount.js @@ -59,29 +59,32 @@ const CssTextField = withStyles({ }, })(TextField); -const putCreateAccount = async (url, data) => { - const response = await fetch(url, { - method: 'PUT', - mode: 'cors', - cache: 'no-cache', - headers: { - 'Content-Type': 'application/json' - }, - redirect: 'follow', - referrerPolicy: 'no-referrer', - body: JSON.stringify(data) - }); - if (response.status == "200") { - return - } -} export default function CreateAccount() { const classes = useStyles(); const [username, setUsername] = React.useState(""); const [password, setPassword] = React.useState(""); + const [login, setLogin] = React.useState(true); + + const putCreateAccount = async (url, data) => { + const response = await fetch(url, { + method: 'PUT', + mode: 'cors', + cache: 'no-cache', + headers: { + 'Content-Type': 'application/json' + }, + redirect: 'follow', + referrerPolicy: 'no-referrer', + body: JSON.stringify(data) + }); + + if (response.status == "200") { + setLogin(false) + } + } const handleClick = (e) => { if (username !== "" && password !== "") { @@ -99,61 +102,62 @@ export default function CreateAccount() { } return ( - - - - - SC Dashboard Logo - -
+ login === true ? + + + - - - - - Create new Account - - - - - - - - - - - - - - - - - - - + SC Dashboard Logo - - - -
+
+ + + + + + Create new Account + + + + + + + + + + + + + + + + + + + + +
+
+
+
: ) }