diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-16 00:35:40 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-16 00:35:40 +0800 |
commit | ce151f630d10664353ff1c9172a7495557792abe (patch) | |
tree | 702cd4382ecd73d82608057816147179df5cf3df /packages/react-docs/src/components/doc_reference.tsx | |
parent | 96d145f54ff559fe6a46626e73c67e716d6927cd (diff) | |
download | dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar.gz dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar.bz2 dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar.lz dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar.xz dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.tar.zst dexon-sol-tools-ce151f630d10664353ff1c9172a7495557792abe.zip |
feat: highlighted sidebar as you scroll on doc reference pages
Diffstat (limited to 'packages/react-docs/src/components/doc_reference.tsx')
-rw-r--r-- | packages/react-docs/src/components/doc_reference.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/react-docs/src/components/doc_reference.tsx b/packages/react-docs/src/components/doc_reference.tsx index da05b04f8..3a909db7e 100644 --- a/packages/react-docs/src/components/doc_reference.tsx +++ b/packages/react-docs/src/components/doc_reference.tsx @@ -97,15 +97,15 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc if (!_.isUndefined(markdownFileIfExists)) { // Special-case replace the `introduction` sectionName with the package name const isIntroductionSection = sectionName === 'introduction'; - const finalSectionName = isIntroductionSection ? this.props.docsInfo.displayName : sectionName; const headerSize = isIntroductionSection ? HeaderSizes.H1 : HeaderSizes.H3; return ( <MarkdownSection key={`markdown-section-${sectionName}`} - sectionName={finalSectionName} + sectionName={sectionName} headerSize={headerSize} markdownContent={markdownFileIfExists} shouldReformatTitle={false} + alternativeSectionTitle={isIntroductionSection ? this.props.docsInfo.displayName : undefined} /> ); } @@ -196,7 +196,9 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc )} {!_.isEmpty(docSection.functions) && ( <div> - {!isExportedFunctionSection && <h2 style={headerStyle}>Functions</h2>} + {!isExportedFunctionSection && ( + <div style={{ ...headerStyle, fontSize: '1.5em' }}>Functions</div> + )} <div>{functionDefs}</div> </div> )} |