diff --git a/app/soapbox/features/configuration/index.js b/app/soapbox/features/configuration/index.js index d98947d64..fda05b3ba 100644 --- a/app/soapbox/features/configuration/index.js +++ b/app/soapbox/features/configuration/index.js @@ -18,7 +18,7 @@ import StillImage from 'soapbox/components/still_image'; import { Map as ImmutableMap, // List as ImmutableList, - // getIn, + getIn, } from 'immutable'; import { postSoapbox } from 'soapbox/actions/soapbox'; @@ -298,14 +298,16 @@ class ConfigSoapbox extends ImmutablePureComponent { } render() { - const { intl, soapbox } = this.props; - const { logo, banner, brandColor, extensions, defaultSettings, copyright, - promoPanel, navlinks, customCss } = soapbox; - const patron = (this.state.patron ? this.state.patron : extensions.patron); - const autoPlayGif = (this.state.autoPlayGif ? this.state.autoPlayGif : defaultSettings.autoPlayGif); - const promoPanelItems = (this.state.promoPanelItems ? this.state.promoPanelItems : promoPanel.items); - const homeFooterItems = (this.state.homeFooterItems ? this.state.homeFooterItems : navlinks.homeFooter); - const customCssItems = (this.state.customCssItems ? this.state.customCssItems : customCss); + const { intl } = this.props; + const logo = (this.state.logo ? this.state.logo : getIn(this.props.soapbox, ['logo'], '')); + const banner = (this.state.banner ? this.state.banner : getIn(this.props.soapbox, ['banner'], '')); + const brandColor = (this.state.brandColor ? this.state.brandColor : getIn(this.props.soapbox, ['brandColor'], '')); + const patron = (this.state.patron ? this.state.patron : getIn(this.props.soapbox, ['extensions'], ['patron'], false)); + const autoPlayGif = (this.state.autoPlayGif ? this.state.autoPlayGif : getIn(this.props.soapbox, ['defaultSettings'], ['autoPlayGif'], false)); + const promoPanelItems = (this.state.promoPanelItems ? this.state.promoPanelItems : getIn(this.props.soapbox, ['promoPanel'], ['items'], [])); + const homeFooterItems = (this.state.homeFooterItems ? this.state.homeFooterItems : getIn(this.props.soapbox, ['navlinks'], ['homeFooter'], [])); + const customCssItems = (this.state.customCssItems ? this.state.customCssItems : getIn(this.props.soapbox, ['customCss'], [])); + const copyright = (this.state.copyright ? this.state.copyright : getIn(this.props.soapbox, ['copyright'], '')); console.log(promoPanelItems); console.log(homeFooterItems); console.log(customCssItems); @@ -317,7 +319,7 @@ class ConfigSoapbox extends ImmutablePureComponent {
- {this.state.logo ? () : ()} +
} - value={this.state.brandColor ? this.state.brandColor : brandColor || '#0482d8'} + value={brandColor} onChange={this.handleBrandColorChange} />
@@ -357,14 +359,14 @@ class ConfigSoapbox extends ImmutablePureComponent { label={} hint={} name='patron' - checked={patron ? patron : false} + checked={patron} onChange={this.handlePatronCheckboxChange} /> } hint={} name='autoPlayGif' - checked={autoPlayGif ? autoPlayGif : false} + checked={autoPlayGif} onChange={this.handleAutoPlayGifCheckboxChange} /> @@ -373,7 +375,7 @@ class ConfigSoapbox extends ImmutablePureComponent { name='copyright' label={intl.formatMessage(messages.copyrightFooterLabel)} placeholder={intl.formatMessage(messages.copyrightFooterLabel)} - value={this.state.copyright ? this.state.copyright : copyright || ''} + value={copyright} onChange={this.handleTextChange} /> @@ -388,7 +390,8 @@ class ConfigSoapbox extends ImmutablePureComponent { Soapbox Icons List }} /> { - promoPanelItems.map((field, i) => ( + promoPanelItems.valueSeq().map((field, i) => ( + // promoPanelItems.map((field, i) => (
{ - homeFooterItems.map((field, i) => ( + homeFooterItems.valueSeq().map((field, i) => ( + // homeFooterItems.map((field, i) => (
{ - customCssItems.map((field, i) => ( + customCssItems.valueSeq().map((field, i) => ( + // customCssItems.map((field, i) => (