Skip to content

Commit

Permalink
Adapt components
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Dec 11, 2022
1 parent 4677871 commit d41c666
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 42 deletions.
10 changes: 5 additions & 5 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import DocumentTitle from 'react-document-title'
import React from 'react'
import PropTypes from 'prop-types'
import {locationShape, Link} from 'react-router'
import {Link} from 'react-router-dom'
import {FormattedMessage, injectIntl, intlShape} from 'react-intl'

import { entityShape, parameterShape, variableShape } from '../openfisca-proptypes'
import {findCountryModelItems} from '../search'
import { entityShape, locationShape, parameterShape, variableShape } from '../utils/proptypes'
import search from '../utils/search'

class App extends React.Component {
static childContextTypes = {
Expand All @@ -31,7 +31,7 @@ class App extends React.Component {

this.state = {
searchQuery,
searchResults: findCountryModelItems(entities, parameters, variables, searchQuery),
searchResults: search.findCountryModelItems(entities, parameters, variables, searchQuery),
}
}

Expand All @@ -43,7 +43,7 @@ class App extends React.Component {
setSearchQuery: searchQuery => {
this.setState({
searchQuery,
searchResults: findCountryModelItems(entities, parameters, variables, searchQuery),
searchResults: search.findCountryModelItems(entities, parameters, variables, searchQuery),
})
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/entity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import PropTypes from 'prop-types'

import config from '../config'
import { entityShape } from '../openfisca-proptypes'
import { entityShape } from '../utils/proptypes'


class Entity extends React.Component {
Expand Down
4 changes: 2 additions & 2 deletions src/components/formula.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { parameterShape, variableShape } from '../openfisca-proptypes'
import { Link } from 'react-router'
import { parameterShape, variableShape } from '../utils/proptypes'
import { Link } from 'react-router-dom'
import { FormattedMessage, FormattedDate } from 'react-intl'
import { flatten, pipe, map, is } from 'ramda'
import Highlight from 'react-highlight/lib/optimized'
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/country-model-item.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Link, locationShape, routerShape } from 'react-router'
import { Link } from 'react-router-dom'
import { FormattedMessage } from 'react-intl'

import { entityShape, parameterShape, variableShape } from '../../openfisca-proptypes'
import { entityShape, locationShape, parameterShape, routerShape, variableShape } from '../../utils/proptypes'
import Entity from '../entity'
import Parameter from '../parameter'
import Variable from '../variable'
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/home.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {isEmpty} from 'ramda'
import React from 'react'
import PropTypes from 'prop-types'
import {Link, locationShape, routerShape} from 'react-router'
import {Link} from 'react-router-dom'
import {FormattedMessage, injectIntl, intlShape} from 'react-intl'
import DocumentTitle from 'react-document-title'

import { entityShape, parameterShape, variableShape } from '../../openfisca-proptypes'
import { entityShape, locationShape, parameterShape, routerShape, variableShape } from '../../utils/proptypes'
import List from '../list'
import config from '../../config'
import SearchBar from './searchbar'
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/searchbar.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { routerShape } from 'react-router'
import React from 'react'
import {FormattedMessage, injectIntl, intlShape} from 'react-intl'

import { routerShape } from '../../utils/proptypes'
import { searchInputId } from './home'

class SearchBar extends React.Component {
Expand Down
4 changes: 2 additions & 2 deletions src/components/parameter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import React from 'react'
import PropTypes from 'prop-types'

import config from '../config'
import { parameterShape } from '../openfisca-proptypes'
import { parameterShape } from '../utils/proptypes'
import Scale from './scale'
import getDayBefore from '../periods'
import getDayBefore from '../utils/periods'

class Parameter extends React.Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/scale.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { FormattedMessage, FormattedDate, FormattedNumber } from 'react-intl'

import { parameterShape } from '../openfisca-proptypes'
import { parameterShape } from '../utils/proptypes'


class Scale extends React.Component {
Expand Down
4 changes: 2 additions & 2 deletions src/components/variable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import PropTypes from 'prop-types'
import { keys } from 'ramda'

import config from '../config'
import { parameterShape, variableShape } from '../openfisca-proptypes'
import { parameterShape, variableShape } from '../utils/proptypes'
import Formula from './formula'
import getDayBefore from '../periods'
import getDayBefore from '../utils/periods'

class Variable extends React.Component {
//Variable properties include other objects for Formula code highlight.
Expand Down
24 changes: 0 additions & 24 deletions src/utils/periods.ts

This file was deleted.

0 comments on commit d41c666

Please sign in to comment.