fix: marketplace collections, weather settings

This commit is contained in:
David Ralph 2022-08-29 10:50:27 +01:00
parent 77d68fc469
commit 12f8cf6a90
3 changed files with 9 additions and 31 deletions

View File

@ -1,24 +0,0 @@
import variables from 'modules/variables';
export default function Collection({ items }) {
return (
<>
<div className="items">
{items.slice(0, 99).map((item) => (
<div className="item" onClick={() => toggleFunction(item)} key={item.name}>
<img
alt="icon"
draggable="false"
src={variables.constants.DDG_IMAGE_PROXY + item.icon_url}
/>
<div className="card-details">
<span className="card-title">{item.display_name || item.name}</span>
<span className="card-subtitle">{item.author}</span>
</div>
</div>
))}
</div>
<div className="loader"></div>
</>
);
}

View File

@ -47,7 +47,7 @@ export default class Marketplace extends PureComponent {
// get item info
try {
let type = this.props.type;
if (type === 'all') {
if (type === 'all' || type === 'collections') {
type = data.type;
}
info = await (

View File

@ -59,6 +59,7 @@ export default class TimeSettings extends PureComponent {
}
render() {
const weatherType = localStorage.getItem('weatherType');
return (
<>
<Header
@ -70,11 +71,11 @@ export default class TimeSettings extends PureComponent {
switch={true}
/>
<SettingsItem title={variables.getMessage('modals.main.settings.sections.weather.widget_type')}>
<Dropdown label="Type" name="weatherType" category="weather">
<Dropdown label={variables.getMessage('modals.main.settings.sections.time.type')} name="weatherType" category="weather" onChange={() => this.forceUpdate()}>
<option value="1">{variables.getMessage('modals.main.settings.sections.weather.options.basic')}</option>
<option value="2">{variables.getMessage('modals.main.settings.sections.weather.standard')}</option>
<option value="3">{variables.getMessage('modals.main.settings.sections.weather.expanded')}</option>
<option value="4">{variables.getMessage('modals.main.settings.sections.weather.custom')}</option>
<option value="2">{variables.getMessage('modals.main.settings.sections.weather.options.standard')}</option>
<option value="3">{variables.getMessage('modals.main.settings.sections.weather.options.expanded')}</option>
<option value="4">{variables.getMessage('modals.main.settings.sections.weather.options.custom')}</option>
</Dropdown>
</SettingsItem>
<SettingsItem
@ -94,6 +95,7 @@ export default class TimeSettings extends PureComponent {
</SettingsItem>
<SettingsItem
title={variables.getMessage('modals.main.settings.sections.weather.temp_format.title')}
final={weatherType !== '4'}
>
<Radio
name="tempformat"
@ -122,10 +124,10 @@ export default class TimeSettings extends PureComponent {
category="weather"
/>
</SettingsItem>
{localStorage.getItem('weatherType') === 4 && (
{weatherType === '4' && (
<SettingsItem title={variables.getMessage(
'modals.main.settings.sections.weather.custom_settings',
)}>
)} final={true}>
<Checkbox
name="weatherdescription"
text={variables.getMessage(