fixs, Убрал стейты для формы авторизации, переписал на форм дату

This commit is contained in:
2023-01-25 16:50:36 +03:00
parent 50f33071bb
commit 5c8a8160bd
21 changed files with 107 additions and 209 deletions

22
src/hoc/ErrorBoundary.js Normal file
View File

@ -0,0 +1,22 @@
import React, {Component} from "react";
class ErrorBoundary extends Component {
state = {
error: null,
};
static getDerivedStateFromError(error) {
return {error};
}
render() {
const { error } = this.state;
if (error) {
return <div>Что-то пошло не так =( {error}</div>;
}
return this.props.children;
}
}
export default ErrorBoundary

11
src/hoc/withLogout.js Normal file
View File

@ -0,0 +1,11 @@
import React from 'react';
import { LogoutButton } from '../components/LogoutButton/LogoutButton';
export const WithLogout = (props) => {
return (
<div className='container'>
{props.children}
<LogoutButton />
</div>
)
};