fix: background upload, finish 7.0 translation support

This commit is contained in:
David Ralph
2022-06-05 15:43:49 +01:00
parent f413f4e31c
commit 7df77d33e4
14 changed files with 256 additions and 23 deletions

View File

@@ -207,12 +207,18 @@ export default class Create extends PureComponent {
<div className="smallBanner">
<div className="content">
<span className="title" style={{ textTransform: 'capitalize' }}>
Create {this.state.addonMetadata.type} Pack
{getMessage('modals.main.addons.create.metadata.create_type', {
type: this.state.addonMetadata.type,
})}
</span>
<span className="subtitle">
{getMessage(
'modals.main.addons.create.metadata.descriptions.' + this.addonMetadata.type,
) || 'marketplace'}
</span>
<span className="subtitle">Description of what is being made</span>
</div>
<button>
Example
{getMessage('modals.main.addons.create.metadata.example')}
<MdDownload />
</button>
</div>
@@ -229,8 +235,8 @@ export default class Create extends PureComponent {
<span className="title">{getMessage('modals.main.marketplace.product.version')}</span>
<span className="subtitle">
<InfoTooltip
title="Information"
subtitle="Running away is easy It's the leaving that's hard Running away is easy It's the leaving that's hard"
title={getMessage('modals.main.addons.create.information')}
subtitle={getMessage('modals.main.addons.create.metadata.information_subtitle')}
/>
</span>
</div>
@@ -379,7 +385,7 @@ export default class Create extends PureComponent {
<SettingsItem
final={true}
title={getMessage('modals.main.addons.create.photos.title')}
subtitle={'Import from custom settings.'}
subtitle={getMessage('modals.main.addons.create.import_custom')}
>
<div className="themesToggleArea">
<div className="options">
@@ -411,14 +417,14 @@ export default class Create extends PureComponent {
<div className="smallBanner">
<div className="content">
<span className="title" style={{ textTransform: 'capitalize' }}>
Next step, Publishing...
{getMessage('modals.main.addons.create.publishing.title')}
</span>
<span className="subtitle">
Visit the Mue Knowledgebase on information on how to publish your newly created addon.
{getMessage('modals.main.addons.create.publishing.subtitle')}
</span>
</div>
<button>
Learn More
{getMessage('modals.main.addons.create.publishing.button')}
<MdOpenInNew />
</button>
</div>

View File

@@ -23,7 +23,7 @@ export default class FileUpload extends PureComponent {
});
const settingsSize = new TextEncoder().encode(JSON.stringify(settings)).length;
if (videoCheck(file) === true) {
if (videoCheck(file.type) === true) {
if (settingsSize + file.size > 4850000) {
return toast(this.getMessage('toasts.no_storage'));
}
@@ -32,7 +32,7 @@ export default class FileUpload extends PureComponent {
}
// todo: change number
compressAccurately(file, 200).then(async (res) => {
compressAccurately(file, 300).then(async (res) => {
if (settingsSize + res.size > 4850000) {
return toast(this.getMessage('toasts.no_storage'));
}

View File

@@ -67,7 +67,10 @@ export default class BackgroundSettings extends PureComponent {
const { getMessage } = this;
const interval = (
<SettingsItem title="Interval" subtitle="Change how often the background is updated">
<SettingsItem
title={getMessage('modals.main.settings.sections.background.interval.title')}
subtitle={getMessage('modals.mani.settings.sections.background.intervanl.subtitle')}
>
<Dropdown
label={getMessage('modals.main.settings.sections.background.interval.title')}
name="backgroundchange"
@@ -96,8 +99,8 @@ export default class BackgroundSettings extends PureComponent {
const APISettings = (
<>
<SettingsItem
title="API Settings"
subtitle="Options for the getting an image from an external service (API)"
title={getMessage('modals.main.settings.sections.background.api')}
subtitle={getMessage('modals.main.settings.sections.background.api_subtitle')}
>
{this.state.backgroundCategories[0] === getMessage('modals.main.loading') ? (
<>
@@ -244,7 +247,9 @@ export default class BackgroundSettings extends PureComponent {
<span className="title">
{getMessage('modals.main.settings.sections.background.source.title')}
</span>
<span className="subtitle">Select where to get background images from</span>
<span className="subtitle">
{getMessage('modals.main.settings.sections.background.source.subtitle')}
</span>
</div>
</div>
<div className="action">
@@ -284,7 +289,9 @@ export default class BackgroundSettings extends PureComponent {
<span className="title">
{getMessage('modals.main.settings.sections.background.effects.title')}
</span>
<span className="subtitle">Add effects to the background image</span>
<span className="subtitle">
{getMessage('modals.main.settings.sections.background.effects.subtitle')}
</span>
</div>
</div>
<div className="action">
@@ -296,8 +303,8 @@ export default class BackgroundSettings extends PureComponent {
) : null}
{this.state.backgroundSettingsSection !== true && this.state.effects !== true ? (
<SettingsItem
title="Display"
subtitle="Change how background and photo information are loaded"
title={getMessage('modals.main.settings.sections.background.display')}
subtitle={getMessage('modals.main.settings.sections.background.display_subtitle')}
final={true}
>
<Checkbox
@@ -332,7 +339,7 @@ export default class BackgroundSettings extends PureComponent {
<>
<SettingsItem
title={getMessage('modals.main.settings.sections.background.source.title')}
subtitle="Select where to get background images from"
subtitle={getMessage('modals.main.settings.sections.background.source.subtitle')}
>
<Dropdown
label={getMessage('modals.main.settings.sections.background.type.title')}
@@ -371,7 +378,7 @@ export default class BackgroundSettings extends PureComponent {
this.state.effects ? (
<SettingsItem
title={getMessage('modals.main.settings.sections.background.effects.title')}
subtitle="Add effects to the background image"
subtitle={getMessage('modals.main.settings.sections.background.effects.subtitle')}
final={true}
>
<Slider

View File

@@ -142,7 +142,7 @@ export default class CustomSettings extends PureComponent {
});
const settingsSize = new TextEncoder().encode(JSON.stringify(settings)).length;
if (videoCheck(file) === true) {
if (videoCheck(file.type) === true) {
if (settingsSize + file.size > 4850000) {
return toast(this.getMessage('toasts.no_storage'));
}
@@ -150,7 +150,7 @@ export default class CustomSettings extends PureComponent {
return this.customBackground(file, false, this.state.currentBackgroundIndex);
}
compressAccurately(file, 200).then(async (res) => {
compressAccurately(file, 300).then(async (res) => {
if (settingsSize + res.size > 4850000) {
return toast(this.getMessage('toasts.no_storage'));
}
@@ -165,7 +165,7 @@ export default class CustomSettings extends PureComponent {
return (
<>
{this.props.interval}
<div className="settingsRow" style={{ alignItems: 'flex-start' }}>
<div className="settingsRow settingsNoBorder" style={{ alignItems: 'flex-start' }}>
<div className="content">
<div className="images-row">
{this.state.customBackground.map((url, index) => (