- Notifications
You must be signed in to change notification settings - Fork1k
chore(site): refactor deployment values service to react-query#9669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
8276805
cd90ead
84979c2
dd5cfbf
d640c9c
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import*asAPIfrom"api/api"; | ||
exportconstdeploymentConfig=()=>{ | ||
return{ | ||
queryKey:["deployment","config"], | ||
Member
| ||
queryFn:API.getDeploymentConfig, | ||
}; | ||
}; | ||
exportconstdeploymentDAUs=()=>{ | ||
return{ | ||
queryKey:["deployment","daus"], | ||
queryFn:()=>API.getDeploymentDAUs(), | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,20 +3,16 @@ import { Margins } from "components/Margins/Margins"; | ||
import { Stack } from "components/Stack/Stack"; | ||
import { Sidebar } from "./Sidebar"; | ||
import { createContext, Suspense, useContext, FC } from "react"; | ||
import { Loader } from "components/Loader/Loader"; | ||
import { RequirePermission } from "components/RequirePermission/RequirePermission"; | ||
import { usePermissions } from "hooks/usePermissions"; | ||
import { Outlet } from "react-router-dom"; | ||
import { DeploymentConfig } from "api/api"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { deploymentConfig } from "api/queries/deployment"; | ||
type DeploySettingsContextValue = { | ||
deploymentValues: DeploymentConfig; | ||
}; | ||
const DeploySettingsContext = createContext< | ||
@@ -34,14 +30,8 @@ export const useDeploySettings = (): DeploySettingsContextValue => { | ||
}; | ||
export const DeploySettingsLayout: FC = () => { | ||
Member
| ||
constdeploymentConfigQuery =useQuery(deploymentConfig()); | ||
const styles = useStyles(); | ||
const permissions = usePermissions(); | ||
return ( | ||
@@ -50,13 +40,10 @@ export const DeploySettingsLayout: FC = () => { | ||
<Stack className={styles.wrapper} direction="row" spacing={6}> | ||
<Sidebar /> | ||
<main className={styles.content}> | ||
{deploymentConfigQuery.data ? ( | ||
<DeploySettingsContext.Provider | ||
value={{ | ||
deploymentValues: deploymentConfigQuery.data, | ||
}} | ||
> | ||
<Suspense fallback={<Loader />}> | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.