aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/components/doc_reference.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-15 18:27:56 +0800
committerFabio Berger <me@fabioberger.com>2018-10-15 18:27:56 +0800
commiteee0640b07bcddccbddf68618f2772b1de92a18d (patch)
tree98f132b1b36c507f9bfb66042b7ee6e01338766e /packages/react-docs/src/components/doc_reference.tsx
parent4298da118f8cb7ca54b255576894bc98b7f7b374 (diff)
downloaddexon-0x-contracts-eee0640b07bcddccbddf68618f2772b1de92a18d.tar.gz
dexon-0x-contracts-eee0640b07bcddccbddf68618f2772b1de92a18d.tar.zst
dexon-0x-contracts-eee0640b07bcddccbddf68618f2772b1de92a18d.zip
chore: many small stylistic changes
Diffstat (limited to 'packages/react-docs/src/components/doc_reference.tsx')
-rw-r--r--packages/react-docs/src/components/doc_reference.tsx17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/react-docs/src/components/doc_reference.tsx b/packages/react-docs/src/components/doc_reference.tsx
index 38ec818db..c70b99b19 100644
--- a/packages/react-docs/src/components/doc_reference.tsx
+++ b/packages/react-docs/src/components/doc_reference.tsx
@@ -1,7 +1,9 @@
import {
colors,
constants as sharedConstants,
+ Container,
EtherscanLinkSuffixes,
+ HeaderSizes,
Link,
MarkdownSection,
Networks,
@@ -101,11 +103,17 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc
const closestVersion = sortedEligibleVersions[0];
const markdownFileIfExists = this.props.docsInfo.sectionNameToMarkdownByVersion[closestVersion][sectionName];
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={sectionName}
+ sectionName={finalSectionName}
+ headerSize={headerSize}
markdownContent={markdownFileIfExists}
+ shouldReformatTitle={false}
/>
);
}
@@ -215,6 +223,13 @@ export class DocReference extends React.Component<DocReferenceProps, DocReferenc
<div>{typeDefs}</div>
</div>
)}
+ <Container
+ width={'100%'}
+ height={'1px'}
+ backgroundColor={colors.grey300}
+ marginTop={'32px'}
+ marginBottom={'12px'}
+ />
</div>
);
}