From c29376f715a4445a598fa701426ea10bbccc1cc2 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Mon, 1 Jan 2024 12:02:14 +0000 Subject: [PATCH] fix: broken marketplace tags, remove obsolete functions --- .../modals/main/marketplace/Items.jsx | 8 +--- .../main/marketplace/sections/Marketplace.jsx | 37 +++---------------- .../modals/main/scss/marketplace/_main.scss | 8 ++++ 3 files changed, 15 insertions(+), 38 deletions(-) diff --git a/src/components/modals/main/marketplace/Items.jsx b/src/components/modals/main/marketplace/Items.jsx index 258f6f80..4815991f 100644 --- a/src/components/modals/main/marketplace/Items.jsx +++ b/src/components/modals/main/marketplace/Items.jsx @@ -83,13 +83,7 @@ function Items({ {type === 'all' && !onCollection ? ( - {variables.getMessage( - `modals.main.addons.create.types.${ - item.type.split('_')[0] === 'preset' - ? 'settings' - : item.type.split('_')[0] + 's' - }`, - )} + {variables.getMessage('modals.main.marketplace.' + item.type)} ) : null} diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx index e9a012fd..3ea0c40c 100644 --- a/src/components/modals/main/marketplace/sections/Marketplace.jsx +++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx @@ -23,7 +23,6 @@ class Marketplace extends PureComponent { this.state = { items: [], button: '', - featured: {}, done: false, item: {}, collection: false, @@ -139,11 +138,6 @@ class Marketplace extends PureComponent { signal: this.controller.signal, }) ).json(); - const featured = await ( - await fetch(variables.constants.MARKETPLACE_URL + '/featured', { - signal: this.controller.signal, - }) - ).json(); const collections = await ( await fetch(variables.constants.MARKETPLACE_URL + '/collections', { signal: this.controller.signal, @@ -157,7 +151,6 @@ class Marketplace extends PureComponent { this.setState({ items: data, oldItems: data, - featured: featured.data, collections: collections.data, done: true, }); @@ -284,10 +277,10 @@ class Marketplace extends PureComponent { return errorMessage( <> -

{variables.getMessage('modals.main.marketplace.offline.title')}

-

+ {variables.getMessage('modals.main.marketplace.offline.title')} + {variables.getMessage('modals.main.marketplace.offline.description')} -

+ , ); } @@ -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 ( -
-

{this.state.featured.title}

-

{this.state.featured.name}

- -
- ); - }; - if (this.state.items?.length === 0) { return ( <> - {featured()} {errorMessage( <> -

{variables.getMessage('modals.main.addons.empty.title')}

-

+ {variables.getMessage('modals.main.addons.empty.title')} + {variables.getMessage('modals.main.marketplace.no_items')} -

+ , )} diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index 6d800f2e..1ba06328 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -255,6 +255,14 @@ grid-gap: 5px; padding: 50px; + .title, svg { + margin: 10px; + } + + svg { + font-size: 70px; + } + @include themed { .sideloadIcon { font-size: 50px;