Skip to content

Commit

Permalink
Preload onboarding (#606)
Browse files Browse the repository at this point in the history
* no lazy onboarding

* no lazy onboarding steps

* Do not lazy load onboarding to prevent lazy-load white flash
  • Loading branch information
timothycarambat authored Jan 16, 2024
1 parent 8b11288 commit e973c1e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import PrivateRoute, {
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import Login from "@/pages/Login";
import OnboardingFlow from "@/pages/OnboardingFlow";

import { PfpProvider } from "./PfpContext";
import { LogoProvider } from "./LogoContext";

Expand Down Expand Up @@ -42,7 +44,6 @@ const DataConnectors = lazy(
const DataConnectorSetup = lazy(
() => import("@/pages/GeneralSettings/DataConnectors/Connectors")
);
const OnboardingFlow = lazy(() => import("@/pages/OnboardingFlow"));

export default function App() {
return (
Expand Down
30 changes: 20 additions & 10 deletions frontend/src/pages/OnboardingFlow/Steps/index.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import { ArrowLeft, ArrowRight } from "@phosphor-icons/react";
import { lazy, useState } from "react";
import { useState } from "react";
import { isMobile } from "react-device-detect";
import Home from "./Home";
import LLMPreference from "./LLMPreference";
import EmbeddingPreference from "./EmbeddingPreference";
import VectorDatabaseConnection from "./VectorDatabaseConnection";
import CustomLogo from "./CustomLogo";
import UserSetup from "./UserSetup";
import DataHandling from "./DataHandling";
import Survey from "./Survey";
import CreateWorkspace from "./CreateWorkspace";

const OnboardingSteps = {
home: lazy(() => import("./Home")),
"llm-preference": lazy(() => import("./LLMPreference")),
"embedding-preference": lazy(() => import("./EmbeddingPreference")),
"vector-database": lazy(() => import("./VectorDatabaseConnection")),
"custom-logo": lazy(() => import("./CustomLogo")),
"user-setup": lazy(() => import("./UserSetup")),
"data-handling": lazy(() => import("./DataHandling")),
survey: lazy(() => import("./Survey")),
"create-workspace": lazy(() => import("./CreateWorkspace")),
home: Home,
"llm-preference": LLMPreference,
"embedding-preference": EmbeddingPreference,
"vector-database": VectorDatabaseConnection,
"custom-logo": CustomLogo,
"user-setup": UserSetup,
"data-handling": DataHandling,
survey: Survey,
"create-workspace": CreateWorkspace,
};

export default OnboardingSteps;
Expand Down

0 comments on commit e973c1e

Please sign in to comment.