feat: converting space app to use nextjs app dir (#4451)
* feat: changemod space * fix: space app dir fixes * fix: build errors
This commit is contained in:
parent
087d54a261
commit
febf19ccc0
98 changed files with 1038 additions and 1551 deletions
|
|
@ -1,4 +1,7 @@
|
|||
export * from "./user-mobx-provider";
|
||||
|
||||
export * from "./use-instance";
|
||||
export * from "./user";
|
||||
export * from "./use-project";
|
||||
export * from "./use-issue";
|
||||
export * from "./use-user";
|
||||
export * from "./use-user-profile";
|
||||
export * from "./use-issue-details";
|
||||
export * from "./use-issue-filter";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
import { IInstanceStore } from "@/store/instance.store";
|
||||
|
||||
export const useInstance = (): IInstanceStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useInstance must be used within StoreProvider");
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.instance;
|
||||
};
|
||||
|
|
|
|||
11
space/hooks/store/use-issue-details.tsx
Normal file
11
space/hooks/store/use-issue-details.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { IIssueDetailStore } from "@/store/issue-detail.store";
|
||||
|
||||
export const useIssueDetails = (): IIssueDetailStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.issueDetail;
|
||||
};
|
||||
11
space/hooks/store/use-issue-filter.ts
Normal file
11
space/hooks/store/use-issue-filter.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { IIssueFilterStore } from "@/store/issue-filters.store";
|
||||
|
||||
export const useIssueFilter = (): IIssueFilterStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.issueFilter;
|
||||
};
|
||||
11
space/hooks/store/use-issue.ts
Normal file
11
space/hooks/store/use-issue.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { IIssueStore } from "@/store/issue.store";
|
||||
|
||||
export const useIssue = (): IIssueStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.issue;
|
||||
};
|
||||
11
space/hooks/store/use-project.ts
Normal file
11
space/hooks/store/use-project.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { IProjectStore } from "@/store/project.store";
|
||||
|
||||
export const useProject = (): IProjectStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.project;
|
||||
};
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
import { IProfileStore } from "@/store/user/profile.store";
|
||||
import { IProfileStore } from "@/store/profile.store";
|
||||
|
||||
export const useUserProfile = (): IProfileStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
|
||||
return context.user.userProfile;
|
||||
return context.user.profile;
|
||||
};
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import { useContext } from "react";
|
||||
// lib
|
||||
import { StoreContext } from "@/lib/app-providers";
|
||||
// store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
import { IUserStore } from "@/store/user";
|
||||
import { IUserStore } from "@/store/user.store";
|
||||
|
||||
export const useUser = (): IUserStore => {
|
||||
const context = useContext(StoreContext);
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { useContext } from "react";
|
||||
// store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export const useMobxStore = (): RootStore => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("useMobxStore must be used within StoreProvider");
|
||||
return context;
|
||||
};
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export * from "./use-user";
|
||||
export * from "./use-user-profile";
|
||||
Loading…
Add table
Add a link
Reference in a new issue