Skip to content

Commit

Permalink
add community authors integration
Browse files Browse the repository at this point in the history
  • Loading branch information
nsjames authored and nsjames committed Jul 3, 2023
1 parent 705257c commit 65a8796
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
11 changes: 11 additions & 0 deletions src/evm-sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ const sidebars = {
],
"collapsed": false
},
{
"type": "category",
"label": "Core Concepts",
"items": [
{
"type": "autogenerated",
"dirName": "15_core-concepts"
}
],
"collapsed": false
},
{
"type": "category",
"label": "Smart Contracts",
Expand Down
54 changes: 14 additions & 40 deletions src/theme/TOC/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export default function TOC({className, ...props}) {

const suggestEditsLink = `https://github.com/eosnetworkfoundation/docs/edit/main${doc.metadata.source.replace('@site','').replace('docs/', 'native/')}`;

const { contributors } = doc.frontMatter;

useEffect(() => {
Object.keys(allDocsData).forEach((key) => {
const { localKey, pluginId } = getPathKey(pathname);
Expand Down Expand Up @@ -123,46 +125,6 @@ export default function TOC({className, ...props}) {

return (
<div className={clsx(styles.tableOfContents, 'thin-scrollbar', className)}>
{/*<Select*/}
{/* options={options}*/}
{/* value={currentVersion}*/}
{/* className={styles.select}*/}
{/* onChange={handleOnChange}*/}
{/* isSearchable={false}*/}
{/* styles={{*/}
{/* control: (provided, state) => ({*/}
{/* ...provided,*/}
{/* background: '#F4F5F6',*/}
{/* borderRadius: '6px',*/}
{/* height: '60px',*/}
{/* width: '310px',*/}
{/* margin: 'auto',*/}
{/* outline: 'none',*/}
{/* padding: '10px 24px'*/}
{/* }),*/}
{/* indicatorSeparator: (provided, state) => ({*/}
{/* ...provided,*/}
{/* display: 'none'*/}
{/* }),*/}
{/* dropdownIndicator: (provided, state) => ({*/}
{/* ...provided,*/}
{/* color: '#000000',*/}
{/* padding: '0px 10px'*/}
{/* }),*/}
{/* menu: (provided, state) => ({*/}
{/* ...provided,*/}
{/* background: '#F4F5F6',*/}
{/* borderRadius: '6px',*/}
{/* width: '310px',*/}
{/* margin: 'auto',*/}
{/* outline: 'none',*/}
{/* }),*/}
{/* menuList: (provided, state) => ({*/}
{/* ...provided,*/}
{/* padding: '0px'*/}
{/* }),*/}
{/* }}*/}
{/* />*/}
{canEditOrSuggest && <div className={clsx(styles.linkContainer, props.toc.length && styles.linkContainerWithTOC)}>
<a className={styles.link} href={suggestEditsLink} target="_blank">
<FontAwesomeIcon icon={faBug} />&nbsp; Suggest Edits
Expand All @@ -171,6 +133,18 @@ export default function TOC({className, ...props}) {
<FontAwesomeIcon icon={faCodePullRequest} />&nbsp; Request Changes
</a>
</div>}

{contributors && contributors.length && <section>
<figure className={styles.contributorsLabel}>Community authors</figure>
<section className={styles.contributorsList}>
{contributors.map((contributor, index) => (
<figure key={index}>
<a href={"https://github.com/"+contributor.github} target="_blank">{contributor.name}</a>
</figure>
))}
</section>
</section>}

<TOCItems
{...props}
linkClassName={LINK_CLASS_NAME}
Expand Down
15 changes: 15 additions & 0 deletions src/theme/TOC/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
gap: 12px;
}

.contributorsLabel {
font-size: 11px;
margin-top: 20px;
}

.contributorsList {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 12px;

font-size: 13px;
text-decoration: underline;
}

.linkContainerWithTOC {
padding-bottom: 18px;
margin-bottom: 10px;
Expand Down

0 comments on commit 65a8796

Please sign in to comment.