Make site banner a separate field from logo
This commit is contained in:
parent
db7cfacff1
commit
b651a31847
3 changed files with 26 additions and 3 deletions
|
@ -3,7 +3,7 @@ import { connect } from 'react-redux';
|
|||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { Link } from 'react-router-dom';
|
||||
import RegistrationForm from './components/registration_form';
|
||||
import SiteLogo from '../public_layout/components/site_logo';
|
||||
import SiteBanner from '../public_layout/components/site_banner';
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
instance: state.get('instance'),
|
||||
|
@ -20,7 +20,7 @@ class LandingPage extends ImmutablePureComponent {
|
|||
<div className='landing-columns--left'>
|
||||
<div className='landing__brand'>
|
||||
<Link className='brand' to='/'>
|
||||
<SiteLogo />
|
||||
<SiteBanner />
|
||||
</Link>
|
||||
<div className='brand__tagline'>
|
||||
<span>{instance.get('description')}</span>
|
||||
|
|
|
@ -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 SiteBanner extends ImmutablePureComponent {
|
||||
|
||||
render() {
|
||||
const { instance, soapbox } = this.props;
|
||||
const logos = {
|
||||
imgLogo: (<img alt={instance.get('title')} src={soapbox.get('banner')} />),
|
||||
textLogo: (<h1>{instance.get('title')}</h1>),
|
||||
};
|
||||
return soapbox.has('banner') ? logos.imgLogo : logos.textLogo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(SiteBanner);
|
|
@ -15,7 +15,7 @@ class SiteLogo extends ImmutablePureComponent {
|
|||
imgLogo: (<img alt={instance.get('title')} src={soapbox.get('logo')} />),
|
||||
textLogo: (<h1>{instance.get('title')}</h1>),
|
||||
};
|
||||
return soapbox.get('logo') ? logos.imgLogo : logos.textLogo;
|
||||
return soapbox.has('logo') ? logos.imgLogo : logos.textLogo;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue