Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #35 from andymikulski/30-fix-prettier-normandy
Browse files Browse the repository at this point in the history
#30: Prettier ignoring normandy
  • Loading branch information
andymikulski committed Mar 19, 2018
2 parents cf7f3e0 + dd1d021 commit fc67ba5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
src/normandy/**/*.*
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"parser": "flow",
"singleQuote": true,
"trailingComma": "all",
}
14 changes: 6 additions & 8 deletions src/normandy/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ import Router, {
} from 'normandy/routes';
import reducers from 'normandy/state';

const middleware = [
routerMiddleware,
thunk,
];
const middleware = [routerMiddleware, thunk];

const store = createStore(reducers, reducers(undefined, { type: 'initial' }), compose(
applyMiddleware(...middleware),
routerEnhancer,
));
const store = createStore(
reducers,
reducers(undefined, { type: 'initial' }),
compose(applyMiddleware(...middleware), routerEnhancer),
);

const initialLocation = store.getState().router;
if (initialLocation) {
Expand Down
1 change: 0 additions & 1 deletion src/normandy/routerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const searchRouteTree = (tree, name, currentUrl = '') => {
return null;
};


// Given a route (e.g. `/hello/:id/there`), finds params that need to be
// populated (e.g. `:id`) and returns a string with populated values.
export const replaceUrlVariables = (url, params) => {
Expand Down
13 changes: 6 additions & 7 deletions src/normandy/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import RecipeDetailPage from 'normandy/components/recipes/RecipeDetailPage';

import { searchRouteTree, replaceUrlVariables } from './routerUtils';


/**
* @type {Route}
* @property {Component} component React component used to render route
Expand Down Expand Up @@ -148,11 +147,7 @@ export const getNamedRoute = (name, params = {}) => {
return null;
};

export const {
reducer,
middleware,
enhancer,
} = routerForBrowser({
export const { reducer, middleware, enhancer } = routerForBrowser({
routes,
basename: '',
});
Expand All @@ -167,7 +162,11 @@ export default class Router extends React.PureComponent {

render() {
const { router } = this.props;
const content = router.route ? <router.result.component /> : <MissingPage />;
const content = router.route ? (
<router.result.component />
) : (
<MissingPage />
);
return <App>{content}</App>;
}
}

0 comments on commit fc67ba5

Please sign in to comment.