-
Notifications
You must be signed in to change notification settings - Fork 88
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
HT8 #38
base: master
Are you sure you want to change the base?
HT8 #38
Conversation
if (!article) return null | ||
return ( | ||
<div ref = {this.setContainerRef}> | ||
<h3>{article.title}</h3> | ||
<button onClick = {toggleOpen}> | ||
{isOpen ? 'close' : 'open'} | ||
{isOpen ? | ||
this.context.dictionary.close[this.context.language] |
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.
Лучше сделай отдельный декоратор или компонент для локализации
|
||
static childContextTypes = { | ||
user: PropTypes.string | ||
user: PropTypes.string, | ||
dictionary: PropTypes.object, |
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.
проще хранить только нужный словарь
@@ -40,8 +40,15 @@ export default (articleState = defaultState, action) => { | |||
return articleState.set('loading', true) | |||
|
|||
case LOAD_ALL_ARTICLES + SUCCESS: | |||
const articles = arrToMap(response, ArticleRecord).map((article) => { |
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.
тут ты перемудрил, можно просто мерджить в другом порядке
Баг исправил, изменив логику кейса LOAD_ALL_ARTICLES + SUCCESS в редьюсере.
Изменение языка сделал, но в некоторых компонентах, например, в CommentForm, почему-то не работает динамическое именение языка. Что я упустил?