From bfde0e018a6928be16a1336d050817841b91fdc1 Mon Sep 17 00:00:00 2001 From: LAKHAN BAHETI Date: Mon, 20 Nov 2023 09:59:19 +0530 Subject: [PATCH] refactor: imports --- web/components/onboarding/invite-members.tsx | 8 +++++--- web/components/onboarding/join-workspaces.tsx | 6 ++---- web/components/onboarding/workspace.tsx | 10 +++++++--- web/components/page-views/signin.tsx | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/web/components/onboarding/invite-members.tsx b/web/components/onboarding/invite-members.tsx index e76b90cc4..e7374ced1 100644 --- a/web/components/onboarding/invite-members.tsx +++ b/web/components/onboarding/invite-members.tsx @@ -1,4 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; +// next +import Image from "next/image"; // headless ui import { Listbox, Transition } from "@headlessui/react"; // react-hook-form @@ -9,6 +11,8 @@ import { WorkspaceService } from "services/workspace.service"; import useToast from "hooks/use-toast"; // ui import { Button, Input } from "@plane/ui"; +// components +import OnboardingStepIndicator from "components/account/step-indicator"; // hooks import useDynamicDropdownPosition from "hooks/use-dynamic-dropdown"; // icons @@ -17,11 +21,9 @@ import { Check, ChevronDown, Plus, User2, X, XCircle } from "lucide-react"; import { IUser, IWorkspace, TOnboardingSteps, TUserWorkspaceRole } from "types"; // constants import { ROLE } from "constants/workspace"; -import OnboardingStepIndicator from "components/account/step-indicator"; -import { useTheme } from "next-themes"; +// assets import user1 from "public/users/user-1.png"; import user2 from "public/users/user-2.png"; -import Image from "next/image"; type Props = { finishOnboarding: () => Promise; diff --git a/web/components/onboarding/join-workspaces.tsx b/web/components/onboarding/join-workspaces.tsx index 9cde07883..462a01091 100644 --- a/web/components/onboarding/join-workspaces.tsx +++ b/web/components/onboarding/join-workspaces.tsx @@ -1,17 +1,15 @@ -import React, { useState } from "react"; - +import React from "react"; // hooks import useUser from "hooks/use-user"; // components import Invitations from "./invitations"; import DummySidebar from "components/account/sidebar"; import OnboardingStepIndicator from "components/account/step-indicator"; +import { Workspace } from "./workspace"; // types import { IWorkspace, TOnboardingSteps } from "types"; // react-hook-form import { Controller, useForm } from "react-hook-form"; -// icons -import { Workspace } from "./workspace"; type Props = { finishOnboarding: () => Promise; diff --git a/web/components/onboarding/workspace.tsx b/web/components/onboarding/workspace.tsx index d76de588c..25ccb0fcb 100644 --- a/web/components/onboarding/workspace.tsx +++ b/web/components/onboarding/workspace.tsx @@ -3,12 +3,16 @@ import { useState } from "react"; import { Button, Input } from "@plane/ui"; // types import { IUser, IWorkspace, TOnboardingSteps } from "types"; +// hooks +import useToast from "hooks/use-toast"; +// services +import { WorkspaceService } from "services/workspace.service"; +// mobx +import { useMobxStore } from "lib/mobx/store-provider"; // constants import { RESTRICTED_URLS } from "constants/workspace"; +// react-hook-form import { Control, Controller, FieldErrors, UseFormHandleSubmit, UseFormSetValue } from "react-hook-form"; -import { WorkspaceService } from "services/workspace.service"; -import useToast from "hooks/use-toast"; -import { useMobxStore } from "lib/mobx/store-provider"; type Props = { stepChange: (steps: Partial) => Promise; diff --git a/web/components/page-views/signin.tsx b/web/components/page-views/signin.tsx index 11d1524de..2acbbbde7 100644 --- a/web/components/page-views/signin.tsx +++ b/web/components/page-views/signin.tsx @@ -70,7 +70,7 @@ export const SignInView = observer(() => { const workspaceSlug = userSettings?.workspace?.last_workspace_slug || userSettings?.workspace?.fallback_workspace_slug; if (workspaceSlug) router.push(`/${workspaceSlug}`); - // else if (userSettings.workspace.invites > 0) router.push("/invitations"); + else if (userSettings.workspace.invites > 0) router.push("/invitations"); else router.push("/create-workspace"); }) .catch(() => {