-
Notifications
You must be signed in to change notification settings - Fork 189
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
#2373 Update on github information on mobile view, need update on the titles #2491
Conversation
I think the idea is good. The details need some work, but having it expand vertically to reveal the GitHub info is interesting. We need to find a way to use the space more efficiently on mobile (not jammed to the right). Also, I'm not sure where the GitHub icon should go, or what it should look like. It might need some text to indicate there is I would focus on figuring out how to arrange this same info in a smaller space efficiently on mobile (e.g., what's in the revealed area). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome.
I'm just thinking about whether we should display the github info at the bottom of each post by default vs make users click a button and see a layout shift.
I found another method for collapsable, called Colllapse in material-UI, here is an example of the usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs more UX work. Here's the comparison of what we have now (left) with what this does (right):
I think adding another ...
clutters the view. Here's my suggestion instead:
- Make the entire header (avatar logo, title, name, etc) a single clickable area
- If there is GitHub data to show, add a small GitHub icon to the right of the person's name, which would indicate that there is GitHub data to reveal
- Touching the header would open the header to a larger size
The current layout of the GitHub data isn't going to work on mobile:
We need to use the entire width somehow. cc @Meneguini, @PedroFonsecaDEV for ideas.
It seems like a good design. I will try to make the whole title container a clickable area and add a GitHub icon if there's any GitHub link attached. |
@humphd I have revised the code to make the title container clickable, and show the GitHub icon beside the author name when there is any GitHub info available. Now I faced another challenge, which the title container, which has been pinned to the top before I make the change, is now scrolled down with the post content. I tried a few different things, but it never gets pinned on top even though I only updated it to put the whole thing in the AccordionSummary. <- might be related to the issue? |
Excellent, thank you. Can you rebase to pick up the changes to |
This isn't perfect, but it's better. The mechanism of showing/hiding the info is working well. I'm not sure about the font size change on the header text. And the layout of the inner contents are still not right for mobile. I'll be interested to see further improvements and hear more from other reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting closer. I left some reviews.
@@ -15,6 +15,10 @@ const useStyles = makeStyles((theme: Theme) => | |||
lineHeight: 'normal', | |||
fontSize: '1.2rem', | |||
}, | |||
GitHubMobile: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class isn't needed.
|
||
return ( | ||
<div> | ||
<ListSubheader className={classes.root}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this <ListSubheader component="div">
and the same to every ListSubheader
you add? We have a number of wrong uses of ListSubheader
throughout the tree because we like its default style. By default it renders a <li>
, li
is meant for lists, we don't want to end up having nested <li>
. I have fixed some <ListSubheader component="div">
in #2594 but to avoid this in the future I'll file an issue to replace all usage of ListSubheader
with a different component while maintaining the same style.
<time dateTime={post.updated}>{`${formatPublishedDate(post.updated)}`}</time> | ||
</a> | ||
{!desktop && ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fragment isn't needed.
</AccordionDetails> | ||
</Accordion> | ||
</> | ||
)} | ||
{desktop && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be nice if y can combine these two expression into something like desktop ? <A/> : <B/>
@@ -15,6 +15,11 @@ const useStyles = makeStyles((theme: Theme) => | |||
wordWrap: 'break-word', | |||
lineHeight: 'normal', | |||
}, | |||
GitHubMobile: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class isn't needed.
|
||
const GitHubInfoMobile = ({ ghUrls }: Props) => { | ||
const classes = useStyles(); | ||
const { repos, issues, pullRequests, commits, users } = filterGitHubUrls(ghUrls); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's cache the result of this function call with useMemo so that it doesn't get called every time the Accordion
is open.
const { repos, issues, pullRequests, commits, users } = filterGitHubUrls(ghUrls); | |
const { repos, issues, pullRequests, commits, users } = useMemo( | |
() => filterGitHubUrls(ghUrls), | |
[ghUrls] | |
); |
Can you do the same for GithubInfo
?
padding: '0 0 0 1rem', | ||
}, | ||
}, | ||
gitHubIcon: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't use a githubIcon anymore right.
I'm definitely leaning more towards the row style, given a suitable max-width ofc. Column view makes it easier to view the list of repos, at the expense of a much longer height and unused width space being used. |
Using row vs. column |
We are closing this PR and making our own branch to revert some changes and work on the issue. I new PR will be opened once it is ready. |
- Changed repos display to row, added border bottom for header, added hint icon for accordion
- Changed repos display to row, added border bottom for header, added hint icon for accordion
- Changed repos display to row, added border bottom for header, added hint icon for accordion
- Changed repos display to row, added border bottom for header, added hint icon for accordion - Fixed clicking on expand icon copies link to blog post - Added expand icons in the bottom of the github info - Added function to auto close accordion when scroll pass post - Added css for mobile device < 375 px width
- Initial work from @irenejoeunpark with PR #2491 (#2716) - Changed repos display to row, added border bottom for header, added hint icon for accordion - Fixed clicking on expand icon copies link to blog post - Added expand icons in the bottom of the github info - Added function to auto close accordion when scroll pass post - Added css for mobile device < 375 px width Co-authored-by: Francesco Menghi <53121061+menghif@users.noreply.github.com>
Issue This PR Addresses
#2373 More change is needed after some feedbacks on styles
Type of Change
Description
This PR contains an update on the UI for mobile view, to include GitHub information on each post.
When the user clicks on the GitHub icon, it expands the GitHub information of the post.
Need feedback on the icon, design, and the idea of using Accordion.
Need to fix the title and the author name position on mobile view - need some advice on it.
Checklist