Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add name underneath users logo #1043

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions v1/examples/basics/pages/en/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ class Users extends React.Component {

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} />
</a>
<div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key-prop needs to be moved to this div

<div className="wrapperDiv">
<a href={user.infoLink} key={user.infoLink}>
<img src={user.image} alt={user.caption} title={user.caption} />
</a>
</div>
<p>{user.caption}</p>
</div>
));

return (
Expand Down
9 changes: 9 additions & 0 deletions v1/lib/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2219,13 +2219,22 @@ input::placeholder {
justify-content: center;
}

.showcaseSection .logos .wrapperDiv {
height: 128px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break logos that aren't square in proportion. For example, have a look at Vuls and ml5.js on https://deploy-preview-1043--docusaurus-preview.netlify.com/en/users and compared them with https://docusaurus.io/en/users. The images are distorted.

You could add a wrapper div that has fixed width and height around all the images so that you can align the names and still maintain the aspect ratio of the images.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangshun Updated, waited for the deploy env to be built - but it is on hold for some reason

width: 128px;
}

.showcaseSection .logos img {
max-height: 128px;
padding: 20px;
width: 128px;
}

@media only screen and (max-width: 735px) {
.showcaseSection .logos .wrapperDiv {
height: 64px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangshun Updated, waited for the deploy env to be built - but it is on hold for some reason

width: 64px;
}
.showcaseSection .logos img {
max-height: 64px;
padding: 20px;
Expand Down
11 changes: 8 additions & 3 deletions v1/website/pages/en/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ const translate = require('../../server/translate.js').translate;
class Users extends React.Component {
renderUser(user) {
return (
<a href={user.infoLink} key={user.infoLink}>
<img src={user.image} alt={user.caption} title={user.caption} />
</a>
<div>
<div className="wrapperDiv">
<a href={user.infoLink} key={user.infoLink}>
<img src={user.image} alt={user.caption} title={user.caption} />
</a>
</div>
<p>{user.caption}</p>
</div>
);
}

Expand Down