Skip to content

Commit

Permalink
Connect TabBar in its own file, instead of TabBarContainer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Oct 21, 2017
1 parent 6660974 commit 022b24e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Expand Up @@ -6,7 +6,7 @@ import {

import './App.css';

import TabBarContainer from "features/tabs/TabBarContainer";
import TabBarContainer from "features/tabs/TabBar";
import UnitInfo from "features/unitInfo/UnitInfo";
import Pilots from "features/pilots/Pilots";
import Mechs from "features/mechs/Mechs";
Expand Down
16 changes: 14 additions & 2 deletions src/features/tabs/TabBar.jsx
@@ -1,11 +1,23 @@
import React from "react";
import {connect} from "react-redux";
import {Menu} from "semantic-ui-react";

import ToggleDisplay from "common/components/ToggleDisplay"

import Tab from "./Tab";

const TabBar = (props) => {
import {selectCurrentTab} from "./tabsSelectors";
import {selectTab} from "./tabsActions";

const mapState = (state) => {
const currentTab = selectCurrentTab(state);

return {currentTab};
}

const actions = {onTabClick : selectTab};

export const TabBar = (props) => {
const {tabs, currentTab, onTabClick, ...otherProps} = props;

const tabItems = tabs.map(tabInfo => {
Expand Down Expand Up @@ -42,4 +54,4 @@ const TabBar = (props) => {
)
}

export default TabBar;
export default connect(mapState, actions)(TabBar);
16 changes: 0 additions & 16 deletions src/features/tabs/TabBarContainer.jsx

This file was deleted.

0 comments on commit 022b24e

Please sign in to comment.