passwort button melly pics
This commit is contained in:
BIN
docs/IMG_20230218_184419_227.jpg
Executable file
BIN
docs/IMG_20230218_184419_227.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 MiB |
BIN
docs/IMG_20230218_184426_227.jpg
Executable file
BIN
docs/IMG_20230218_184426_227.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 MiB |
BIN
docs/IMG_20230218_184429_386.jpg
Executable file
BIN
docs/IMG_20230218_184429_386.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 MiB |
@ -9,8 +9,3 @@
|
|||||||
{
|
{
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button
|
|
||||||
{
|
|
||||||
max-width: 30%;
|
|
||||||
}
|
|
||||||
@ -30,7 +30,7 @@ form
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.InputForm button, input
|
.InputForm button, input[type=file]
|
||||||
{
|
{
|
||||||
background-color: #aa0404;
|
background-color: #aa0404;
|
||||||
color: white;
|
color: white;
|
||||||
@ -42,6 +42,10 @@ form
|
|||||||
width: auto;
|
width: auto;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
.InputForm .IF_pw button
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
.InputForm input
|
.InputForm input
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,7 +84,7 @@ const Login = () =>
|
|||||||
id="email"
|
id="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
required />
|
required />
|
||||||
<PasswordInput
|
<PasswordInput className='IF_pw'
|
||||||
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
||||||
label = 'Passwort:'
|
label = 'Passwort:'
|
||||||
name="password"
|
name="password"
|
||||||
|
|||||||
@ -10,9 +10,17 @@ import './Profil.css';
|
|||||||
import { TextInput } from '@mantine/core';
|
import { TextInput } from '@mantine/core';
|
||||||
import { notificationError, notificationSuccess } from '../services/Notifications';
|
import { notificationError, notificationSuccess } from '../services/Notifications';
|
||||||
|
|
||||||
|
type TFormData =
|
||||||
|
{
|
||||||
|
email: string,
|
||||||
|
name: string,
|
||||||
|
phone: string,
|
||||||
|
qr_code: string
|
||||||
|
};
|
||||||
|
|
||||||
function Profil()
|
function Profil()
|
||||||
{
|
{
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState<TFormData>({
|
||||||
email:'',
|
email:'',
|
||||||
name:'',
|
name:'',
|
||||||
phone:'',
|
phone:'',
|
||||||
@ -51,7 +59,7 @@ function Profil()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let formData_loc =
|
let formData_loc: TFormData =
|
||||||
{
|
{
|
||||||
email: '',
|
email: '',
|
||||||
name: '',
|
name: '',
|
||||||
@ -99,6 +107,21 @@ function Profil()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function submitData(fd: TFormData)
|
||||||
|
{
|
||||||
|
if(!Object.values(fd).every(val => val?.trim() !== ''))
|
||||||
|
{
|
||||||
|
notificationError('Bitte alle Felder ausfüllen!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setFormData(fd);
|
||||||
|
|
||||||
|
const data = await updateDog(fd);
|
||||||
|
mutate();
|
||||||
|
showData(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const submitForm = async (e: React.FormEvent<HTMLFormElement>) =>
|
const submitForm = async (e: React.FormEvent<HTMLFormElement>) =>
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -106,17 +129,14 @@ function Profil()
|
|||||||
console.log(formData_loc);
|
console.log(formData_loc);
|
||||||
console.log(formDataSave.current);
|
console.log(formDataSave.current);
|
||||||
|
|
||||||
|
if( formData.email || formData.name || formData.name || formData.name )
|
||||||
if(!Object.values(formData).every(val => val?.trim() !== ''))
|
|
||||||
{
|
{
|
||||||
notificationError('Bitte alle Felder ausfüllen!');
|
submitData(formData);
|
||||||
return;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
submitData(formData_loc);
|
||||||
}
|
}
|
||||||
setFormData(formData);
|
|
||||||
|
|
||||||
const data = await updateDog(formData);
|
|
||||||
mutate();
|
|
||||||
showData(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const qr_refresh = (e: React.MouseEvent<HTMLButtonElement>) =>
|
const qr_refresh = (e: React.MouseEvent<HTMLButtonElement>) =>
|
||||||
|
|||||||
@ -65,7 +65,7 @@ const Register = () =>
|
|||||||
id="email"
|
id="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
required />
|
required />
|
||||||
<PasswordInput
|
<PasswordInput className='IF_pw'
|
||||||
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
||||||
label = 'Passwort:'
|
label = 'Passwort:'
|
||||||
name="password"
|
name="password"
|
||||||
@ -73,7 +73,7 @@ const Register = () =>
|
|||||||
placeholder="Passwort"
|
placeholder="Passwort"
|
||||||
id="password" value={formData.password}
|
id="password" value={formData.password}
|
||||||
required/>
|
required/>
|
||||||
<PasswordInput
|
<PasswordInput className='IF_pw'
|
||||||
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
sx = {{ maxWidth: '80vw', minWidth: '30vw', width: '300px' }}
|
||||||
label = 'Passwort:'
|
label = 'Passwort:'
|
||||||
name="password2"
|
name="password2"
|
||||||
|
|||||||
Reference in New Issue
Block a user