mirror of
https://github.com/mue/mue.git
synced 2026-06-08 14:10:42 +02:00
feat: hot reload support for some widgets, css improvements on marketplace
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import EventBus from '../../../modules/helpers/eventbus';
|
||||
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import MicIcon from '@material-ui/icons/Mic';
|
||||
|
||||
@@ -40,7 +42,7 @@ export default class Search extends React.PureComponent {
|
||||
window.location.href = this.state.url + `?${this.state.query}=` + value;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
init() {
|
||||
let url;
|
||||
let query = 'q';
|
||||
let microphone = null;
|
||||
@@ -70,6 +72,27 @@ export default class Search extends React.PureComponent {
|
||||
});
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
EventBus.on('refresh', (data) => {
|
||||
if (data === 'search') {
|
||||
const element = document.querySelector('.searchBar');
|
||||
|
||||
if (localStorage.getItem('searchBar') === 'false') {
|
||||
return element.style.display = 'none';
|
||||
}
|
||||
|
||||
element.style.display = 'block';
|
||||
this.init();
|
||||
}
|
||||
});
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
EventBus.remove('refresh');
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<form action={this.state.url} className='searchBar'>
|
||||
|
||||
Reference in New Issue
Block a user