mirror of
https://github.com/mue/mue.git
synced 2026-06-08 14:10:42 +02:00
fix(background): custom colour default
This commit is contained in:
@@ -10,31 +10,22 @@ import '../scss/_colourpicker.scss';
|
|||||||
|
|
||||||
const ColourOptions = () => {
|
const ColourOptions = () => {
|
||||||
const [colour, setColour] = useState(
|
const [colour, setColour] = useState(
|
||||||
localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 0)',
|
localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 100)',
|
||||||
);
|
);
|
||||||
|
|
||||||
const changeColour = (output) => {
|
const changeColour = (output) => {
|
||||||
setColour(output);
|
setColour(output);
|
||||||
localStorage.setItem('customBackgroundColour', output);
|
localStorage.setItem('customBackgroundColour', output);
|
||||||
EventBus.emit('refresh', 'background');
|
EventBus.emit('refresh', 'background');
|
||||||
showReminder();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const resetColour = () => {
|
const resetColour = () => {
|
||||||
setColour('rgba(0, 0, 0, 0)');
|
setColour('rgba(0, 0, 0, 0)');
|
||||||
localStorage.setItem('customBackgroundColour', 'rgba(0, 0, 0, 0)');
|
localStorage.setItem('customBackgroundColour', 'rgba(0, 0, 0, 100)');
|
||||||
toast(variables.getMessage('toasts.reset'));
|
toast(variables.getMessage('toasts.reset'));
|
||||||
EventBus.emit('refresh', 'background');
|
EventBus.emit('refresh', 'background');
|
||||||
showReminder();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const showReminder = () => {
|
|
||||||
const reminderInfo = document.querySelector('.reminder-info');
|
|
||||||
if (reminderInfo.style.display !== 'block') {
|
|
||||||
reminderInfo.style.display = 'block';
|
|
||||||
localStorage.setItem('showReminder', true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row final={true}>
|
<Row final={true}>
|
||||||
|
|||||||
Reference in New Issue
Block a user