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

感想 #1

Open
yamachu opened this issue Aug 16, 2019 · 0 comments
Open

感想 #1

yamachu opened this issue Aug 16, 2019 · 0 comments

Comments

@yamachu
Copy link

yamachu commented Aug 16, 2019


Nice Router!

https://github.com/nasa-playground/treasure_front_app/blob/master/src/pages/index_article.js
一覧表示も実装してある!いいね!

https://github.com/nasa-playground/treasure_front_app/blob/master/src/pages/index_article.js#L27
削除済みだとアクセス出来ないからリストのリフレッシュのためにReloadしてるんだね、良さそう。

けど
https://github.com/nasa-playground/treasure_front_app/blob/master/src/pages/index_article.js#L11
https://github.com/nasa-playground/treasure_front_app/blob/master/src/api.js#L19
引数がundefinedだから一応動作してるけれども、引数の数はちゃんとあわせたいね

<input type="text" value={title} onChange={(e) => setTitle(e.target.value)}/>
<textarea value={body} onChange={(e) => setBody(e.target.value)} />

add_articleと同じようなformを使うのであれば、共通化とかも考えてみて良いかもね。

あと細かい話だけど、

{user === null ? (
<button onClick={firebase.login}>Please login</button>
) : null}
<div>{message}</div>
<p>{errorMessage}</p>
<button onClick={() => getPrivateMess()}>Get Private Message</button>
<button onClick={firebase.logout}>Logout</button>

ログインしていないとボタンを消すだけじゃなくて、ログイン必須の他の項目も消しちゃって良いかもね

全体的に良さそう:+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant