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:
parent
98367f540c
commit
0ec0ca133a
15 changed files with 113 additions and 202 deletions
|
|
@ -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>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue