feat: hot reload support for some widgets, css improvements on marketplace

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2021-04-12 18:55:02 +01:00
parent fbe6e040ea
commit b370de9ea3
17 changed files with 147 additions and 25 deletions

View File

@@ -1,5 +1,7 @@
import React from 'react';
import EventBus from '../../../../../modules/helpers/eventbus';
import DragHandleIcon from '@material-ui/icons/DragIndicator';
import { sortableContainer, sortableElement } from 'react-sortable-hoc';
@@ -63,6 +65,7 @@ export default class OrderSettings extends React.PureComponent {
componentDidUpdate() {
localStorage.setItem('order', JSON.stringify(this.state.items));
EventBus.dispatch('refresh', 'order');
}
render() {

View File

@@ -10,15 +10,15 @@ export default function QuoteSettings() {
return (
<>
<h2>{quote.title}</h2>
<Switch name='quote' text={window.language.modals.main.settings.enabled} />
<Checkbox name='authorLink' text={quote.author_link}/>
<Text title={quote.custom} name='customQuote'/>
<Text title={quote.custom_author} name='customQuoteAuthor'/>
<Switch name='quote' text={window.language.modals.main.settings.enabled} category='quote' />
<Checkbox name='authorLink' text={quote.author_link} category='quote' />
<Text title={quote.custom} name='customQuote' category='quote' />
<Text title={quote.custom_author} name='customQuoteAuthor' category='quote'/>
<h3>{quote.buttons.title}</h3>
<Checkbox name='copyButton' text={quote.buttons.copy}/>
<Checkbox name='tweetButton' text={quote.buttons.tweet}/>
<Checkbox name='favouriteQuoteEnabled' text={quote.buttons.favourite}/>
<Checkbox name='copyButton' text={quote.buttons.copy} category='quote'/>
<Checkbox name='tweetButton' text={quote.buttons.tweet} category='quote'/>
<Checkbox name='favouriteQuoteEnabled' text={quote.buttons.favourite} category='quote'/>
</>
);
}

View File

@@ -4,6 +4,8 @@ import Dropdown from '../Dropdown';
import Checkbox from '../Checkbox';
import Switch from '../Switch';
import EventBus from '../../../../../modules/helpers/eventbus';
import { isChrome } from 'react-device-detect';
import { toast } from 'react-toastify';
@@ -44,6 +46,8 @@ export default class SearchSettings extends React.PureComponent {
if (this.state.customEnabled === true && this.state.customValue !== '') {
localStorage.setItem('customSearchEngine', this.state.customValue);
}
EventBus.dispatch('refresh', 'search');
}
setSearchEngine(input) {
@@ -59,6 +63,8 @@ export default class SearchSettings extends React.PureComponent {
});
localStorage.setItem('searchEngine', input);
}
EventBus.dispatch('refresh', 'search');
}
render() {
@@ -68,7 +74,7 @@ export default class SearchSettings extends React.PureComponent {
return (
<>
<h2>{search.title}</h2>
<Switch name='searchBar' text={language.enabled} />
<Switch name='searchBar' text={language.enabled} category='search' />
{isChrome ? <Checkbox name='voiceSearch' text={search.voice_search} /> : null}
<Dropdown label={search.search_engine} name='searchEngine' onChange={(value) => this.setSearchEngine(value)}>