Skip to content

Commit

Permalink
chore: hacked temp reducer so it'll work
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-cannon committed Nov 20, 2019
1 parent 166a07a commit 085976b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fd-servicedirectory",
"version": "1.0.0",
"description": "PFA Service Directory",
"main": "src/index.jsx",
"main": "src/index.tsx",
"repository": "[email protected]:CodeForFoco/fd-servicedirectory.git",
"author": "Code for Fort Collins",
"license": "MIT",
Expand Down Expand Up @@ -58,6 +58,7 @@
"react-dom": "^16.8.6",
"react-redux": "^7.1.3",
"react-router-dom": "^5.0.0",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0",
"styled-components": "^4.2.0",
"styled-normalize": "^8.0.6",
Expand Down
13 changes: 13 additions & 0 deletions src/core/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";

// Temporary Reducer. Remove this.
const defaultReducer = (state, action) => {
let newAction = action;
Object.keys(newAction);
return state;
};

export const configureStore = initialState => {
return createStore(defaultReducer, initialState, applyMiddleware(thunk));
};
12 changes: 11 additions & 1 deletion src/index.jsx → src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import { render } from "react-dom";
import { BrowserRouter, Redirect, Route, Switch } from "react-router-dom";
import { Provider } from "react-redux";
import styled, { createGlobalStyle, ThemeProvider } from "styled-components";
import { Normalize } from "styled-normalize";
import { configureStore } from "~/core/store";
import Nav from "~/components/nav";
import theme from "~/core/theme";
import Categories from "~/pages/categories";
Expand All @@ -23,6 +25,9 @@ const PageContainer = styled.div({
marginBottom: "96px",
});

// Initialize Redux store
const store = configureStore({});

const App = () => (
<ThemeProvider theme={theme}>
<BrowserRouter>
Expand Down Expand Up @@ -52,4 +57,9 @@ const App = () => (
</ThemeProvider>
);

render(<App />, document.getElementById("app"));
render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById("app")
);
13 changes: 13 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// References:
// https://parceljs.org/typeScript.html
// https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"~*": ["./*"]
},
"jsx": "react",
},
"include": ["src/**/*"]
}
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6800,6 +6800,14 @@ redux-thunk@^2.3.0:
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==

redux@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==
dependencies:
loose-envify "^1.4.0"
symbol-observable "^1.2.0"

regenerate-unicode-properties@^8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz#7b38faa296252376d363558cfbda90c9ce709662"
Expand Down Expand Up @@ -7704,7 +7712,7 @@ svgo@^1.0.0, svgo@^1.0.5:
unquote "~1.1.1"
util.promisify "~1.0.0"

symbol-observable@^1.1.0:
symbol-observable@^1.1.0, symbol-observable@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==
Expand Down

0 comments on commit 085976b

Please sign in to comment.