fix(welcome): Naming convention

This commit is contained in:
alexsparkes 2024-02-21 11:46:01 +00:00
parent a45238ea54
commit 03a55a21bd
2 changed files with 18 additions and 22 deletions

View File

@ -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>
</>
);

View File

@ -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'}