mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
chore: updated styling
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@ -1,9 +0,0 @@
|
||||
/* Custom CSS for dark mode */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.swagger-ui {
|
||||
filter: invert(85%) hue-rotate(180deg);
|
||||
}
|
||||
.swagger-ui .microlight {
|
||||
filter: invert(100%) hue-rotate(180deg);
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,30 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { useTheme } from 'next-themes';
|
||||
import SwaggerUI from 'swagger-ui-react';
|
||||
import 'swagger-ui-react/swagger-ui.css';
|
||||
|
||||
import { OpenAPIV1 } from '@documenso/api/v1/openapi';
|
||||
|
||||
// Custom Dark Mode CSS for the Swagger UI
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
import './api-documentation.css';
|
||||
|
||||
export const OpenApiDocsPage = () => {
|
||||
const { theme } = useTheme();
|
||||
|
||||
useEffect(() => {
|
||||
const body = document.body;
|
||||
|
||||
if (theme === 'dark') {
|
||||
body.classList.add('swagger-dark-theme');
|
||||
} else {
|
||||
body.classList.remove('swagger-dark-theme');
|
||||
}
|
||||
|
||||
return () => {
|
||||
body.classList.remove('swagger-dark-theme');
|
||||
};
|
||||
}, [theme]);
|
||||
|
||||
return <SwaggerUI spec={OpenAPIV1} displayOperationId={true} />;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user