mirror of
https://github.com/mue/mue.git
synced 2026-07-09 13:35:35 +02:00
perf: cleanup and better error boundary/sideload components
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
|
||||
|
||||
export default class ErrorBoundary extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -21,6 +23,7 @@ export default class ErrorBoundary extends React.PureComponent {
|
||||
return (
|
||||
<div className='emptyitems'>
|
||||
<div className='emptyMessage'>
|
||||
<ErrorOutlineIcon/>
|
||||
<h1>{this.language.title}</h1>
|
||||
<p>{this.language.message}</p>
|
||||
<button className='refresh' onClick={() => window.location.reload()}>{this.language.refresh}</button>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import LocalMallIcon from '@material-ui/icons/LocalMall';
|
||||
|
||||
import FileUpload from '../../settings/FileUpload';
|
||||
|
||||
import MarketplaceFunctions from '../../../../../modules/helpers/marketplace';
|
||||
@@ -13,9 +15,13 @@ export default function Sideload() {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<FileUpload id='file-input' type='settings' accept='application/json' loadFunction={(e) => install(JSON.parse(e.target.result))} />
|
||||
<button className='addToMue sideload' onClick={() => document.getElementById('file-input').click()}>{window.language.modals.main.addons.sideload}</button>
|
||||
</>
|
||||
<div className='emptyitems'>
|
||||
<div className='emptyMessage'>
|
||||
<FileUpload id='file-input' type='settings' accept='application/json' loadFunction={(e) => install(JSON.parse(e.target.result))} />
|
||||
<LocalMallIcon/>
|
||||
<h1>{window.language.modals.main.addons.sideload}</h1>
|
||||
<button className='addToMue sideload' onClick={() => document.getElementById('file-input').click()}>{window.language.modals.main.settings.sections.background.source.upload}</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
|
||||
.sideload {
|
||||
margin-top: 12px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.stop {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
// Navbar
|
||||
import Settings from '@material-ui/icons/Settings';
|
||||
import Settings from '@material-ui/icons/SettingsRounded';
|
||||
import Addons from '@material-ui/icons/Widgets';
|
||||
import Marketplace from '@material-ui/icons/ShoppingBasket';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user