ErrorBoundary: we do a little refactoring

environments/review-preview-ca-kpxef8/deployments/4130
Alex Gleason 2023-10-10 20:29:31 -05:00
rodzic 10f4ea3079
commit fd592460a4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 14 dodań i 12 usunięć

Wyświetl plik

@ -14,18 +14,6 @@ import SiteLogo from './site-logo';
import type { RootState } from 'soapbox/store';
const goHome = () => location.href = '/';
const mapStateToProps = (state: RootState) => {
const { links, logo } = getSoapboxConfig(state);
return {
siteTitle: state.instance.title,
logo,
links,
};
};
interface Props extends ReturnType<typeof mapStateToProps> {
children: React.ReactNode;
}
@ -216,4 +204,18 @@ class ErrorBoundary extends React.PureComponent<Props, State> {
}
function goHome() {
location.href = '/';
}
function mapStateToProps(state: RootState) {
const { links, logo } = getSoapboxConfig(state);
return {
siteTitle: state.instance.title,
logo,
links,
};
}
export default connect(mapStateToProps)(ErrorBoundary);