2020-04-25 15:26:47 -07:00
|
|
|
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: (<img alt={instance.get('title')} src={soapbox.get('logo')} />),
|
|
|
|
textLogo: (<h1>{instance.get('title')}</h1>),
|
|
|
|
};
|
2020-04-29 19:06:28 -07:00
|
|
|
return soapbox.has('logo') ? logos.imgLogo : logos.textLogo;
|
2020-04-25 15:26:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(SiteLogo);
|