Refactored some of the component code and removed unnecessary params

This commit is contained in:
Daniel Cojocea committed 2024-06-28 20:05:08 -04:00
1 parent 7097c1b59f
commit c87daa3d53
14 files changed
+279 -242

No files matched your search

@@ -1,5 +1,7 @@
import { Stack, Typography } from "@mui/material";
import "./flexibileTextField.css";
import React from "react";
import { useTheme } from "@emotion/react";
const FlexibileTextField = ({
id,
@@ -8,19 +10,27 @@ const FlexibileTextField = ({
placeholder,
value,
onChange,
error,
}) => {
const theme = useTheme();
return (
<div className="flexibile-textfield">
<div className="flexibile-textfield-title">{title}</div>
<Stack className="flexible-textfield" gap={theme.gap.small}>
<Typography component="h2">{title}</Typography>
<input
id={id}
type={type}
className="flexibile-textfield-input"
placeholder={placeholder}
value={value}
onChange={onChange}
/>
</div>
{error ? (
<Typography component="p" className="input-error">
{error}
</Typography>
) : (
""
)}
</Stack>
);
};
@@ -1,22 +1,30 @@
.flexibile-textfield-title {
.flexible-textfield{
position: relative;
}
.flexible-textfield h2.MuiTypography-root{
color: var(--env-var-color-5);
font-size: var(--env-var-font-size-medium);
font-weight: 400;
}
.flexibile-textfield-input {
width: 292.8px;
height: 6.8px;
padding: var(--env-var-spacing-1);
margin-top: 10px;
.flexible-textfield h2.MuiTypography-root span{
opacity: 0.6;
}
.flexible-textfield input {
min-width: 300px;
height: 34px;
padding: 0 var(--env-var-spacing-1);
border: 1px solid var(--env-var-color-4);
border-radius: var(--env-var-radius-1);
}
.flexibile-textfield-input:focus {
.flexible-textfield p.MuiTypography-root.input-error {
color: var(--env-var-color-24);
opacity: 0.8;
position: absolute;
top: calc(100% + 5px);
}
.flexible-textfield:has(p.MuiTypography-root.input-error) input{
border-color: var(--env-var-color-24);
}
.flexible-textfield input:focus {
outline: none;
}
.flexibile-textfield-input::placeholder {
color: var(--env-var-color-25);
font-size: var(--env-var-font-size-medium);
}
}