continued debugging

preload
Curtis ROck 4 years ago
parent cea7723fc3
commit 06186f85c8

@ -18,7 +18,7 @@ import StillImage from 'soapbox/components/still_image';
import { import {
Map as ImmutableMap, Map as ImmutableMap,
// List as ImmutableList, // List as ImmutableList,
// getIn, getIn,
} from 'immutable'; } from 'immutable';
import { postSoapbox } from 'soapbox/actions/soapbox'; import { postSoapbox } from 'soapbox/actions/soapbox';
@ -298,14 +298,16 @@ class ConfigSoapbox extends ImmutablePureComponent {
} }
render() { render() {
const { intl, soapbox } = this.props; const { intl } = this.props;
const { logo, banner, brandColor, extensions, defaultSettings, copyright, const logo = (this.state.logo ? this.state.logo : getIn(this.props.soapbox, ['logo'], ''));
promoPanel, navlinks, customCss } = soapbox; const banner = (this.state.banner ? this.state.banner : getIn(this.props.soapbox, ['banner'], ''));
const patron = (this.state.patron ? this.state.patron : extensions.patron); const brandColor = (this.state.brandColor ? this.state.brandColor : getIn(this.props.soapbox, ['brandColor'], ''));
const autoPlayGif = (this.state.autoPlayGif ? this.state.autoPlayGif : defaultSettings.autoPlayGif); const patron = (this.state.patron ? this.state.patron : getIn(this.props.soapbox, ['extensions'], ['patron'], false));
const promoPanelItems = (this.state.promoPanelItems ? this.state.promoPanelItems : promoPanel.items); const autoPlayGif = (this.state.autoPlayGif ? this.state.autoPlayGif : getIn(this.props.soapbox, ['defaultSettings'], ['autoPlayGif'], false));
const homeFooterItems = (this.state.homeFooterItems ? this.state.homeFooterItems : navlinks.homeFooter); const promoPanelItems = (this.state.promoPanelItems ? this.state.promoPanelItems : getIn(this.props.soapbox, ['promoPanel'], ['items'], []));
const customCssItems = (this.state.customCssItems ? this.state.customCssItems : customCss); 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(promoPanelItems);
console.log(homeFooterItems); console.log(homeFooterItems);
console.log(customCssItems); console.log(customCssItems);
@ -317,7 +319,7 @@ class ConfigSoapbox extends ImmutablePureComponent {
<FieldsGroup> <FieldsGroup>
<div className='fields-row'> <div className='fields-row'>
<div className='fields-row__column fields-row__column-6'> <div className='fields-row__column fields-row__column-6'>
{this.state.logo ? (<StillImage src={this.state.logo} />) : (<StillImage src={logo || ''} />)} <StillImage src={logo} />
</div> </div>
<div className='fields-row__column fields-group fields-row__column-6'> <div className='fields-row__column fields-group fields-row__column-6'>
<FileChooserLogo <FileChooserLogo
@ -347,7 +349,7 @@ class ConfigSoapbox extends ImmutablePureComponent {
<ColorWithPicker <ColorWithPicker
buttonId='brand_color' buttonId='brand_color'
label={<FormattedMessage id='soapbox_settings.fields.brand_color_label' defaultMessage='Brand color' />} label={<FormattedMessage id='soapbox_settings.fields.brand_color_label' defaultMessage='Brand color' />}
value={this.state.brandColor ? this.state.brandColor : brandColor || '#0482d8'} value={brandColor}
onChange={this.handleBrandColorChange} onChange={this.handleBrandColorChange}
/> />
</div> </div>
@ -357,14 +359,14 @@ class ConfigSoapbox extends ImmutablePureComponent {
label={<FormattedMessage id='soapbox_settings.fields.patron_enabled_label' defaultMessage='Patron module' />} label={<FormattedMessage id='soapbox_settings.fields.patron_enabled_label' defaultMessage='Patron module' />}
hint={<FormattedMessage id='soapbox_settings.hints.patron_enabled' defaultMessage='Enables display of Patron module. Requires installation of Patron module.' />} hint={<FormattedMessage id='soapbox_settings.hints.patron_enabled' defaultMessage='Enables display of Patron module. Requires installation of Patron module.' />}
name='patron' name='patron'
checked={patron ? patron : false} checked={patron}
onChange={this.handlePatronCheckboxChange} onChange={this.handlePatronCheckboxChange}
/> />
<Checkbox <Checkbox
label={<FormattedMessage id='soapbox_settings.fields.auto_play_gif_label' defaultMessage='Auto-play GIFs' />} label={<FormattedMessage id='soapbox_settings.fields.auto_play_gif_label' defaultMessage='Auto-play GIFs' />}
hint={<FormattedMessage id='soapbox_settings.hints.auto_play_gif' defaultMessage='Enable auto-playing of GIF files in timeline' />} hint={<FormattedMessage id='soapbox_settings.hints.auto_play_gif' defaultMessage='Enable auto-playing of GIF files in timeline' />}
name='autoPlayGif' name='autoPlayGif'
checked={autoPlayGif ? autoPlayGif : false} checked={autoPlayGif}
onChange={this.handleAutoPlayGifCheckboxChange} onChange={this.handleAutoPlayGifCheckboxChange}
/> />
</FieldsGroup> </FieldsGroup>
@ -373,7 +375,7 @@ class ConfigSoapbox extends ImmutablePureComponent {
name='copyright' name='copyright'
label={intl.formatMessage(messages.copyrightFooterLabel)} label={intl.formatMessage(messages.copyrightFooterLabel)}
placeholder={intl.formatMessage(messages.copyrightFooterLabel)} placeholder={intl.formatMessage(messages.copyrightFooterLabel)}
value={this.state.copyright ? this.state.copyright : copyright || ''} value={copyright}
onChange={this.handleTextChange} onChange={this.handleTextChange}
/> />
</FieldsGroup> </FieldsGroup>
@ -388,7 +390,8 @@ class ConfigSoapbox extends ImmutablePureComponent {
<FormattedMessage id='soapbox_settings.hints.promo_panel_icons' defaultMessage='{ link }' values={{ link: <a target='_blank' href='https://forkaweso.me/Fork-Awesome/icons/'>Soapbox Icons List</a> }} /> <FormattedMessage id='soapbox_settings.hints.promo_panel_icons' defaultMessage='{ link }' values={{ link: <a target='_blank' href='https://forkaweso.me/Fork-Awesome/icons/'>Soapbox Icons List</a> }} />
</span> </span>
{ {
promoPanelItems.map((field, i) => ( promoPanelItems.valueSeq().map((field, i) => (
// promoPanelItems.map((field, i) => (
<div className='row' key={i}> <div className='row' key={i}>
<TextInput <TextInput
label={intl.formatMessage(messages.promoItemIcon)} label={intl.formatMessage(messages.promoItemIcon)}
@ -423,7 +426,8 @@ class ConfigSoapbox extends ImmutablePureComponent {
<FormattedMessage id='soapbox_settings.hints.home_footer_fields' defaultMessage='You can have custom defined links displayed on the footer of your static pages' /> <FormattedMessage id='soapbox_settings.hints.home_footer_fields' defaultMessage='You can have custom defined links displayed on the footer of your static pages' />
</span> </span>
{ {
homeFooterItems.map((field, i) => ( homeFooterItems.valueSeq().map((field, i) => (
// homeFooterItems.map((field, i) => (
<div className='row' key={i}> <div className='row' key={i}>
<TextInput <TextInput
label={intl.formatMessage(messages.homeFooterItemLabel)} label={intl.formatMessage(messages.homeFooterItemLabel)}
@ -453,7 +457,8 @@ class ConfigSoapbox extends ImmutablePureComponent {
<FormattedMessage id='soapbox_settings.hints.custom_css_fields' defaultMessage='You can have custom CSS definitions' /> <FormattedMessage id='soapbox_settings.hints.custom_css_fields' defaultMessage='You can have custom CSS definitions' />
</span> </span>
{ {
customCssItems.map((field, i) => ( customCssItems.valueSeq().map((field, i) => (
// customCssItems.map((field, i) => (
<div className='row' key={i}> <div className='row' key={i}>
<TextInput <TextInput
label={intl.formatMessage(messages.customCssLabel)} label={intl.formatMessage(messages.customCssLabel)}

Loading…
Cancel
Save