-
Notifications
You must be signed in to change notification settings - Fork 2
Error failed loading #94
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
base: development
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ const formatDateTime = (dateTimeString) => { | |||||||||||||||||||||||||||||
| return new Date(dateTimeString).toLocaleString("ja-JP", options); | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const Timeline = ({ posts, isLoading, fetchPosts }) => { | ||||||||||||||||||||||||||||||
| export const Timeline = ({ posts, isLoading, fetchPosts, LoadFailed}) => { | ||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||
| <Box textAlign="center" m={3}> | ||||||||||||||||||||||||||||||
|
|
@@ -33,6 +33,12 @@ export const Timeline = ({ posts, isLoading, fetchPosts }) => { | |||||||||||||||||||||||||||||
| {isLoading ? "読み込み中" : "更新する"} | ||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||
| </Box> | ||||||||||||||||||||||||||||||
| <Typography textAlign="center" | ||||||||||||||||||||||||||||||
| variant="h6" | ||||||||||||||||||||||||||||||
| sx={{ color: 'error.main' }} | ||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||
| {LoadFailed ? "読み込みに失敗しました": ""} | ||||||||||||||||||||||||||||||
| </Typography> | ||||||||||||||||||||||||||||||
|
Comment on lines
+36
to
+41
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. この表示はいいと思います、確かに失敗した時にエラーメッセージ出るのはいいですよね。 なのでTypography全体を出し分けるようにすると良いと思います。
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ここについてわからなかったら言ってください! |
||||||||||||||||||||||||||||||
| {posts.map((post) => ( | ||||||||||||||||||||||||||||||
| <Card key={post.id} sx={{ my: 2 }}> | ||||||||||||||||||||||||||||||
| <CardActionArea> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
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.
細かい指摘になってしまいますが、JavaScriptでは変数や関数の命名はlowerCamelCaseで行うような慣習があります。
また、Booleanの変数にはprefixにisやcanなどをつけるような慣習があります。変数を見た時に大体どういうことを想定した変数なのかを判断するために命名を規則づけているんです。
今回だと
isLoadFailed/setIsLoadFailedのような命名にするのが良いと思います!