-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathindex.js
28 lines (25 loc) · 881 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* eslint-disable react/prop-types */
import React from "react"
import ConvertDefinitionMenuItem from "./components/convert-definition-menu-item"
import ConvertModal from "./components/convert-modal"
export default {
components: {
ConvertDefinitionMenuItem,
ConvertModal,
},
wrapComponents: {
Topbar: (Ori) => props => {
const ConvertModal = props.getComponent("ConvertModal")
return <div>
<Ori {...props} />
{props.topbarSelectors.showModal("convert") && <ConvertModal
getComponent={props.getComponent}
editorContent={props.specSelectors.specStr()}
converterUrl={props.getConfigs().swagger2ConverterUrl}
updateEditorContent={content => props.specActions.updateSpec(content, "insert")}
onClose={() => props.topbarActions.hideModal("convert")}
/>}
</div>
}
}
}