Correct highlight color palette

This commit is contained in:
SergeyEzhin 2021-09-14 17:56:08 +03:00
parent d92e4f23df
commit 4dccf5a7dd
2 changed files with 9 additions and 15 deletions

View file

@ -24,7 +24,7 @@ const HighlightColorPalette = ({changeColor, curColor}) => {
))} ))}
</div> </div>
</ListItem> </ListItem>
<ListItem radio checked={(curColor && (curColor === 'transparent'))} title={t('Edit.textNoFill')}></ListItem> <ListItem radio checked={(curColor && curColor === 'transparent')} onClick={() => changeColor('transparent')} title={t('Edit.textNoFill')}></ListItem>
</List> </List>
) )
}; };

View file

@ -466,7 +466,7 @@ const PageBackgroundColor = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t('Edit', {returnObjects: true}); const _t = t('Edit', {returnObjects: true});
const backgroundColor = props.storeTextSettings.backgroundColor; const backgroundColor = props.storeTextSettings.backgroundColor;
// const customColors = props.storePalette.customColors;
const changeColor = (color, effectId) => { const changeColor = (color, effectId) => {
if (color !== 'empty') { if (color !== 'empty') {
if (effectId !== undefined ) { if (effectId !== undefined ) {
@ -475,12 +475,9 @@ const PageBackgroundColor = props => {
props.onBackgroundColor(color); props.onBackgroundColor(color);
} }
} }
// } else {
// // open custom color menu
// props.f7router.navigate('/edit-text-custom-back-color/', {props: {onBackgroundColor: props.onBackgroundColor}});
// }
}; };
return(
return (
<Page> <Page>
<Navbar title={_t.textHighlightColor} backLink={_t.textBack}> <Navbar title={_t.textHighlightColor} backLink={_t.textBack}>
{Device.phone && {Device.phone &&
@ -492,12 +489,6 @@ const PageBackgroundColor = props => {
} }
</Navbar> </Navbar>
<HighlightColorPalette changeColor={changeColor} curColor={backgroundColor} /> <HighlightColorPalette changeColor={changeColor} curColor={backgroundColor} />
{/* <ThemeColorPalette changeColor={changeColor} curColor={backgroundColor} customColors={customColors} transparent={true}/>
<List>
<ListItem title={_t.textAddCustomColor} link={'/edit-text-custom-back-color/'} routeProps={{
onBackgroundColor: props.onBackgroundColor
}}></ListItem>
</List> */}
</Page> </Page>
) )
}; };
@ -534,6 +525,10 @@ const EditText = props => {
<span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> : <span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> :
<span className="color-preview auto"></span>; <span className="color-preview auto"></span>;
const backgroundColorPreview = backgroundColor !== 'transparent' ?
<span className="color-preview" style={{ background: `#${(typeof backgroundColor === "object" ? backgroundColor.color : backgroundColor)}`}}></span> :
<span className="color-preview"></span>;
return ( return (
<Fragment> <Fragment>
<List> <List>
@ -562,8 +557,7 @@ const EditText = props => {
onBackgroundColor: props.onBackgroundColor onBackgroundColor: props.onBackgroundColor
}}> }}>
{!isAndroid ? {!isAndroid ?
<Icon slot="media" icon="icon-text-selection"><span className="color-preview" style={{ background: `#${backgroundColor}`}}></span></Icon> : <Icon slot="media" icon="icon-text-selection">{backgroundColorPreview}</Icon> : backgroundColorPreview
<span className="color-preview" style={{ background: `#${(typeof backgroundColor === "object" ? backgroundColor.color : backgroundColor)}`}}></span>
} }
</ListItem> </ListItem>
<ListItem title={t("Edit.textAdditionalFormatting")} link="/edit-text-add-formatting/" routeProps={{ <ListItem title={t("Edit.textAdditionalFormatting")} link="/edit-text-add-formatting/" routeProps={{