mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
fix(v1): check repo url before using on Users page (#2331)
* fix: check repoUrl before rendering edit link in users * refactor: prettier
This commit is contained in:
parent
7fd242aeb1
commit
590de95234
2 changed files with 11 additions and 6 deletions
|
@ -18,7 +18,6 @@ class Users extends React.Component {
|
|||
return null;
|
||||
}
|
||||
|
||||
const editUrl = `${siteConfig.repoUrl}/edit/master/website/siteConfig.js`;
|
||||
const showcase = siteConfig.users.map(user => (
|
||||
<a href={user.infoLink} key={user.infoLink}>
|
||||
<img src={user.image} alt={user.caption} title={user.caption} />
|
||||
|
@ -34,10 +33,16 @@ class Users extends React.Component {
|
|||
<p>This project is used by many folks</p>
|
||||
</div>
|
||||
<div className="logos">{showcase}</div>
|
||||
<p>Are you using this project?</p>
|
||||
<a href={editUrl} className="button">
|
||||
Add your company
|
||||
</a>
|
||||
{siteConfig.repoUrl && (
|
||||
<>
|
||||
<p>Are you using this project?</p>
|
||||
<a
|
||||
href={`${siteConfig.repoUrl}/edit/master/website/siteConfig.js`}
|
||||
className="button">
|
||||
Add your company
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
|
|
|
@ -104,7 +104,7 @@ const siteConfig = {
|
|||
|
||||
// You may provide arbitrary config keys to be used as needed by your
|
||||
// template. For example, if you need your repo's URL...
|
||||
// repoUrl: 'https://github.com/facebook/test-site',
|
||||
// repoUrl: 'https://github.com/facebook/test-site',
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue