diff --git a/code/frontend/vogel-social-media/src/App.tsx b/code/frontend/vogel-social-media/src/App.tsx index a53698a..c1d99f1 100644 --- a/code/frontend/vogel-social-media/src/App.tsx +++ b/code/frontend/vogel-social-media/src/App.tsx @@ -1,24 +1,46 @@ -import React from 'react'; +import React, { use } from 'react'; import logo from './logo.svg'; import './App.css'; +import { useState, useEffect } from 'react'; function App() { + const [username, setUsername] = useState(''); + const [password, setPassword] = useState(''); + const [mail, setMail] = useState(''); + const [isCreate, setIsCreate] = useState(false); + +useEffect(() => { + console.log(username); +}, [username]); + + + const changeUsername = (event : React.ChangeEvent) => { + if (event.target.value.length > 20) { + alert("Username is too long"); + } + setUsername(event.target.value); + } + const changePassword = (event : React.ChangeEvent) => { + setPassword(event.target.value); + } + const changeMail = (event : React.ChangeEvent) => { + setMail(event.target.value); + } + return (
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
+ {isCreate?

Create Account

:

Login

} + {isCreate && <> + + +
} + + +
+ + +
+ setIsCreate(!isCreate)} value={isCreate? "Create" : "login"}/>
); }