chore: updated to resolvedTheme
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@@ -9,12 +9,12 @@ import 'swagger-ui-react/swagger-ui.css';
|
|||||||
import { OpenAPIV1 } from '@documenso/api/v1/openapi';
|
import { OpenAPIV1 } from '@documenso/api/v1/openapi';
|
||||||
|
|
||||||
export const OpenApiDocsPage = () => {
|
export const OpenApiDocsPage = () => {
|
||||||
const { theme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const body = document.body;
|
const body = document.body;
|
||||||
|
|
||||||
if (theme === 'dark') {
|
if (resolvedTheme === 'dark') {
|
||||||
body.classList.add('swagger-dark-theme');
|
body.classList.add('swagger-dark-theme');
|
||||||
} else {
|
} else {
|
||||||
body.classList.remove('swagger-dark-theme');
|
body.classList.remove('swagger-dark-theme');
|
||||||
@@ -23,7 +23,7 @@ export const OpenApiDocsPage = () => {
|
|||||||
return () => {
|
return () => {
|
||||||
body.classList.remove('swagger-dark-theme');
|
body.classList.remove('swagger-dark-theme');
|
||||||
};
|
};
|
||||||
}, [theme]);
|
}, [resolvedTheme]);
|
||||||
|
|
||||||
return <SwaggerUI spec={OpenAPIV1} displayOperationId={true} />;
|
return <SwaggerUI spec={OpenAPIV1} displayOperationId={true} />;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user