[WEB-5491] refactor: onboarding tour components (#8167)

This commit is contained in:
Prateek Shourya
2025-12-01 17:14:28 +05:30
committed by GitHub
parent 60220801ac
commit a05cd88a53
4 changed files with 14 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ import { useUser } from "@/hooks/store/user";
// local imports
import { TourSidebar } from "./sidebar";
type Props = {
export type TOnboardingTourProps = {
onComplete: () => void;
};
@@ -28,7 +28,7 @@ const TOUR_STEPS: {
key: TTourSteps;
title: string;
description: string;
image: any;
image: string;
prevStep?: TTourSteps;
nextStep?: TTourSteps;
}[] = [
@@ -75,7 +75,7 @@ const TOUR_STEPS: {
},
];
export const TourRoot = observer(function TourRoot(props: Props) {
export const TourRoot = observer(function TourRoot(props: TOnboardingTourProps) {
const { onComplete } = props;
// states
const [step, setStep] = useState<TTourSteps>("welcome");
@@ -89,12 +89,12 @@ export const TourRoot = observer(function TourRoot(props: Props) {
return (
<>
{step === "welcome" ? (
<div className="h-3/4 w-4/5 overflow-hidden rounded-[10px] bg-custom-background-100 md:w-1/2 lg:w-2/5">
<div className="w-4/5 overflow-hidden rounded-[10px] bg-custom-background-100 md:w-1/2 lg:w-2/5">
<div className="h-full overflow-hidden">
<div className="grid h-3/5 place-items-center bg-custom-primary-100">
<PlaneLockup className="h-10 w-auto text-custom-text-100" />
<div className="grid h-64 place-items-center bg-custom-primary-100">
<PlaneLockup className="h-10 w-auto text-white" />
</div>
<div className="flex h-2/5 flex-col overflow-y-auto p-6">
<div className="flex flex-col overflow-y-auto p-6">
<h3 className="font-semibold sm:text-xl">
Welcome to Plane, {currentUser?.first_name} {currentUser?.last_name}
</h3>
@@ -103,7 +103,7 @@ export const TourRoot = observer(function TourRoot(props: Props) {
started by creating a project.
</p>
<div className="flex h-full items-end">
<div className="mt-8 flex items-center gap-6">
<div className="mt-12 flex items-center gap-6">
<Button
variant="primary"
onClick={() => {

View File

@@ -1,12 +1,13 @@
// icons
// plane imports
import { CycleIcon, ModuleIcon, PageIcon, ViewsIcon, WorkItemsIcon } from "@plane/propel/icons";
import type { ISvgIcons } from "@plane/propel/icons";
// types
import type { TTourSteps } from "./root";
const sidebarOptions: {
key: TTourSteps;
label: string;
Icon: any;
Icon: React.FC<ISvgIcons>;
}[] = [
{
key: "work-items",

View File

@@ -4,15 +4,14 @@ import useSWR from "swr";
// plane imports
import { PRODUCT_TOUR_TRACKER_EVENTS } from "@plane/constants";
import { ContentWrapper } from "@plane/ui";
// components
import { TourRoot } from "@/components/onboarding/tour";
// helpers
import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useHome } from "@/hooks/store/use-home";
import { useUserProfile, useUser } from "@/hooks/store/user";
// plane web components
// plane web imports
import { HomePeekOverviewsRoot } from "@/plane-web/components/home";
import { TourRoot } from "@/plane-web/components/onboarding/tour/root";
// local imports
import { DashboardWidgets } from "./home-dashboard-widgets";
import { UserGreetingsView } from "./user-greetings";
@@ -53,7 +52,7 @@ export const WorkspaceHomeView = observer(function WorkspaceHomeView() {
return (
<>
{currentUserProfile && !currentUserProfile.is_tour_completed && (
<div className="fixed left-0 top-0 z-20 grid h-full w-full place-items-center bg-custom-backdrop bg-opacity-50 transition-opacity">
<div className="fixed left-0 top-0 z-20 grid h-full w-full place-items-center bg-custom-backdrop bg-opacity-50 transition-opacity overflow-y-auto">
<TourRoot onComplete={handleTourCompleted} />
</div>
)}

View File

@@ -1 +0,0 @@
export * from "./root";