-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(topbar): allow to configure components present in Topbar (#3623)
Refs #3556
- Loading branch information
Showing
10 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/standalone/topbar-new-editor-button/components/NewEditorButton.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
|
||
const NewEditorButton = ({ getComponent }) => { | ||
const Link = getComponent("Link") | ||
|
||
return ( | ||
<Link href="https://editor-next.swagger.io/" className="new-editor-cta" target="_blank"> | ||
<span>Try our new Editor</span> | ||
</Link> | ||
) | ||
} | ||
|
||
NewEditorButton.propTypes = { | ||
getComponent: PropTypes.func.isRequired, | ||
} | ||
|
||
|
||
export default NewEditorButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import NewEditorButton from "./components/NewEditorButton" | ||
|
||
const TopbarNewEditorButtonPlugin = () => ({ | ||
components: { | ||
TopbarNewEditorButton: NewEditorButton, | ||
} | ||
}) | ||
|
||
export default TopbarNewEditorButtonPlugin |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
|
||
import DropdownMenu from "./DropdownMenu" | ||
|
||
const AboutMenu = ({ getComponent, ...rest }) => { | ||
const Link = getComponent("Link") | ||
|
||
return ( | ||
<DropdownMenu {...rest}> | ||
<li><Link href="https://swagger.io/tools/swagger-editor/" target="_blank">About Swagger Editor</Link></li> | ||
<li><Link href="https://swagger.io/docs/open-source-tools/swagger-editor/" target="_blank">View Docs</Link></li> | ||
<li><Link href="https://github.com/swagger-api/swagger-editor" target="_blank">View on GitHub</Link></li> | ||
</DropdownMenu> | ||
) | ||
} | ||
|
||
AboutMenu.propTypes = { | ||
getComponent: PropTypes.func.isRequired, | ||
} | ||
|
||
|
||
export default AboutMenu |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters