This commit is contained in:
m5r
2021-08-01 22:03:49 +08:00
parent 7d34fcd48f
commit 1489f97c14
33 changed files with 147 additions and 313 deletions

View File

@ -17,9 +17,7 @@ export const LabeledTextField = forwardRef<HTMLInputElement, LabeledTextFieldPro
register,
formState: { isSubmitting, errors },
} = useFormContext();
const error = Array.isArray(errors[name])
? errors[name].join(", ")
: errors[name]?.message || errors[name];
const error = Array.isArray(errors[name]) ? errors[name].join(", ") : errors[name]?.message || errors[name];
return (
<div {...outerProps}>

View File

@ -23,12 +23,7 @@ type Props = {
const logger = appLogger.child({ module: "Layout" });
const Layout: FunctionComponent<Props> = ({
children,
title,
pageTitle = title,
hideFooter = false,
}) => {
const Layout: FunctionComponent<Props> = ({ children, title, pageTitle = title, hideFooter = false }) => {
return (
<>
{pageTitle ? (
@ -60,13 +55,7 @@ type ErrorBoundaryState =
errorMessage: string;
};
const blitzErrors = [
RedirectError,
AuthenticationError,
AuthorizationError,
CSRFTokenMismatchError,
NotFoundError,
];
const blitzErrors = [RedirectError, AuthenticationError, AuthorizationError, CSRFTokenMismatchError, NotFoundError];
const ErrorBoundary = withRouter(
class ErrorBoundary extends Component<WithRouterProps, ErrorBoundaryState> {