Skip to content

Commit

Permalink
Update footer and remove unused request
Browse files Browse the repository at this point in the history
Signed-off-by: isamrish <askmaurya48@gmail.com>
  • Loading branch information
isamrish committed Aug 31, 2021
1 parent d0f204c commit 3dbdddd
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 302 deletions.
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"react-dropdown": "^1.9.2",
"react-feather": "^2.0.9",
"react-github-btn": "^1.2.0",
"request": "^2.88.2",
"sass": "^1.32.13",
"url-loader": "^4.1.1"
},
Expand Down
97 changes: 55 additions & 42 deletions docs/src/components/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,58 +111,71 @@ const LinksContactUs = () => {
);
};
const Contributors = ({ isTopContributors }) => {

return (
<div className="col">
{(
<>
{
isTopContributors ? (
<>
<span className="footer__title">
<Translate
id="component.Footer.topContributors"
description="Top contributors label in footer"
>Top contributors</Translate>
</span>
<ul className="footer__items">
{topContributors?.slice(0, 6).map((item) => {
return (
<li className="footer__item" key={item}>
<Link
className="footer__link-item"
to={githubProfile(item)}
target="_blank"
>
{item}
</Link>
</li>
);
})}
</ul>
{
topContributors.length ? (
<>
<span className="footer__title">
<Translate
id="component.Footer.topContributors"
description="Top contributors label in footer"
>Top contributors</Translate>
</span>
<ul className="footer__items">
{topContributors?.slice(0, 6).map((item) => {
return (
<li className="footer__item" key={item}>
<Link
className="footer__link-item"
to={githubProfile(item).profile}
target="_blank"
>
{githubProfile(item).id}
</Link>
</li>
);
})}
</ul>
</>
) : <></>
}
</>
) : (
<>
<span className="footer__title">
<Translate
id="component.Footer.newContributors"
description="New contributors label in footer"
>New contributors</Translate>
</span>
<ul className="footer__items">
{newContributors?.slice(0, 6).map((item) => {
return (
<li className="footer__item" key={item}>
<Link
className="footer__link-item"
to={githubProfile(item)}
target="_blank"
>
{item}
</Link>
</li>
);
})}
</ul>
{
newContributors.length ? (
<>
<span className="footer__title">
<Translate
id="component.Footer.newContributors"
description="New contributors label in footer"
>New contributors</Translate>
</span>
<ul className="footer__items">
{newContributors?.slice(0, 6).map((item) => {
return (
<li className="footer__item" key={item}>
<Link
className="footer__link-item"
to={githubProfile(item).profile}
target="_blank"
>
{githubProfile(item).id}
</Link>
</li>
);
})}
</ul>
</>
) : <></>
}
</>
)
}
Expand Down
5 changes: 4 additions & 1 deletion docs/src/utils/githubProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ export const githubProfile = function(id) {
if (id.indexOf('(') > -1) {
id = id.substring(id.lastIndexOf('(') + 1, id.lastIndexOf(')')).trim();
}
return `https://github.com/${id}`
return {
id,
profile: `https://github.com/${id}`
}
}
Loading

0 comments on commit 3dbdddd

Please sign in to comment.