mirror of https://github.com/mue/mue.git
fix: broken marketplace tags, remove obsolete functions
This commit is contained in:
parent
2ba9714cad
commit
c29376f715
|
@ -83,13 +83,7 @@ function Items({
|
||||||
</span>
|
</span>
|
||||||
{type === 'all' && !onCollection ? (
|
{type === 'all' && !onCollection ? (
|
||||||
<span className="card-type">
|
<span className="card-type">
|
||||||
{variables.getMessage(
|
{variables.getMessage('modals.main.marketplace.' + item.type)}
|
||||||
`modals.main.addons.create.types.${
|
|
||||||
item.type.split('_')[0] === 'preset'
|
|
||||||
? 'settings'
|
|
||||||
: item.type.split('_')[0] + 's'
|
|
||||||
}`,
|
|
||||||
)}
|
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,7 +23,6 @@ class Marketplace extends PureComponent {
|
||||||
this.state = {
|
this.state = {
|
||||||
items: [],
|
items: [],
|
||||||
button: '',
|
button: '',
|
||||||
featured: {},
|
|
||||||
done: false,
|
done: false,
|
||||||
item: {},
|
item: {},
|
||||||
collection: false,
|
collection: false,
|
||||||
|
@ -139,11 +138,6 @@ class Marketplace extends PureComponent {
|
||||||
signal: this.controller.signal,
|
signal: this.controller.signal,
|
||||||
})
|
})
|
||||||
).json();
|
).json();
|
||||||
const featured = await (
|
|
||||||
await fetch(variables.constants.MARKETPLACE_URL + '/featured', {
|
|
||||||
signal: this.controller.signal,
|
|
||||||
})
|
|
||||||
).json();
|
|
||||||
const collections = await (
|
const collections = await (
|
||||||
await fetch(variables.constants.MARKETPLACE_URL + '/collections', {
|
await fetch(variables.constants.MARKETPLACE_URL + '/collections', {
|
||||||
signal: this.controller.signal,
|
signal: this.controller.signal,
|
||||||
|
@ -157,7 +151,6 @@ class Marketplace extends PureComponent {
|
||||||
this.setState({
|
this.setState({
|
||||||
items: data,
|
items: data,
|
||||||
oldItems: data,
|
oldItems: data,
|
||||||
featured: featured.data,
|
|
||||||
collections: collections.data,
|
collections: collections.data,
|
||||||
done: true,
|
done: true,
|
||||||
});
|
});
|
||||||
|
@ -284,10 +277,10 @@ class Marketplace extends PureComponent {
|
||||||
return errorMessage(
|
return errorMessage(
|
||||||
<>
|
<>
|
||||||
<MdWifiOff />
|
<MdWifiOff />
|
||||||
<h1>{variables.getMessage('modals.main.marketplace.offline.title')}</h1>
|
<span className="title">{variables.getMessage('modals.main.marketplace.offline.title')}</span>
|
||||||
<p className="description">
|
<span className="subtitle">
|
||||||
{variables.getMessage('modals.main.marketplace.offline.description')}
|
{variables.getMessage('modals.main.marketplace.offline.description')}
|
||||||
</p>
|
</span>
|
||||||
</>,
|
</>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -303,34 +296,16 @@ class Marketplace extends PureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const featured = () => {
|
|
||||||
const openFeatured = () => {
|
|
||||||
variables.stats.postEvent('marketplace', 'Featured clicked');
|
|
||||||
window.open(this.state.featured.buttonLink);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="featured" style={{ backgroundColor: this.state.featured.colour }}>
|
|
||||||
<p>{this.state.featured.title}</p>
|
|
||||||
<h1>{this.state.featured.name}</h1>
|
|
||||||
<button className="addToMue" onClick={() => openFeatured()}>
|
|
||||||
{this.state.featured.buttonText}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (this.state.items?.length === 0) {
|
if (this.state.items?.length === 0) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{featured()}
|
|
||||||
{errorMessage(
|
{errorMessage(
|
||||||
<>
|
<>
|
||||||
<MdLocalMall />
|
<MdLocalMall />
|
||||||
<h1>{variables.getMessage('modals.main.addons.empty.title')}</h1>
|
<span className="title">{variables.getMessage('modals.main.addons.empty.title')}</span>
|
||||||
<p className="description">
|
<span className="subtitle">
|
||||||
{variables.getMessage('modals.main.marketplace.no_items')}
|
{variables.getMessage('modals.main.marketplace.no_items')}
|
||||||
</p>
|
</span>
|
||||||
</>,
|
</>,
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -255,6 +255,14 @@
|
||||||
grid-gap: 5px;
|
grid-gap: 5px;
|
||||||
padding: 50px;
|
padding: 50px;
|
||||||
|
|
||||||
|
.title, svg {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
font-size: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
@include themed {
|
@include themed {
|
||||||
.sideloadIcon {
|
.sideloadIcon {
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
|
|
Loading…
Reference in New Issue