Skip to content

Refactor/change onboarding design#270

Open
egalvis27 wants to merge 9 commits intomainfrom
refactor/change-onboarding-design
Open

Refactor/change onboarding design#270
egalvis27 wants to merge 9 commits intomainfrom
refactor/change-onboarding-design

Conversation

@egalvis27
Copy link

What is Changed / Added


The necessary changes have been made to adjust the application's onboarding to the design that should be used on all platforms.

Comment on lines +18 to +21
const updateTheme = (newTheme: Theme) => {
setTheme(newTheme);
applyThemeClass(newTheme);
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you dont use arrow functions there is no need in adding this inside the useEffect or add them as a dependency

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

applyThemeClass(newTheme);
};

const resolveTheme = (configTheme: ConfigTheme) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,61 @@
import { useEffect, useState } from 'react';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to add tests to this. If necessary, extract the functions outside the hook (So that it is easier for you to test them) and wrap it inside a folder if necessary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -1,30 +1,47 @@
import { ReactNode } from 'react';
Copy link

@AlexisMora AlexisMora Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are changing the component and it is not tested, we need to add test so that the next time it recieves changes, we know that it does not break anything

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
children: ReactNode;
customClassName?: string;
disabled?: boolean;
}

export default function Button(props: ButtonProps) {
const [isExecuting, setIsExecuting] = useState(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is way easier to let the consumer of this component have the responsability of setting if is executing or not. Pass down the isExecuting as a prop and not as a useState

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,23 @@
import { OnboardingSlideProps } from '../helpers';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test for this since you delete the other component and his test

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,61 @@
import { useEffect, useState } from 'react';
import { ConfigTheme, Theme, ThemeData } from '../../shared/types/Theme';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we could think this through and add a common context for this sort of things, such as theme, language, maybe user products..etc.
So that we only have one state for this (Since a global, common state for these values is enough)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not worth doing right now. The components that use the theme in such a complex way at this point are only those involved in onboarding.


export const BackupsSlide: React.FC<OnboardingSlideProps> = () => {
const { translate } = useTranslationContext();
const { theme } = useTheme();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An argument in favor of common contet: This way we dont duplicate states.

Base automatically changed from refactor/app-config to main March 11, 2026 13:12
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.9% Coverage on New Code (required ≥ 80%)
6.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@egalvis27 egalvis27 requested a review from AlexisMora March 11, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants