Skip to content

Commit

Permalink
Task PM-668: Remove "Show Only My Markets" from Olympia and Mainnet (#…
Browse files Browse the repository at this point in the history
…400)

* Remove 'My markets' filter PM-668

* remove unused proptypes and imports PM-668

* Remove unused import PM-668
  • Loading branch information
mmv08 authored Jun 8, 2018
1 parent e991054 commit 207fee9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^1.0.1",
"webpack": "^4.10.0",
"webpack-cli": "^2.1.4",
"webpack-cli": "^3.0.3",
"webpack-dev-server": "^3.1.4"
}
}
18 changes: 2 additions & 16 deletions src/routes/MarketList/components/Filter/Form.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import { reduxForm, Field } from 'redux-form'
import cn from 'classnames/bind'
import { TextInput, Checkbox, Select, RadioButtonGroup } from 'components/Form'
import { TextInput, Select, RadioButtonGroup } from 'components/Form'
import style from './Filter.mod.scss'

const cx = cn.bind(style)
Expand Down Expand Up @@ -43,7 +42,7 @@ const MARKETFILTER_STATUS_OPTIONS = [
},
]

const Form = ({ userAccount }) => (
const Form = () => (
<form>
<Field
label="Search"
Expand All @@ -61,22 +60,9 @@ const Form = ({ userAccount }) => (
options={MARKETFILTER_STATUS_OPTIONS}
light
/>
{userAccount && (
<Field label="Show Only" name="filterMyMarkets" component={Checkbox} light>
My Markets
</Field>
)}
</form>
)

Form.propTypes = {
userAccount: PropTypes.string,
}

Form.defaultProps = {
userAccount: undefined,
}

export default reduxForm({
form: MARKETFILTER_FORM_NAME,
destroyOnUnmount: false,
Expand Down
8 changes: 2 additions & 6 deletions src/routes/MarketList/store/selectors/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ import { MARKETFILTER_FORM_NAME } from 'routes/MarketList/components/Filter/Form
const formFilterSelector = getFormValues(MARKETFILTER_FORM_NAME)

// Fields in MarketFilter Form
const FIELD_FILTER_MY_MARKETS = 'filterMyMarkets'
const FIELD_FILTER_MARKETSTATUS = 'filterByStatus'
const FIELD_FILTER_QUERY = 'filterQuery'

const FILTER_FIELDS = [
FIELD_FILTER_MY_MARKETS, FIELD_FILTER_MARKETSTATUS, FIELD_FILTER_QUERY,
FIELD_FILTER_MARKETSTATUS, FIELD_FILTER_QUERY,
]

// Default Filter Values
const FILTER_DEFAULTS = {
[FIELD_FILTER_MY_MARKETS]: false,
}
const FILTER_DEFAULTS = {}

// Functions for RadioButton Filters for MarketStatus
const MARKET_STATUS_FILTERS = {
Expand All @@ -30,7 +27,6 @@ const MARKET_STATUS_FILTERS = {

// Functions for each filter field
const FILTER_FUNCTIONS = {
[FIELD_FILTER_MY_MARKETS]: params => market => market.creator === params.currentAccount,
[FIELD_FILTER_MARKETSTATUS]: params => market => MARKET_STATUS_FILTERS[params.filterValue](market),
[FIELD_FILTER_QUERY]: params => market => (
market.title.toLowerCase().indexOf(params.filterValue.toLowerCase()) > -1 ||
Expand Down

0 comments on commit 207fee9

Please sign in to comment.