refactor: remove unused hooks (#2474)

* chore: remove useProjects hook

* chore: remove useWorkspaces hook

* chore: remove useWorkspaceDetails hook

* chore: remove useTheme hook
This commit is contained in:
Aaryan Khandelwal 2023-10-18 16:59:53 +05:30 committed by GitHub
parent 98367f540c
commit 0ec0ca133a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 113 additions and 202 deletions

View file

@ -1,9 +1,9 @@
import { FC } from "react";
// react-hook-form
import { useRouter } from "next/router";
import { observer } from "mobx-react-lite";
import { Control, Controller, UseFormWatch } from "react-hook-form";
// hooks
import useProjects from "hooks/use-projects";
// mobx store
import { useMobxStore } from "lib/mobx/store-provider";
// components
import { SelectRepository, TFormValues, TIntegrationSteps } from "components/integration";
// ui
@ -21,8 +21,15 @@ type Props = {
watch: UseFormWatch<TFormValues>;
};
export const GithubImportData: FC<Props> = ({ handleStepChange, integration, control, watch }) => {
const { projects } = useProjects();
export const GithubImportData: FC<Props> = observer((props) => {
const { handleStepChange, integration, control, watch } = props;
const router = useRouter();
const { workspaceSlug } = router.query;
const { project: projectStore } = useMobxStore();
const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined;
const options = projects
? projects.map((project) => ({
@ -121,4 +128,4 @@ export const GithubImportData: FC<Props> = ({ handleStepChange, integration, con
</div>
</div>
);
};
});