Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lex111/cleanpu-code…
Browse files Browse the repository at this point in the history
…blocks
  • Loading branch information
lex111 committed Oct 28, 2020
2 parents 861fd48 + f085560 commit c6f98df
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
20 changes: 11 additions & 9 deletions packages/docusaurus-theme-classic/src/theme/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,9 @@ export default ({
</div>
)}
<div className={styles.codeBlockContent}>
<button
tabIndex={0}
ref={button}
type="button"
aria-label="Copy code to clipboard"
className={clsx(styles.copyButton)}
onClick={handleCopyCode}>
{showCopied ? 'Copied' : 'Copy'}
</button>
<div
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
tabIndex={0}
className={clsx(className, styles.codeBlock, {
[styles.codeBlockWithTitle]: codeBlockTitle,
})}>
Expand All @@ -243,6 +236,15 @@ export default ({
})}
</div>
</div>

<button
ref={button}
type="button"
aria-label="Copy code to clipboard"
className={clsx(styles.copyButton)}
onClick={handleCopyCode}>
{showCopied ? 'Copied' : 'Copy'}
</button>
</div>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ function NavItemMobile({
);
}

const menuListHeight = menuListRef.current?.scrollHeight
? `${menuListRef.current?.scrollHeight}px`
: undefined;

return (
<li
className={clsx('menu__list-item', {
Expand All @@ -197,9 +201,7 @@ function NavItemMobile({
className="menu__list"
ref={menuListRef}
style={{
height: !collapsed
? `${menuListRef.current?.scrollHeight}px`
: undefined,
height: !collapsed ? menuListHeight : undefined,
}}>
{items.map(({className: childItemClassName, ...childItemProps}, i) => (
<li className="menu__list-item" key={i}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ function SkipToContent(): JSX.Element {
};

return (
<button
type="button"
tabIndex={0}
className={styles.skipToContent}
onKeyDown={handleSkip}>
Skip to main content
</button>
<nav aria-label="Skip navigation links">
<button
type="button"
tabIndex={0}
className={styles.skipToContent}
onKeyDown={handleSkip}>
Skip to main content
</button>
</nav>
);
}

Expand Down
2 changes: 1 addition & 1 deletion website-1.x/docs/tutorial-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Assume you are happy with the current state of the documentation and want to fre
npm run examples versions
```

That command generates a `versions.js` file, which will be used to list down all the versions of docs in the project.
That command generates a `versions.json` file, which will be used to list down all the versions of docs in the project.

Next, you run a command with the version you want to create, like `1.0.0`.

Expand Down

0 comments on commit c6f98df

Please sign in to comment.