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( const [minuteColour, setMinuteColour] = useState(
localStorage.getItem('minuteColour') || '#ffffff', localStorage.getItem('minuteColour') || '#ffffff',
); );
const TIME_SECTION = 'modals.main.settings.sections.time';
const updateColour = (type, event) => { const updateColour = (type, event) => {
const colour = event.target.value; const colour = event.target.value;
@ -23,10 +24,6 @@ const TimeSettings = () => {
localStorage.setItem(type, colour); localStorage.setItem(type, colour);
}; };
let timeSettings = null;
const TIME_SECTION = 'modals.main.settings.sections.time';
const WidgetType = () => { const WidgetType = () => {
return ( return (
<Row final={timeType === 'percentageComplete'}> <Row final={timeType === 'percentageComplete'}>
@ -190,19 +187,18 @@ const TimeSettings = () => {
</> </>
); );
switch (timeType) { const getTimeSettings = () => {
case 'digital': switch (timeType) {
timeSettings = digitalSettings; case 'digital':
break; return digitalSettings;
case 'analogue': case 'analogue':
timeSettings = analogSettings; return analogSettings;
break; case 'verticalClock':
case 'verticalClock': return verticalClock;
timeSettings = verticalClock; default:
break; return null;
default: }
timeSettings = null; };
}
return ( return (
<> <>
@ -216,7 +212,7 @@ const TimeSettings = () => {
/> />
<PreferencesWrapper setting="time" zoomSetting="zoomClock" visibilityToggle={true}> <PreferencesWrapper setting="time" zoomSetting="zoomClock" visibilityToggle={true}>
<WidgetType /> <WidgetType />
{timeSettings} {getTimeSettings()}
</PreferencesWrapper> </PreferencesWrapper>
</> </>
); );

View File

@ -64,11 +64,11 @@ function WelcomeModal({ modalClose, modalSkip }) {
localStorage.removeItem('welcomeTab'); localStorage.removeItem('welcomeTab');
}; };
const goBackward = () => { const prevTab = () => {
updateTabAndButtonText(currentTab - 1); updateTabAndButtonText(currentTab - 1);
}; };
const goForward = () => { const nextTab = () => {
if (buttonText === variables.getMessage('modals.welcome.buttons.finish')) { if (buttonText === variables.getMessage('modals.welcome.buttons.finish')) {
modalClose(); modalClose();
return; return;
@ -86,7 +86,7 @@ function WelcomeModal({ modalClose, modalSkip }) {
{currentTab !== 0 ? ( {currentTab !== 0 ? (
<Button <Button
type="settings" type="settings"
onClick={() => goBackward()} onClick={() => prevTab()}
icon={<MdArrowBackIosNew />} icon={<MdArrowBackIosNew />}
label={variables.getMessage('modals.welcome.buttons.previous')} label={variables.getMessage('modals.welcome.buttons.previous')}
/> />
@ -100,7 +100,7 @@ function WelcomeModal({ modalClose, modalSkip }) {
)} )}
<Button <Button
type="settings" type="settings"
onClick={() => goForward()} onClick={() => nextTab()}
icon={<MdArrowForwardIos />} icon={<MdArrowForwardIos />}
label={buttonText} label={buttonText}
iconPlacement={'right'} iconPlacement={'right'}