Ticket edit updates

This commit is contained in:
Darren Clarke 2024-08-07 15:25:53 +02:00
parent 2568547384
commit 87724bb7b8
9 changed files with 297 additions and 352 deletions

View file

@ -5,6 +5,7 @@ import { colors } from "../styles/theme";
interface InternalButtonProps {
text: string;
disabled: boolean;
color?: string;
kind?: "primary" | "secondary" | "destructive";
type?: string;
@ -27,12 +28,14 @@ export const InternalButton: FC<InternalButtonProps> = ({
text,
color,
kind,
disabled,
type = "button",
onClick,
}) => (
<MUIButton
variant="contained"
disableElevation
disabled={disabled}
onClick={onClick}
type={type}
href=""
@ -56,6 +59,7 @@ export const InternalButton: FC<InternalButtonProps> = ({
interface ButtonProps {
text: string;
disabled?: boolean;
color?: string;
kind?: "primary" | "secondary" | "destructive";
type?: string;
@ -65,6 +69,7 @@ interface ButtonProps {
export const Button: FC<ButtonProps> = ({
text,
disabled = false,
color,
type,
kind,
@ -75,6 +80,7 @@ export const Button: FC<ButtonProps> = ({
<Link href={href} passHref>
<InternalButton
text={text}
disabled={disabled}
color={color}
kind={kind}
type={type}
@ -84,6 +90,7 @@ export const Button: FC<ButtonProps> = ({
) : (
<InternalButton
text={text}
disabled={disabled}
color={color}
kind={kind}
type={type}

View file

@ -16,6 +16,7 @@ type TextFieldProps = {
required?: boolean;
lines?: number;
helperText?: string;
updateFormState?: (field: string, value: any) => void;
};
export const TextField: FC<TextFieldProps> = ({
@ -27,6 +28,7 @@ export const TextField: FC<TextFieldProps> = ({
required = false,
lines = 1,
helperText,
updateFormState,
}) => {
const { darkMediumGray, white } = colors;
const { roboto } = fonts;
@ -42,6 +44,7 @@ export const TextField: FC<TextFieldProps> = ({
rows={lines}
required={required}
defaultValue={formState.values[name]}
onChange={(e: any) => updateFormState?.(name, e.target.value)}
error={Boolean(formState.errors[name])}
helperText={formState.errors[name] ?? helperText}
InputProps={{