mirror of https://github.com/mue/mue.git
fix(welcome): Naming convention
This commit is contained in:
parent
a45238ea54
commit
03a55a21bd
|
@ -12,6 +12,7 @@ const TimeSettings = () => {
|
|||
const [minuteColour, setMinuteColour] = useState(
|
||||
localStorage.getItem('minuteColour') || '#ffffff',
|
||||
);
|
||||
const TIME_SECTION = 'modals.main.settings.sections.time';
|
||||
|
||||
const updateColour = (type, event) => {
|
||||
const colour = event.target.value;
|
||||
|
@ -23,10 +24,6 @@ const TimeSettings = () => {
|
|||
localStorage.setItem(type, colour);
|
||||
};
|
||||
|
||||
let timeSettings = null;
|
||||
|
||||
const TIME_SECTION = 'modals.main.settings.sections.time';
|
||||
|
||||
const WidgetType = () => {
|
||||
return (
|
||||
<Row final={timeType === 'percentageComplete'}>
|
||||
|
@ -190,19 +187,18 @@ const TimeSettings = () => {
|
|||
</>
|
||||
);
|
||||
|
||||
switch (timeType) {
|
||||
case 'digital':
|
||||
timeSettings = digitalSettings;
|
||||
break;
|
||||
case 'analogue':
|
||||
timeSettings = analogSettings;
|
||||
break;
|
||||
case 'verticalClock':
|
||||
timeSettings = verticalClock;
|
||||
break;
|
||||
default:
|
||||
timeSettings = null;
|
||||
}
|
||||
const getTimeSettings = () => {
|
||||
switch (timeType) {
|
||||
case 'digital':
|
||||
return digitalSettings;
|
||||
case 'analogue':
|
||||
return analogSettings;
|
||||
case 'verticalClock':
|
||||
return verticalClock;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -216,7 +212,7 @@ const TimeSettings = () => {
|
|||
/>
|
||||
<PreferencesWrapper setting="time" zoomSetting="zoomClock" visibilityToggle={true}>
|
||||
<WidgetType />
|
||||
{timeSettings}
|
||||
{getTimeSettings()}
|
||||
</PreferencesWrapper>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -64,11 +64,11 @@ function WelcomeModal({ modalClose, modalSkip }) {
|
|||
localStorage.removeItem('welcomeTab');
|
||||
};
|
||||
|
||||
const goBackward = () => {
|
||||
const prevTab = () => {
|
||||
updateTabAndButtonText(currentTab - 1);
|
||||
};
|
||||
|
||||
const goForward = () => {
|
||||
const nextTab = () => {
|
||||
if (buttonText === variables.getMessage('modals.welcome.buttons.finish')) {
|
||||
modalClose();
|
||||
return;
|
||||
|
@ -86,7 +86,7 @@ function WelcomeModal({ modalClose, modalSkip }) {
|
|||
{currentTab !== 0 ? (
|
||||
<Button
|
||||
type="settings"
|
||||
onClick={() => goBackward()}
|
||||
onClick={() => prevTab()}
|
||||
icon={<MdArrowBackIosNew />}
|
||||
label={variables.getMessage('modals.welcome.buttons.previous')}
|
||||
/>
|
||||
|
@ -100,7 +100,7 @@ function WelcomeModal({ modalClose, modalSkip }) {
|
|||
)}
|
||||
<Button
|
||||
type="settings"
|
||||
onClick={() => goForward()}
|
||||
onClick={() => nextTab()}
|
||||
icon={<MdArrowForwardIos />}
|
||||
label={buttonText}
|
||||
iconPlacement={'right'}
|
||||
|
|
Loading…
Reference in New Issue