1
- import { makeStyles } from "@mui/styles" ;
2
- import { Sidebar } from "./Sidebar" ;
3
- import { Stack } from "components/Stack/Stack" ;
4
- import { createContext , FC , Suspense , useContext } from "react" ;
1
+ import { createContext , type FC , Suspense , useContext } from "react" ;
5
2
import { Helmet } from "react-helmet-async" ;
3
+ import { useQuery } from "react-query" ;
6
4
import { pageTitle } from "utils/page" ;
5
+ import { Stack } from "components/Stack/Stack" ;
7
6
import { Loader } from "components/Loader/Loader" ;
8
7
import { Outlet , useParams } from "react-router-dom" ;
9
8
import { Margins } from "components/Margins/Margins" ;
10
- import { useQuery } from "react-query" ;
11
9
import { useOrganizationId } from "hooks/useOrganizationId" ;
12
10
import { templateByName } from "api/queries/templates" ;
13
- import { type AuthorizationResponse , type Template } from "api/typesGenerated" ;
11
+ import type { AuthorizationResponse , Template } from "api/typesGenerated" ;
14
12
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
15
13
import { checkAuthorization } from "api/queries/authCheck" ;
14
+ import { Sidebar } from "./Sidebar" ;
16
15
17
16
const TemplateSettings = createContext <
18
17
{ template : Template ; permissions : AuthorizationResponse } | undefined
@@ -28,7 +27,6 @@ export function useTemplateSettings() {
28
27
}
29
28
30
29
export const TemplateSettingsLayout : FC = ( ) => {
31
- const styles = useStyles ( ) ;
32
30
const orgId = useOrganizationId ( ) ;
33
31
const { template : templateName } = useParams ( ) as { template : string } ;
34
32
const templateQuery = useQuery ( templateByName ( orgId , templateName ) ) ;
@@ -58,7 +56,13 @@ export const TemplateSettingsLayout: FC = () => {
58
56
</ Helmet >
59
57
60
58
< Margins >
61
- < Stack className = { styles . wrapper } direction = "row" spacing = { 10 } >
59
+ < Stack
60
+ css = { ( theme ) => ( {
61
+ padding : theme . spacing ( 6 , 0 ) ,
62
+ } ) }
63
+ direction = "row"
64
+ spacing = { 10 }
65
+ >
62
66
{ templateQuery . isError || permissionsQuery . isError ? (
63
67
< ErrorAlert error = { templateQuery . error } />
64
68
) : (
@@ -70,7 +74,11 @@ export const TemplateSettingsLayout: FC = () => {
70
74
>
71
75
< Sidebar template = { templateQuery . data } />
72
76
< Suspense fallback = { < Loader /> } >
73
- < main className = { styles . content } >
77
+ < main
78
+ css = { {
79
+ width : "100%" ,
80
+ } }
81
+ >
74
82
< Outlet />
75
83
</ main >
76
84
</ Suspense >
@@ -81,13 +89,3 @@ export const TemplateSettingsLayout: FC = () => {
81
89
</ >
82
90
) ;
83
91
} ;
84
-
85
- const useStyles = makeStyles ( ( theme ) => ( {
86
- wrapper : {
87
- padding : theme . spacing ( 6 , 0 ) ,
88
- } ,
89
-
90
- content : {
91
- width : "100%" ,
92
- } ,
93
- } ) ) ;
0 commit comments