Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/bump-components
Browse files Browse the repository at this point in the history
  • Loading branch information
jottenlips authored Nov 7, 2019
2 parents 87c7bfa + 122ec84 commit c34173e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
4 changes: 2 additions & 2 deletions packages/mobile-first-navigation-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"server": "node ./server"
},
"dependencies": {
"@aloompa/mobile-first-components": "0.0.5",
"@aloompa/mobile-first-router": "0.0.5"
"@aloompa/mobile-first-components": "0.0.6",
"@aloompa/mobile-first-router": "0.0.6"
},
"devDependencies": {
"@types/jest": "^24.0.18",
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile-first-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aloompa/mobile-first-router",
"version": "0.0.5",
"version": "0.0.6",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand Down
24 changes: 2 additions & 22 deletions packages/mobile-first-router/readme.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
## Mobile First Router

### Create Route Redux Store

```
import { combineReducers } from 'redux';
import { createStore } from 'redux';
import queryStringAdapter from '@aloompa/mobile-first-router/lib/adapters/queryStringAdapter';
import { routerReducer } from '@aloompa/mobile-first-router/lib';
const combinedReducers = combineReducers({
router: routerReducer({
initialRoute: 'Home',
adapter: queryStringAdapter
})
});
const store = createStore(combinedReducers);
export default store;
```

### Define your routes

```
import { createRoutes, withRouter } from '@aloompa/mobile-first-router/lib';
import { createRoutes } from '@aloompa/mobile-first-router/lib';
const Routes = createRoutes({
routes: {
Expand All @@ -45,7 +25,7 @@ const Routes = createRoutes({
renderTopNav: NavComponent
});
export default withRouter(Routes);
export default Routes;
```

### Tab controller
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile-first-router/src/routerReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const routerReducer: Function = (config: MFNavigationReducerConfig) => {

if (config.adapter) {
config.adapter.setTab({
route: state.history[state.history.length - 1].route,
route: state.tabRoutes[payload][0].route,
tab: payload
});
}
Expand All @@ -125,7 +125,7 @@ export const routerReducer: Function = (config: MFNavigationReducerConfig) => {
...state,
activeTab: payload,
activeTabIndex: payload,
history: state.tabRoutes[payload]
history: [state.tabRoutes[payload][0]]
};
}
}[action.type]();
Expand Down
4 changes: 2 additions & 2 deletions packages/mobile-first-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"url": "https://github.com/Aloompa/mobile-first-navigation/issues"
},
"dependencies": {
"@aloompa/mobile-first-components": "0.0.5",
"@aloompa/mobile-first-router": "0.0.5",
"@aloompa/mobile-first-components": "0.0.6",
"@aloompa/mobile-first-router": "0.0.6",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.5",
"@types/react": "^16.9.2",
Expand Down

0 comments on commit c34173e

Please sign in to comment.