improve styling of swagger

feat/swagger-snippets
Agusti Fernandez Pardo 2022-04-17 18:57:05 +02:00
parent f9dd38dafd
commit 93f4afe26b
2 changed files with 15 additions and 11 deletions

View File

@ -21,18 +21,19 @@ const requestSnippets = {
}, },
}, },
defaultExpanded: true, defaultExpanded: true,
languages: ["curl_bash"], languages: ["curl_bash", "curl_powershell", "curl_cmd", "node"],
// e.g. only show curl bash = ["curl_bash"] // e.g. only shxwow curl bash = ["curl_bash"]
}; };
export default function APIDocs() { export default function APIDocs() {
return ( return (
<SwaggerUI <SwaggerUI
requestSnippets={requestSnippets} requestSnippets={requestSnippets}
requestSnippetsEnabled={true} requestSnippetsEnabled={true}
docExpansion="none" docExpansion="list"
operationsSorter="method" operationsSorter="method"
filter={true} filter={true}
url={process.env.NEXT_PUBLIC_SWAGGER_DOCS_URL || "https://api.cal.com/api/docs"} tagsSorter="alpha"
url={process.env.NEXT_PUBLIC_SWAGGER_DOCS_URL || "http://localhost:3002/docs"}
/> />
); );
} }

View File

@ -175,11 +175,12 @@
.swagger-ui .opblock .opblock-summary-method { .swagger-ui .opblock .opblock-summary-method {
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
min-width: 80px; min-width: 90px;
padding: 3px 12px; height: 100%;
text-align: center;
margin-left: -5px; margin-left: -5px;
display: table; display: flex;
justify-content: center;
align-items: center;
border-radius: 0px; border-radius: 0px;
background: #000; background: #000;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
@ -252,8 +253,8 @@
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
flex-direction: column; flex-direction: row;
padding: 15px; /* padding: 15px; */
cursor: pointer; cursor: pointer;
-webkit-box-align: left; -webkit-box-align: left;
-ms-flex-align: left; -ms-flex-align: left;
@ -726,8 +727,9 @@
} }
.swagger-ui .authorization__btn { .swagger-ui .authorization__btn {
padding: 0 10px; padding: 5px;
border: none; border: none;
width: 30px;
background: none; background: none;
} }
@ -771,6 +773,7 @@
display: flex; display: flex;
background: black; background: black;
color: white; color: white;
width: inherit;
border: none; border: none;
} }
@media only screen and (max-width: 600px) { @media only screen and (max-width: 600px) {