Clean up logo code
This commit is contained in:
parent
f351823129
commit
7bbe293537
|
@ -9,21 +9,19 @@ const mapStateToProps = (state, props) => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
class LandingPage extends ImmutablePureComponent {
|
class LandingPage extends ImmutablePureComponent {
|
||||||
shouldComponentUpdate(nextProps, nextState) {
|
getSiteLogo = () => {
|
||||||
const { instance, soapbox } = nextProps;
|
const { instance, soapbox } = this.props;
|
||||||
return !instance.isEmpty() && !soapbox.isEmpty();
|
const logos = {
|
||||||
|
imgLogo: (<img alt={instance.get('title')} src={soapbox.get('logo')} />),
|
||||||
|
textLogo: (<h1>{instance.get('title')}</h1>),
|
||||||
|
}
|
||||||
|
return soapbox.get('logo') ? logos['imgLogo'] : logos['textLogo'];
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { instance, soapbox } = this.props;
|
const { instance, soapbox } = this.props;
|
||||||
|
if (instance.isEmpty()) return null;
|
||||||
if (instance.isEmpty() || soapbox.isEmpty()) return null;
|
const siteLogo = this.getSiteLogo();
|
||||||
|
|
||||||
const siteLogo = soapbox.get('logo') ? (
|
|
||||||
<img alt={instance.get('title')} src={soapbox.get('logo')} />
|
|
||||||
) : (
|
|
||||||
<h1>{instance.get('title')}</h1>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='public-layout'>
|
<div className='public-layout'>
|
||||||
|
|
Loading…
Reference in New Issue