Skip to content

Commit 73c8f35

Browse files
committed
refactor(web): rename withProvider to withOnboardingProvider for clarity
1 parent b35b310 commit 73c8f35

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

packages/web/src/auth/ProtectedRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactNode, useEffect } from "react";
1+
import { ReactNode, useEffect } from "react";
22
import { useNavigate } from "react-router-dom";
33
import { AUTH_FAILURE_REASONS } from "@web/common/constants/auth.constants";
44
import { ROOT_ROUTES } from "@web/common/constants/routes";

packages/web/src/views/Onboarding/OnboardingFlow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { IS_DEV } from "@web/common/constants/env.constants";
55
import { useIsMobile } from "@web/common/hooks/useIsMobile";
66
import {
77
useOnboarding,
8-
withProvider,
8+
withOnboardingProvider,
99
} from "@web/views/Onboarding/components/OnboardingContext";
1010
import { Onboarding, OnboardingStepProps, OnboardingStepType } from "./index";
1111
import {
@@ -222,5 +222,5 @@ const _OnboardingFlow: React.FC = () => {
222222
);
223223
};
224224

225-
export const OnboardingFlow = withProvider(_OnboardingFlow);
225+
export const OnboardingFlow = withOnboardingProvider(_OnboardingFlow);
226226
export default OnboardingFlow;

packages/web/src/views/Onboarding/components/OnboardingContext.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export const useOnboarding = (): OnboardingContextType => {
4949
return context;
5050
};
5151

52-
export const withProvider = (Component: React.ComponentType<any>) => {
52+
export const withOnboardingProvider = (
53+
Component: React.ComponentType<unknown>,
54+
) => {
5355
// eslint-disable-next-line react/display-name
5456
return (props: any) => {
5557
return (

packages/web/src/views/Onboarding/steps/events/MigrationSandbox/MigrationSandbox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fireEvent, screen } from "@testing-library/react";
33
import { within } from "@testing-library/react";
44
import userEvent from "@testing-library/user-event";
55
import { render } from "@web/__tests__/__mocks__/mock.render";
6-
import { withProvider } from "../../../components/OnboardingContext";
6+
import { withOnboardingProvider } from "../../../components/OnboardingContext";
77
import { MigrationSandbox } from "./MigrationSandbox";
88

99
// Mock the useOnboardingShortcuts hook
@@ -16,7 +16,7 @@ const mockUseOnboardingShortcuts =
1616
require("../../../hooks/useOnboardingShortcuts").useOnboardingShortcuts;
1717

1818
// Wrap the component with OnboardingProvider
19-
const SomedayMigrationWithProvider = withProvider(MigrationSandbox);
19+
const SomedayMigrationWithProvider = withOnboardingProvider(MigrationSandbox);
2020

2121
// Mock required props for SomedayMigration
2222
const defaultProps = {

packages/web/src/views/Onboarding/steps/events/SomedaySandbox/SomedaySandbox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import "@testing-library/jest-dom";
33
import { screen, waitFor } from "@testing-library/react";
44
import userEvent from "@testing-library/user-event";
55
import { render } from "@web/__tests__/__mocks__/mock.render";
6-
import { withProvider } from "../../../components/OnboardingContext";
6+
import { withOnboardingProvider } from "../../../components/OnboardingContext";
77
import { SomedaySandbox } from "./SomedaySandbox";
88

99
// Mock the createAndSubmitEvents function
@@ -16,7 +16,7 @@ jest.mock("./sandbox.util", () => ({
1616
}));
1717

1818
// Wrap the component with OnboardingProvider
19-
const SomedaySandboxWithProvider = withProvider(SomedaySandbox);
19+
const SomedaySandboxWithProvider = withOnboardingProvider(SomedaySandbox);
2020

2121
// Mock required props for SomedaySandbox
2222
const defaultProps = {

packages/web/src/views/Onboarding/steps/oauth/SignInWithGoogle.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AuthApi } from "@web/common/apis/auth.api";
99
import { SyncApi } from "@web/common/apis/sync.api";
1010
import { ENV_WEB } from "@web/common/constants/env.constants";
1111
import { useGoogleLogin } from "@web/components/oauth/google/useGoogleLogin";
12-
import { withProvider } from "../../components/OnboardingContext";
12+
import { withOnboardingProvider } from "../../components/OnboardingContext";
1313
import { SignInWithGoogle } from "./SignInWithGoogle";
1414

1515
// Mock the APIs
@@ -46,7 +46,7 @@ const mockUseGoogleLogin = useGoogleLogin as jest.MockedFunction<
4646
>;
4747

4848
// Wrap the component with OnboardingProvider
49-
const SignInWithGoogleWithProvider = withProvider(SignInWithGoogle);
49+
const SignInWithGoogleWithProvider = withOnboardingProvider(SignInWithGoogle);
5050

5151
describe("SignInWithGoogle", () => {
5252
const mockOnNext = jest.fn();

0 commit comments

Comments
 (0)