chore: updated to resolvedTheme

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
Adithya Krishna
2024-03-14 00:47:54 +05:30
parent cc483016d8
commit df8d394c28

View File

@@ -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} />;
}; };