2024-06-28 14:52:13: merge [main:483f760b403ae5c9d0cb5ace25a08bf0b5f41799];

This commit is contained in:
txix committed 2024-06-28 14:52:13 +03:00
1 parent 0dbf4b0b07
commit 2ebeb14f0e
32 files changed
+113 -72

No files matched your search

+8 -3
View File
@@ -1,7 +1,9 @@
import RefParser from '@apidevtools/json-schema-ref-parser'
import JSONSchemaView from 'json-schema-view-js'
import cloneDeep from 'lodash.clonedeep'
import React, { useEffect, useRef } from 'react'
import { FC, useContext, useEffect, useRef } from 'react'
import { Context } from '@stores/index.tsx'
import 'json-schema-view-js/dist/style.min.css'
@@ -9,7 +11,8 @@ interface JsonSchemaViewerProps {
schema: object
}
const JsonSchemaViewer: React.FC<JsonSchemaViewerProps> = ({ schema }) => {
const JsonSchemaViewer: FC<JsonSchemaViewerProps> = ({ schema }) => {
const { changeTheme } = useContext(Context)
const myRef = useRef<HTMLDivElement>(null)
useEffect(() => {
@@ -28,7 +31,9 @@ const JsonSchemaViewer: React.FC<JsonSchemaViewerProps> = ({ schema }) => {
if (err) {
console.log(err)
} else {
const view = new JSONSchemaView(dereferencedSchema, 3)
const view = new JSONSchemaView(dereferencedSchema, 3, {
theme: changeTheme ? 'dark' : ''
})
if (myRef.current) {
myRef.current.appendChild(view.render())
}
+3 -3
View File
@@ -5,7 +5,7 @@
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(211, 211, 211, 0.8);
background-color: var(--ant-color-bg-mask);
width: 100%;
height: 100%;
display: flex;
@@ -17,7 +17,7 @@
min-height: 170px;
max-height: 90vh;
max-width: 90%;
background: white;
background: var(--ant-layout-light-sider-bg);
color: white;
z-index: 10;
border-radius: 16px;
@@ -32,7 +32,7 @@
&__header {
height: 50px;
background: white;
background: var(--ant-layout-light-sider-bg);
overflow: hidden;
border-top-left-radius: 16px;
border-top-right-radius: 16px;