Skip to content

Commit

Permalink
Code review corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance committed Dec 4, 2019
1 parent 9d37fba commit 421f61e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions addons/docs/src/blocks/DocsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ export const DocsContainer: FunctionComponent<DocsContainerProps> = ({ context,
}, 200);
}
} else {
let element = document.getElementById(anchorBlockIdFromId(storyId));
if (!element) {
element = document.getElementById(storyBlockIdFromId(storyId));
}
const element =
document.getElementById(anchorBlockIdFromId(storyId)) ||
document.getElementById(storyBlockIdFromId(storyId));
if (element) {
const allStories = element.parentElement.querySelectorAll('[id|="anchor-"]');
let block = 'start';
Expand Down
2 changes: 0 additions & 2 deletions addons/docs/src/frameworks/common/preset.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import createCompiler from '@storybook/addon-docs/mdx-compiler-plugin';
// @ts-ignore
import remarkSlug from 'remark-slug';
// @ts-ignore
import remarkExternalLinks from 'remark-external-links';

function createBabelOptions(babelOptions?: any, configureJSX?: boolean) {
Expand Down
2 changes: 2 additions & 0 deletions addons/docs/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ declare module '@storybook/addon-docs/blocks';
declare module 'global';
declare module 'react-is';
declare module '@egoist/vue-to-react';
declare module "remark-slug";
declare module "remark-external-links";

0 comments on commit 421f61e

Please sign in to comment.