[PE mobile] Fix Bug 50845
This commit is contained in:
parent
71e1dd4669
commit
b5bbb3c6b4
|
@ -45,8 +45,6 @@ const PageTheme = props => {
|
||||||
const storeSlideSettings = props.storeSlideSettings;
|
const storeSlideSettings = props.storeSlideSettings;
|
||||||
const arrayThemes = storeSlideSettings.arrayThemes;
|
const arrayThemes = storeSlideSettings.arrayThemes;
|
||||||
const slideThemeIndex = storeSlideSettings.slideThemeIndex;
|
const slideThemeIndex = storeSlideSettings.slideThemeIndex;
|
||||||
const defaultThemes = arrayThemes[0];
|
|
||||||
const docThemes = arrayThemes[1];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page className="slide-theme">
|
<Page className="slide-theme">
|
||||||
|
@ -59,32 +57,21 @@ const PageTheme = props => {
|
||||||
</NavRight>
|
</NavRight>
|
||||||
}
|
}
|
||||||
</Navbar>
|
</Navbar>
|
||||||
{arrayThemes.length ? (
|
{arrayThemes.length && (
|
||||||
<List className="slide-theme__list">
|
<List className="slide-theme__list">
|
||||||
{defaultThemes.map((elem, index) => {
|
{arrayThemes.map(theme => {
|
||||||
return (
|
return (
|
||||||
<ListItem key={elem.Index} className={elem.Index === slideThemeIndex ? "item-theme active" : "item-theme"}
|
<ListItem key={theme.themeId} className={theme.themeId === slideThemeIndex ? "item-theme active" : "item-theme"}
|
||||||
style={{backgroundPosition: "0 " + index * -40 + "px"}}
|
style={{backgroundPosition: `0 -${theme.offsety}px`, backgroundImage: theme.imageUrl && `url(${theme.imageUrl})`}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
storeSlideSettings.changeSlideThemeIndex(elem.Index);
|
storeSlideSettings.changeSlideThemeIndex(theme.themeId);
|
||||||
props.onThemeClick(elem.Index);
|
props.onThemeClick(theme.themeId);
|
||||||
}}>
|
|
||||||
</ListItem>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{docThemes.map((elem, index) => {
|
|
||||||
return (
|
|
||||||
<ListItem key={elem.Index} className={elem.Index === slideThemeIndex ? "item-theme active" : "item-theme"}
|
|
||||||
style={{backgroundPosition: "0 -0px", backgroundImage: "url(" + elem.ThemeInfo.Thumbnail + ")"}}
|
|
||||||
onClick={() => {
|
|
||||||
storeSlideSettings.changeSlideThemeIndex(elem.Index);
|
|
||||||
props.onThemeClick(elem.Index);
|
|
||||||
}}>
|
}}>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</List>
|
</List>
|
||||||
) : null}
|
)}
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue