From fd592460a4765c9e47b0e82f1de26805e8750d09 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 10 Oct 2023 20:29:31 -0500 Subject: [PATCH] ErrorBoundary: we do a little refactoring --- src/components/error-boundary.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/error-boundary.tsx b/src/components/error-boundary.tsx index a80ef43dc..494a813b6 100644 --- a/src/components/error-boundary.tsx +++ b/src/components/error-boundary.tsx @@ -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 { children: React.ReactNode; } @@ -216,4 +204,18 @@ class ErrorBoundary extends React.PureComponent { } +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);