Skip to content

Commit

Permalink
feat(gatsby-theme-docz): add showMarkdownEditButton flag
Browse files Browse the repository at this point in the history
fixes #1291
  • Loading branch information
rakannimer committed Nov 30, 2019
1 parent e8e86fc commit 8fd04e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/gatsby-theme-docz/src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const Header = props => {
const { onOpen } = props
const {
repository,
themeConfig: { showDarkModeSwitch },
themeConfig: { showDarkModeSwitch, showMarkdownEditButton },
} = useConfig()
const { edit = true, ...doc } = useCurrentDoc()
const [colorMode, setColorMode] = useColorMode()
Expand Down Expand Up @@ -47,7 +47,7 @@ export const Header = props => {
</button>
)}
</Flex>
{edit && doc.link && (
{showMarkdownEditButton && edit && doc.link && (
<a
sx={styles.editButton}
href={doc.link}
Expand Down
6 changes: 6 additions & 0 deletions core/gatsby-theme-docz/src/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ const typography = toTheme(moraga)

export default merge(typography, {
initialColorMode: 'light',
// Show errors above playground editor
showLiveError: true,
// Show preview of the code inside playground
showLivePreview: true,
// Show editor when a playground is rendered
showPlaygroundEditor: true,
// Show dark/light mode switch toggle in header
showDarkModeSwitch: true,
// Display edit this page button on every page
showMarkdownEditButton: true,
colors: {
...modes.light,
modes: {
Expand Down

0 comments on commit 8fd04e8

Please sign in to comment.