mirror of
https://github.com/mue/mue.git
synced 2026-07-16 05:23:49 +02:00
feat: integrate EventBus for color change refresh in Greeting, Quote, and Time options
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useT } from 'contexts';
|
||||
import { useState } from 'react';
|
||||
import EventBus from 'utils/eventbus';
|
||||
|
||||
import {
|
||||
Header,
|
||||
@@ -240,6 +241,7 @@ const GreetingOptions = ({ currentSubSection, onSubSectionChange, sectionName })
|
||||
const color = event.target.value;
|
||||
setGreetingColor(color);
|
||||
localStorage.setItem('greetingColor', color);
|
||||
EventBus.emit('refresh', 'greeting');
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useT } from 'contexts';
|
||||
import variables from 'config/variables';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import EventBus from 'utils/eventbus';
|
||||
import {
|
||||
MdCancel,
|
||||
MdAdd,
|
||||
@@ -199,6 +200,7 @@ const QuoteOptions = ({ currentSubSection, onSubSectionChange, sectionName }) =>
|
||||
const color = event.target.value;
|
||||
setQuoteColor(color);
|
||||
localStorage.setItem('quoteColor', color);
|
||||
EventBus.emit('refresh', 'quote');
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useT } from 'contexts';
|
||||
import React, { useState } from 'react';
|
||||
import EventBus from 'utils/eventbus';
|
||||
|
||||
import { Header, Row, Content, Action, PreferencesWrapper, Section } from 'components/Layout/Settings';
|
||||
import { Checkbox, Dropdown, Radio } from 'components/Form/Settings';
|
||||
@@ -30,6 +31,7 @@ const TimeOptions = ({ currentSubSection, onSubSectionChange, sectionName }) =>
|
||||
setSecondColour(colour);
|
||||
}
|
||||
localStorage.setItem(type, colour);
|
||||
EventBus.emit('refresh', 'clock');
|
||||
};
|
||||
|
||||
const WidgetType = () => {
|
||||
@@ -220,6 +222,7 @@ const TimeOptions = ({ currentSubSection, onSubSectionChange, sectionName }) =>
|
||||
const color = event.target.value;
|
||||
setClockColor(color);
|
||||
localStorage.setItem('clockColor', color);
|
||||
EventBus.emit('refresh', 'clock');
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user