+ {/*
+
+ {moreInfoItem(
+ ,
+ variables.getMessage('modals.main.marketplace.product.created_by'),
+ this.props.data.author,
+ )}
+ {itemWarning()}
+
+ {this.props.data.data.photos && (
+
+ )}
+ {this.props.data.data.settings && (
+

{
+ e.target.onerror = null;
+ e.target.src = placeholderIcon;
+ }}
+ />
+ )}*/}
+
+
+ {variables.getMessage('modals.main.marketplace.product.description')}
+
+ {ItemDescription}
+
+
+ {/*}
+ {this.props.data.data.quotes && (
+ <>
+
+
+
+ | {variables.getMessage('modals.main.settings.sections.quote.title')} |
+ {variables.getMessage('modals.main.settings.sections.quote.author')} |
+
+ {this.props.data.data.quotes.slice(0, this.state.count).map((quote, index) => (
+
+ | {quote.quote} |
+ {quote.author} |
+
+ ))}
+
+
+
+ this.incrementCount('quotes')}>
+ {this.state.count !== this.props.data.data.quotes.length
+ ? variables.getMessage('modals.main.marketplace.product.show_all')
+ : variables.getMessage('modals.main.marketplace.product.show_less')}
+
+
+ >
+ )}
+ {this.props.data.data.settings && (
+ <>
+
+
+
+ | {variables.getMessage('modals.main.marketplace.product.setting')} |
+ {variables.getMessage('modals.main.marketplace.product.value')} |
+
+ {Object.entries(this.props.data.data.settings)
+ .slice(0, this.state.count)
+ .map(([key, value]) => (
+
+ | {key} |
+ {value} |
+
+ ))}
+
+
+
+ this.incrementCount('settings')}>
+ {this.state.count !== this.props.data.data.settings.length
+ ? variables.getMessage('modals.main.marketplace.product.show_all')
+ : variables.getMessage('modals.main.marketplace.product.show_less')}
+
+
+ >
+ )}
+
+
+ {variables.getMessage('modals.main.marketplace.product.details')}
+
+
+ {this.props.data.data.updated_at &&
+ moreInfoItem(
+ ,
+ variables.getMessage('modals.main.marketplace.product.updated_at'),
+ formattedDate,
+ )}
+ {this.props.data.data.quotes &&
+ moreInfoItem(
+ ,
+ variables.getMessage('modals.main.marketplace.product.no_quotes'),
+ this.props.data.data.quotes.length,
+ )}
+ {this.props.data.data.photos &&
+ moreInfoItem(
+ ,
+ variables.getMessage('modals.main.marketplace.product.no_images'),
+ this.props.data.data.photos.length,
+ )}
+ {this.props.data.data.quotes && this.props.data.data.language
+ ? moreInfoItem(
+ ,
+ variables.getMessage('modals.main.settings.sections.language.title'),
+ languageNames.of(this.props.data.data.language),
+ )
+ : null}
+ {moreInfoItem(
+ ,
+ variables.getMessage('modals.main.settings.sections.background.type.title'),
+ variables.getMessage(
+ 'modals.main.marketplace.' + this.getName(this.props.data.data.type),
+ ) || 'marketplace',
+ )}
+
+
+
+
+
+

{
+ e.target.onerror = null;
+ e.target.src = placeholderIcon;
+ }}
+ />
+ {localStorage.getItem('welcomePreview') !== 'true' ? (
+ this.state.button
+ ) : (
+
+ {variables.getMessage(
+ 'modals.main.marketplace.product.buttons.not_available_preview',
+ )}
+
+ )}
+ {this.props.data.data.sideload !== true && (
+
+
+ )}
+ {this.props.data.data.in_collections?.length > 0 && (
+
+
+
+ {variables.getMessage('modals.main.marketplace.product.part_of')}
+
+
+ this.props.toggleFunction(
+ 'collection',
+ this.props.data.data.in_collections[0].name,
+ )
+ }
+ >
+ {this.props.data.data.in_collections[0].display_name}
+
+
+
+ )}
+
+
+
+ {/*}
+ {moreByCurator.length > 1 && (
+
+
+ {variables.getMessage('modals.main.marketplace.product.more_from_curator', {
+ name: this.props.data.author,
+ })}
+
+
+ this.props.toggleFunction('item', input)}
+ collectionFunction={(input) => this.props.toggleFunction('collection', input)}
+ filter={''}
+ moreByCreator={true}
+ showCreateYourOwn={false}
+ />
+
+
+ )}
+ */}
+ >
+ );
+};
+
+export { NewItemPage as default, NewItemPage };
diff --git a/src/features/misc/views/Marketplace.jsx b/src/features/misc/views/Marketplace.jsx
index 9f6fd320..9a734139 100644
--- a/src/features/misc/views/Marketplace.jsx
+++ b/src/features/misc/views/Marketplace.jsx
@@ -1,9 +1,49 @@
import variables from 'config/variables';
-import { memo } from 'react';
+import { memo, useState, useEffect } from 'react';
import MarketplaceTab from '../../marketplace/views/Browse';
+import { sortItems } from '../../marketplace/api';
+import { NewItems as Items } from '../../marketplace/components/Items/NewItems';
+import { useTab } from 'components/Elements/MainModal/backend/TabContext';
+import { NewItemPage } from '../../marketplace/views/newItemPage';
function Marketplace(props) {
+ const [done, setDone] = useState(false);
+ const [items, setItems] = useState([]);
+ const [type, setType] = useState('all');
+ const [selectedItem, setSelectedItem] = useState(null);
+ const { subTab } = useTab();
+
+ const controller = new AbortController();
+
+ async function getItems() {
+ setDone(false);
+ const dataURL =
+ variables.constants.API_URL +
+ (type === 'collections' ? '/marketplace/collections' : '/marketplace/items/' + type);
+
+ const { data } = await (
+ await fetch(dataURL, {
+ signal: controller.signal,
+ })
+ ).json();
+
+ if (controller.signal.aborted === true) {
+ return;
+ }
+
+ setItems(sortItems(data, 'z-a'));
+ setDone(true);
+ }
+
+ useEffect(() => {
+ if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
+ return;
+ }
+
+ getItems();
+ }, []);
+
return (
{
/*