MSP-3203 create ConfigSchemaModal
This commit is contained in:
1 parent
1e80abec3d
commit
e2a788578b
3 files changed
+47
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import { ModalPropsType } from '@widgets/Modal/modal.type.ts'
|
||||
|
||||
export interface ConfigSchemaModalPropsType
|
||||
extends Omit<ModalPropsType, 'title' | 'children'> {
|
||||
schema: JSONSchema
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
@import "src/constants/style/styleConst";
|
||||
|
||||
.config-schema-modal {
|
||||
.modal__wrap {
|
||||
min-width: 880px;
|
||||
}
|
||||
|
||||
.json-schema-view {
|
||||
padding: $basic-padding
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { JsonSchemaViewer } from '@stoplight/json-schema-viewer'
|
||||
import { FC } from 'react'
|
||||
|
||||
import Modal from '@widgets/Modal'
|
||||
|
||||
import { ConfigSchemaModalPropsType } from '@components/ConfigSchemaModal/config-schema-moda.type.ts'
|
||||
|
||||
import './config-schema-modal.scss'
|
||||
|
||||
const ConfigSchemaModal: FC<ConfigSchemaModalPropsType> = ({
|
||||
open,
|
||||
onClose,
|
||||
schema
|
||||
}) => {
|
||||
return (
|
||||
<div className="config-schema-modal">
|
||||
<Modal title="Текущая схема конфигурации" open={open} onClose={onClose}>
|
||||
<JsonSchemaViewer
|
||||
viewMode="view"
|
||||
className="json-schema-view"
|
||||
schema={schema}
|
||||
emptyText="No schema defined"
|
||||
defaultExpandedDepth={99}
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ConfigSchemaModal
|
||||
Reference in new issue
Block a user