-
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
Closes #1220: Better error/loading handling when posts can't be loaded #1251
Conversation
Pinging some reviewers for this. I like where it's headed, but wording might need tweaks. |
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 great :D
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.
Please don't forget to REBASE before and after start working on the requested changes.
Thanks.
@@ -7,6 +7,9 @@ import { Box, Grid, Typography, ListSubheader } from '@material-ui/core'; | |||
import './telescope-post-content.css'; | |||
import AdminButtons from '../AdminButtons'; | |||
|
|||
import Spinner from '../Spinner/Spinner.jsx'; | |||
import ErrorRoundedIcon from '@material-ui/icons/ErrorRounded'; |
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.
"@material-ui/icons/ErrorRounded
import should occur before import of ../AdminButtons
eslintimport/order"
It's a quick fix, linter will handle this for you.
</ListSubheader> | ||
</Box> | ||
); | ||
} else if (!post) { |
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.
Please use Prettier here.
Step #1 Just a click and you will be good.
You can use the "Quick fix..."
After this, run Prettier to solve the following issue(Quick fix again or Prettier shortcut):
</Box> | ||
); | ||
} else { | ||
return ( |
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.
The same problem of line 114. Follow the same steps and you will be good.
@@ -1,16 +1,31 @@ | |||
import React from 'react'; | |||
import { useSWRInfinite } from 'swr'; | |||
|
|||
import { Container } from '@material-ui/core'; | |||
import { Container, Typography, Grid } from '@material-ui/core'; |
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.
"'Typography' is declared but its value is never read.ts(6133)
'Typography' is defined but never used.eslintno-unused-vars"
import { makeStyles } from '@material-ui/core/styles'; | ||
import Timeline from './Timeline.jsx'; | ||
import useSiteMetaData from '../../hooks/use-site-metadata'; | ||
|
||
import SentimentDissatisfiedRoundedIcon from '@material-ui/icons/SentimentDissatisfiedRounded'; |
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.
"@material-ui/icons/SentimentDissatisfiedRounded
import should occur before import of ./Timeline.jsx
eslintimport/order"
Lint will help you with this one too ("Quick fix...")
After fixing the import order, you will notice an error, run prettier again and you will be fine.
</Container> | ||
); | ||
} else { | ||
return ( |
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.
"Unnecessary 'else' after 'return'.eslintno-else-return"
Same as before, use "Quick fix..." and then run prettier until solve the indentation problems.
@zjjiang2 did you want to finish this soon? You can probably use |
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.
Looks good, with one question about theme colours vs. raw colour values.
@@ -11,6 +12,19 @@ const useStyles = makeStyles(() => ({ | |||
padding: 0, | |||
maxWidth: '785px', | |||
}, | |||
error: { | |||
position: 'center', | |||
color: '#B5B5B5', |
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.
@cindyledev, @agarcia-caicedo or someone else who knows our theme code: are there theme values we should be using for these colours instead?
}, | ||
errorIcon: { | ||
position: 'center', | ||
color: '#B5B5B5', |
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.
Same question here re: colours/theme.
@manekenpix |
Rebasing would be ideal so we can keep a linear history, but I don't trust github solving conflicts so I guess we'll have to merge it as it is. |
Issue This PR Addresses
From Issue #1220
Type of Change
Description
Added error handling for UX, includes:
Checklist