Changed inputfield slightly + update inputfields in files

This commit is contained in:
Peter KW 2024-04-11 00:32:18 +02:00
parent 7ec207bf03
commit 059a322d9e
5 changed files with 16 additions and 8 deletions

View file

@ -67,6 +67,7 @@ function AddProject(): JSX.Element {
e.preventDefault(); e.preventDefault();
setName(e.target.value); setName(e.target.value);
}} }}
placeholder={"Name"}
/> />
<InputField <InputField
label="Description" label="Description"
@ -76,6 +77,7 @@ function AddProject(): JSX.Element {
e.preventDefault(); e.preventDefault();
setDescription(e.target.value); setDescription(e.target.value);
}} }}
placeholder={"Description"}
/> />
</div> </div>
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">

View file

@ -4,19 +4,21 @@
* @returns {JSX.Element} The input field * @returns {JSX.Element} The input field
* @example * @example
* <InputField * <InputField
* type="text"
* label="Example" * label="Example"
* placeholder="New placeholder"
* type="text"
* value={example}
* onChange={(e) => { * onChange={(e) => {
* setExample(e.target.value); * setExample(e.target.value);
* }} * }}
* value={example}
* /> * />
*/ */
function InputField(props: { function InputField(props: {
label: string; label?: string;
type: string; placeholder?: string;
value: string; type?: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; value?: string;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
}): JSX.Element { }): JSX.Element {
return ( return (
<div className=""> <div className="">
@ -30,7 +32,7 @@ function InputField(props: {
className="appearance-none border-2 border-black rounded-2xl w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" className="appearance-none border-2 border-black rounded-2xl w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
id={props.label} id={props.label}
type={props.type} type={props.type}
placeholder={props.label} placeholder={props.placeholder}
value={props.value} value={props.value}
onChange={props.onChange} onChange={props.onChange}
/> />

View file

@ -33,6 +33,7 @@ function Login(props: {
props.setUsername(e.target.value); props.setUsername(e.target.value);
}} }}
value={props.username} value={props.username}
placeholder={"Username"}
/> />
<InputField <InputField
type="password" type="password"
@ -41,6 +42,7 @@ function Login(props: {
props.setPassword(e.target.value); props.setPassword(e.target.value);
}} }}
value={props.password} value={props.password}
placeholder={"Password"}
/> />
</div> </div>
<Button <Button

View file

@ -23,7 +23,7 @@ function MemberInfoModal(props: {
className="fixed inset-10 bg-opacity-30 backdrop-blur-sm className="fixed inset-10 bg-opacity-30 backdrop-blur-sm
flex justify-center items-center" flex justify-center items-center"
> >
<div className="border-4 border-black bg-white rounded-lg text-center flex flex-col"> <div className="border-4 border-black bg-white rounded-2xl text-center flex flex-col">
<div className="mx-10"> <div className="mx-10">
<p className="font-bold text-[30px]">{props.username}</p> <p className="font-bold text-[30px]">{props.username}</p>
<p <p

View file

@ -61,6 +61,7 @@ export default function Register(): JSX.Element {
onChange={(e) => { onChange={(e) => {
setUsername(e.target.value); setUsername(e.target.value);
}} }}
placeholder={"Username"}
/> />
<InputField <InputField
label="Password" label="Password"
@ -69,6 +70,7 @@ export default function Register(): JSX.Element {
onChange={(e) => { onChange={(e) => {
setPassword(e.target.value); setPassword(e.target.value);
}} }}
placeholder={"Password"}
/> />
</div> </div>
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">