diff --git a/app/gabsocial/containers/gabsocial.js b/app/gabsocial/containers/gabsocial.js index a49a84353..8cec3411d 100644 --- a/app/gabsocial/containers/gabsocial.js +++ b/app/gabsocial/containers/gabsocial.js @@ -20,8 +20,7 @@ import ErrorBoundary from '../components/error_boundary'; import { fetchInstance } from 'gabsocial/actions/instance'; import { fetchSoapboxConfig } from 'gabsocial/actions/soapbox'; import { fetchMe } from 'gabsocial/actions/me'; -import LandingPage from 'gabsocial/features/landing_page'; -import AboutPage from 'gabsocial/features/about'; +import PublicLayout from 'gabsocial/features/public_layout'; const { localeData, messages } = getLocale(); addLocaleData(localeData); @@ -92,8 +91,8 @@ class GabSocialMount extends React.PureComponent { - {!me && } - + {!me && } + diff --git a/app/gabsocial/features/about/index.js b/app/gabsocial/features/about/index.js index 005dfa22c..9a43108bb 100644 --- a/app/gabsocial/features/about/index.js +++ b/app/gabsocial/features/about/index.js @@ -32,7 +32,14 @@ class AboutPage extends ImmutablePureComponent { render() { return ( -
+
+
+
+
+
); } diff --git a/app/gabsocial/features/landing_page/index.js b/app/gabsocial/features/landing_page/index.js index 573767ece..b8a5c4b44 100644 --- a/app/gabsocial/features/landing_page/index.js +++ b/app/gabsocial/features/landing_page/index.js @@ -2,87 +2,35 @@ import React from 'react'; import { connect } from 'react-redux'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { Link } from 'react-router-dom'; -import LoginForm from 'gabsocial/features/auth_login/components/login_form'; import RegistrationForm from './components/registration_form'; -import NotificationsContainer from 'gabsocial/features/ui/containers/notifications_container'; +import SiteLogo from '../public_layout/components/site_logo'; const mapStateToProps = (state, props) => ({ instance: state.get('instance'), - soapbox: state.get('soapbox'), }); class LandingPage extends ImmutablePureComponent { - getSiteLogo = () => { - const { instance, soapbox } = this.props; - const logos = { - imgLogo: ({instance.get('title')}), - textLogo: (

{instance.get('title')}

), - }; - return soapbox.get('logo') ? logos.imgLogo : logos.textLogo; - } - render() { const { instance } = this.props; - if (instance.isEmpty()) return null; - const siteLogo = this.getSiteLogo(); return ( -
- -
-
-
-
-
- - {siteLogo} - -
- {instance.get('description')} -
-
-
-
- -
-
+
+
-
-
-
- ♡{new Date().getFullYear()}. Copying is an act of love. Please copy and share. -
-
    -
  • About
  • -
  • Terms of Service
  • -
  • Privacy Policy
  • -
  • DMCA
  • -
  • Source Code
  • -
-
-
-
); } diff --git a/app/gabsocial/features/public_layout/components/footer.js b/app/gabsocial/features/public_layout/components/footer.js new file mode 100644 index 000000000..e8e7cf781 --- /dev/null +++ b/app/gabsocial/features/public_layout/components/footer.js @@ -0,0 +1,26 @@ +import React from 'react'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { Link } from 'react-router-dom'; + +export default class Footer extends ImmutablePureComponent { + + render() { + return ( +
+
+
+ ♡{new Date().getFullYear()}. Copying is an act of love. Please copy and share. +
+
    +
  • About
  • +
  • Terms of Service
  • +
  • Privacy Policy
  • +
  • DMCA
  • +
  • Source Code
  • +
+
+
+ ); + } + +} diff --git a/app/gabsocial/features/public_layout/components/header.js b/app/gabsocial/features/public_layout/components/header.js new file mode 100644 index 000000000..16f367a13 --- /dev/null +++ b/app/gabsocial/features/public_layout/components/header.js @@ -0,0 +1,34 @@ +import React from 'react'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { Link } from 'react-router-dom'; +import LoginForm from 'gabsocial/features/auth_login/components/login_form'; +import SiteLogo from './site_logo'; + +export default class Header extends ImmutablePureComponent { + + render() { + return ( + + ); + } + +} diff --git a/app/gabsocial/features/public_layout/components/site_logo.js b/app/gabsocial/features/public_layout/components/site_logo.js new file mode 100644 index 000000000..2cc43a0a6 --- /dev/null +++ b/app/gabsocial/features/public_layout/components/site_logo.js @@ -0,0 +1,23 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import ImmutablePureComponent from 'react-immutable-pure-component'; + +const mapStateToProps = (state, props) => ({ + instance: state.get('instance'), + soapbox: state.get('soapbox'), +}); + +class SiteLogo extends ImmutablePureComponent { + + render() { + const { instance, soapbox } = this.props; + const logos = { + imgLogo: ({instance.get('title')}), + textLogo: (

{instance.get('title')}

), + }; + return soapbox.get('logo') ? logos.imgLogo : logos.textLogo; + } + +} + +export default connect(mapStateToProps)(SiteLogo); diff --git a/app/gabsocial/features/public_layout/index.js b/app/gabsocial/features/public_layout/index.js new file mode 100644 index 000000000..857b0a56a --- /dev/null +++ b/app/gabsocial/features/public_layout/index.js @@ -0,0 +1,39 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { Switch, Route } from 'react-router-dom'; +import NotificationsContainer from 'gabsocial/features/ui/containers/notifications_container'; +import Header from './components/header'; +import Footer from './components/footer'; +import LandingPage from '../landing_page'; +import AboutPage from '../about'; + +const mapStateToProps = (state, props) => ({ + instance: state.get('instance'), + soapbox: state.get('soapbox'), +}); + +class PublicLayout extends ImmutablePureComponent { + + render() { + const { instance } = this.props; + if (instance.isEmpty()) return null; + + return ( +
+
+
+ + + + +
+
+ ); + } + +} + +export default connect(mapStateToProps)(PublicLayout);