From 7bbe293537e59c4f40001627782cc8c9e7f6b4af Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 10 Apr 2020 17:17:02 -0500 Subject: [PATCH] Clean up logo code --- app/gabsocial/features/landing_page/index.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/gabsocial/features/landing_page/index.js b/app/gabsocial/features/landing_page/index.js index 0d16787bf..3756b36ae 100644 --- a/app/gabsocial/features/landing_page/index.js +++ b/app/gabsocial/features/landing_page/index.js @@ -9,21 +9,19 @@ const mapStateToProps = (state, props) => ({ }); class LandingPage extends ImmutablePureComponent { - shouldComponentUpdate(nextProps, nextState) { - const { instance, soapbox } = nextProps; - return !instance.isEmpty() && !soapbox.isEmpty(); + 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, soapbox } = this.props; - - if (instance.isEmpty() || soapbox.isEmpty()) return null; - - const siteLogo = soapbox.get('logo') ? ( - {instance.get('title')} - ) : ( -

{instance.get('title')}

- ); + if (instance.isEmpty()) return null; + const siteLogo = this.getSiteLogo(); return (