Skip to content

Commit a05cd88

Browse files
[WEB-5491] refactor: onboarding tour components (#8167)
1 parent 6022080 commit a05cd88

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

apps/web/core/components/onboarding/tour/root.tsx renamed to apps/web/ce/components/onboarding/tour/root.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useUser } from "@/hooks/store/user";
1818
// local imports
1919
import { TourSidebar } from "./sidebar";
2020

21-
type Props = {
21+
export type TOnboardingTourProps = {
2222
onComplete: () => void;
2323
};
2424

@@ -28,7 +28,7 @@ const TOUR_STEPS: {
2828
key: TTourSteps;
2929
title: string;
3030
description: string;
31-
image: any;
31+
image: string;
3232
prevStep?: TTourSteps;
3333
nextStep?: TTourSteps;
3434
}[] = [
@@ -75,7 +75,7 @@ const TOUR_STEPS: {
7575
},
7676
];
7777

78-
export const TourRoot = observer(function TourRoot(props: Props) {
78+
export const TourRoot = observer(function TourRoot(props: TOnboardingTourProps) {
7979
const { onComplete } = props;
8080
// states
8181
const [step, setStep] = useState<TTourSteps>("welcome");
@@ -89,12 +89,12 @@ export const TourRoot = observer(function TourRoot(props: Props) {
8989
return (
9090
<>
9191
{step === "welcome" ? (
92-
<div className="h-3/4 w-4/5 overflow-hidden rounded-[10px] bg-custom-background-100 md:w-1/2 lg:w-2/5">
92+
<div className="w-4/5 overflow-hidden rounded-[10px] bg-custom-background-100 md:w-1/2 lg:w-2/5">
9393
<div className="h-full overflow-hidden">
94-
<div className="grid h-3/5 place-items-center bg-custom-primary-100">
95-
<PlaneLockup className="h-10 w-auto text-custom-text-100" />
94+
<div className="grid h-64 place-items-center bg-custom-primary-100">
95+
<PlaneLockup className="h-10 w-auto text-white" />
9696
</div>
97-
<div className="flex h-2/5 flex-col overflow-y-auto p-6">
97+
<div className="flex flex-col overflow-y-auto p-6">
9898
<h3 className="font-semibold sm:text-xl">
9999
Welcome to Plane, {currentUser?.first_name} {currentUser?.last_name}
100100
</h3>
@@ -103,7 +103,7 @@ export const TourRoot = observer(function TourRoot(props: Props) {
103103
started by creating a project.
104104
</p>
105105
<div className="flex h-full items-end">
106-
<div className="mt-8 flex items-center gap-6">
106+
<div className="mt-12 flex items-center gap-6">
107107
<Button
108108
variant="primary"
109109
onClick={() => {

apps/web/core/components/onboarding/tour/sidebar.tsx renamed to apps/web/ce/components/onboarding/tour/sidebar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// icons
1+
// plane imports
22
import { CycleIcon, ModuleIcon, PageIcon, ViewsIcon, WorkItemsIcon } from "@plane/propel/icons";
3+
import type { ISvgIcons } from "@plane/propel/icons";
34
// types
45
import type { TTourSteps } from "./root";
56

67
const sidebarOptions: {
78
key: TTourSteps;
89
label: string;
9-
Icon: any;
10+
Icon: React.FC<ISvgIcons>;
1011
}[] = [
1112
{
1213
key: "work-items",

apps/web/core/components/home/root.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import useSWR from "swr";
44
// plane imports
55
import { PRODUCT_TOUR_TRACKER_EVENTS } from "@plane/constants";
66
import { ContentWrapper } from "@plane/ui";
7-
// components
8-
import { TourRoot } from "@/components/onboarding/tour";
97
// helpers
108
import { captureSuccess } from "@/helpers/event-tracker.helper";
119
// hooks
1210
import { useHome } from "@/hooks/store/use-home";
1311
import { useUserProfile, useUser } from "@/hooks/store/user";
14-
// plane web components
12+
// plane web imports
1513
import { HomePeekOverviewsRoot } from "@/plane-web/components/home";
14+
import { TourRoot } from "@/plane-web/components/onboarding/tour/root";
1615
// local imports
1716
import { DashboardWidgets } from "./home-dashboard-widgets";
1817
import { UserGreetingsView } from "./user-greetings";
@@ -53,7 +52,7 @@ export const WorkspaceHomeView = observer(function WorkspaceHomeView() {
5352
return (
5453
<>
5554
{currentUserProfile && !currentUserProfile.is_tour_completed && (
56-
<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">
55+
<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">
5756
<TourRoot onComplete={handleTourCompleted} />
5857
</div>
5958
)}

apps/web/core/components/onboarding/tour/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)