Skip to content
Snippets Groups Projects
Commit 05bc7477 authored by Planoetscher Daniel (Student Com20)'s avatar Planoetscher Daniel (Student Com20)
Browse files

code refactoring

parent 8ee69512
No related branches found
No related tags found
1 merge request!2WIP: Using react
@use 'styles/settings'as s; @use 'styles/settings'as s;
.project { .project {
...@@ -80,4 +79,3 @@ ...@@ -80,4 +79,3 @@
line-height: 1.8; line-height: 1.8;
} }
} }
...@@ -10,20 +10,15 @@ interface Props { ...@@ -10,20 +10,15 @@ interface Props {
export default function TextInput({ label, name, type }: Props) { export default function TextInput({ label, name, type }: Props) {
type = type ? type : 'text'; type = type ? type : 'text';
let field = (
<input type={type} required name={name} id={name} />
);
if (type === 'textarea') {
field = (
<textarea name={name} id={name} required></textarea>
)
}
return ( return (
<div className={'input-field' + (type === 'textarea' ? ' textarea' : '')}> <div className={'input-field' + (type === 'textarea' ? ' textarea' : '')}>
<label htmlFor={name}>{label}</label> <label htmlFor={name}>{label}</label>
{field} {
type === 'textarea' ?
(<textarea name={name} id={name} required></textarea>)
: (<input type={type} required name={name} id={name} />)
}
</div> </div>
); );
} }
......
...@@ -469,4 +469,4 @@ footer { ...@@ -469,4 +469,4 @@ footer {
background: s.$accent; background: s.$accent;
} }
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment