fix: achievement toast styling, marketplace general improvements

Co-authored-by: David Ralph <me@davidcralph.co.uk>
Co-authored-by: Isaac <contact@eartharoid.me>
This commit is contained in:
alexsparkes
2024-05-21 16:56:24 +01:00
parent 2b948bc70d
commit df6c42f526
5 changed files with 35 additions and 26 deletions

View File

@@ -72,8 +72,8 @@ function Items({
showCreateYourOwn,
}) {
const shouldShowCollection =
(collection && !onCollection && (filter === null || filter === '')) ||
(type === 'collections' && !onCollection && (filter === null || filter === ''));
((collection && !onCollection && (filter === null || filter === '')) ||
(type === 'collections' && !onCollection && (filter === null || filter === ''))) && type !== 'preset_settings';
return (
<>
@@ -126,7 +126,7 @@ function Items({
))}
</div>
<div className="loader"></div>
{showCreateYourOwn ? (
{!onCollection && showCreateYourOwn ? (
<div className="createYourOwn">
<MdAutoFixHigh />
<span className="title">{variables.getMessage('modals.main.marketplace.cant_find')}</span>

View File

@@ -310,31 +310,23 @@ class Marketplace extends PureComponent {
if (this.state.done === false) {
return errorMessage(
<>
<div className="loaderHolder">
<div id="loader"></div>
<span className="subtitle">{variables.getMessage('modals.main.loading')}</span>
</div>
</>,
<div className="loaderHolder">
<div id="loader"></div>
<span className="subtitle">{variables.getMessage('modals.main.loading')}</span>
</div>,
);
}
if (!this.state.items || this.state.items?.length === 0) {
this.getItems();
return (
return errorMessage(
<>
{errorMessage(
<>
<MdLocalMall />
<span className="title">
{variables.getMessage('modals.main.addons.empty.title')}
</span>
<span className="subtitle">
{variables.getMessage('modals.main.marketplace.no_items')}
</span>
</>,
)}
</>
<MdLocalMall />
<span className="title">{variables.getMessage('modals.main.addons.empty.title')}</span>
<span className="subtitle">
{variables.getMessage('modals.main.marketplace.no_items')}
</span>
</>,
);
}
@@ -380,7 +372,11 @@ class Marketplace extends PureComponent {
onClick={() => this.installCollection()}
disabled={this.state.busy}
icon={<MdLibraryAdd />}
label={this.state.busy ? variables.getMessage('modals.main.marketplace.installing') : variables.getMessage('modals.main.marketplace.add_all')}
label={
this.state.busy
? variables.getMessage('modals.main.marketplace.installing')
: variables.getMessage('modals.main.marketplace.add_all')
}
/>
</div>
</>

View File

@@ -54,7 +54,6 @@ class ItemPage extends PureComponent {
(item) => item.type === convertedType && item.name !== this.props.data.data.name,
),
});
console.log(this.state.curator);
} catch (e) {
console.error(e);
}
@@ -157,8 +156,6 @@ class ItemPage extends PureComponent {
</div>
);
console.log(this.props.data.data)
return (
<>
<Modal

View File

@@ -3,6 +3,7 @@ import { useState, memo } from 'react';
import { Checkbox, Slider } from 'components/Form/Settings';
import { Button } from 'components/Elements';
import { TextField } from '@mui/material';
import { toast } from 'react-toastify';
import EventBus from 'utils/eventbus';
import values from 'utils/data/slider_values.json';
@@ -59,6 +60,16 @@ function ExperimentalOptions() {
onClick={() => EventBus.emit(eventType, eventName)}
label="Send"
/>
<Button
type="settings"
onClick={() => toast('Toasted successfully')}
label="Normal Toast"
/>
<Button
type="settings"
onClick={() => toast.success('Toasted successfully')}
label="Achievement Unlocked Toast"
/>
</Action>
</Row>
<Row final={true}>