Skip to content

Commit

Permalink
update(style): tidy code up
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Jan 18, 2019
1 parent 223c375 commit 3c09ae9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
11 changes: 7 additions & 4 deletions src/containers/Result.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
import { Table } from 'antd';
import { Table, Alert } from 'antd';

const Result = ({
error,
Expand Down Expand Up @@ -63,9 +63,12 @@ const Result = ({

if (error) {
return (
<h2>
Data Error
</h2>
<Alert
message="Error"
description="Bad request - please retry."
type="error"
showIcon
/>
);
}

Expand Down
16 changes: 8 additions & 8 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ const filter = createReducer({
venues: VENUES_LIST,
year: 0,
}, {
[ActionTypes.FILTER_VENUE]: (state, action) => {
const { venues } = action.payload;
[ActionTypes.FILTER_VENUE]: (state, { payload }) => {
const { venues } = payload;

return {
...state,
venues,
};
},
[ActionTypes.FILTER_YEAR]: (state, action) => {
const { year } = action.payload;
[ActionTypes.FILTER_YEAR]: (state, { payload }) => {
const { year } = payload;

return {
...state,
Expand All @@ -45,8 +45,8 @@ const data = createReducer({
isLoading: true,
items: [],
}),
[ActionTypes.RECEIVE_DATA]: (state, action) => {
const { items } = action.payload;
[ActionTypes.RECEIVE_DATA]: (state, { payload }) => {
const { items } = payload;

return {
...state,
Expand All @@ -55,8 +55,8 @@ const data = createReducer({
items,
};
},
[ActionTypes.REQUEST_ERROR]: (state, action) => {
const { error } = action.payload;
[ActionTypes.REQUEST_ERROR]: (state, { payload }) => {
const { error } = payload;

return {
...state,
Expand Down

0 comments on commit 3c09ae9

Please sign in to comment.