Skip to content

ht 2.1 done #22

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/article-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default function ArticleList({ articles, fetchAll }) {
//import AccodrionComponent from './accordion-component'

class ArticleList extends Component {
static propTypes = {
articles: PropTypes.array.isRequired
Copy link
Owner

Choose a reason for hiding this comment

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

из декоратора еще пропсы приходят

}

componentDidMount() {
this.props.fetchAll && this.props.fetchAll()
}
Expand All @@ -47,8 +51,5 @@ class ArticleList extends Component {
return <ul className="test--article-list__container">{articleItems}</ul>
}
}
ArticleList.propTypes = {
articles: PropTypes.array.isRequired
}

export default accordion(ArticleList)
2 changes: 1 addition & 1 deletion src/components/article.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { findDOMNode } from 'react-dom'
// import { findDOMNode } from 'react-dom'
import CommentList from './comment-list'

class Article extends Component {
Expand Down
5 changes: 4 additions & 1 deletion src/components/chart.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'

class Chart extends Component {
static propTypes = {}
static propTypes = {
articles: PropTypes.array.isRequired
}

componentDidUpdate() {
//compare props and update chart in this.container
Expand Down
5 changes: 4 additions & 1 deletion src/components/filters/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React, { Component } from 'react'
import DateRange from './date-range'
import SelectFilter from './select'
import PropTypes from 'prop-types'

class Filters extends Component {
static propTypes = {}
static propTypes = {
articles: PropTypes.array.isRequired
}

render() {
return (
Expand Down
4 changes: 4 additions & 0 deletions src/components/filters/select.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import Select from 'react-select'
import PropTypes from 'prop-types'

function SelectFilter({ articles }) {
const [selected, setSelection] = useState(null)
Expand All @@ -11,5 +12,8 @@ function SelectFilter({ articles }) {

return <Select options={options} value={selected} onChange={setSelection} isMulti />
}
SelectFilter.propTypes = {
articles: PropTypes.array.isRequired
}

export default SelectFilter