diff --git a/app/soapbox/features/public_layout/index.js b/app/soapbox/features/public_layout/index.js deleted file mode 100644 index a7cb641eb..000000000 --- a/app/soapbox/features/public_layout/index.js +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { connect } from 'react-redux'; -import { Switch, Route, Redirect } from 'react-router-dom'; - -import { getSoapboxConfig } from 'soapbox/actions/soapbox'; -import LandingGradient from 'soapbox/components/landing-gradient'; -import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; -import { - NotificationsContainer, - ModalContainer, -} from 'soapbox/features/ui/util/async-components'; -import { isStandalone } from 'soapbox/utils/state'; - -import AboutPage from '../about'; -import LandingPage from '../landing_page'; -import MobilePage from '../mobile'; - -import Footer from './components/footer'; -import Header from './components/header'; - -const mapStateToProps = (state, props) => ({ - soapbox: getSoapboxConfig(state), - standalone: isStandalone(state), -}); - -class PublicLayout extends ImmutablePureComponent { - - render() { - const { standalone } = this.props; - - if (standalone) { - return ; - } - - return ( -
- - -
-
-
- -
- - - - - -
-
- -
- - - {(Component) => } - - - - {(Component) => } - -
-
- ); - } - -} - -export default connect(mapStateToProps)(PublicLayout); diff --git a/app/soapbox/features/public_layout/index.tsx b/app/soapbox/features/public_layout/index.tsx new file mode 100644 index 000000000..3fe4834a5 --- /dev/null +++ b/app/soapbox/features/public_layout/index.tsx @@ -0,0 +1,58 @@ +import React from 'react'; +import { Switch, Route, Redirect } from 'react-router-dom'; + +import LandingGradient from 'soapbox/components/landing-gradient'; +import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; +import { + NotificationsContainer, + ModalContainer, +} from 'soapbox/features/ui/util/async-components'; +import { useAppSelector } from 'soapbox/hooks'; +import { isStandalone } from 'soapbox/utils/state'; + +import AboutPage from '../about'; +import LandingPage from '../landing_page'; +import MobilePage from '../mobile'; + +import Footer from './components/footer'; +import Header from './components/header'; + +const PublicLayout = () => { + const standalone = useAppSelector((state) => isStandalone(state)); + + if (standalone) { + return ; + } + + return ( +
+ + +
+
+
+ +
+ + + + + +
+
+ +
+
+ ); +}; + +export default PublicLayout;