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

HT8 #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

HT8 #38

wants to merge 3 commits into from

Conversation

ankorn
Copy link

@ankorn ankorn commented Jul 16, 2017

Баг исправил, изменив логику кейса LOAD_ALL_ARTICLES + SUCCESS в редьюсере.

Изменение языка сделал, но в некоторых компонентах, например, в CommentForm, почему-то не работает динамическое именение языка. Что я упустил?

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]
Copy link
Owner

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,
Copy link
Owner

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) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут ты перемудрил, можно просто мерджить в другом порядке

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

Successfully merging this pull request may close these issues.

2 participants