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

Commit

Permalink
Always show tabs (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Cuadra committed Sep 21, 2018
1 parent 42a9f06 commit 11a7f4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/plan/Food.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Food({
recipesFavoriteKeys,
}) {
return (
<GridCell span="6" mobile="12">
<GridCell span="6">
<Card outlined>
<div className="flex justify-between p-4 items-center">
<Typography use="headline5">
Expand Down
25 changes: 12 additions & 13 deletions src/plan/Plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Plan extends React.Component {
state = { activeTab: 0 };
render() {
const {
isMobile = false,
isWorkoutDay = false,
menu = [],
handleMenuGenerate,
Expand All @@ -34,8 +33,8 @@ class Plan extends React.Component {
const { activeTab } = this.state;

const macros = isWorkoutDay ? macrosWorkout : macrosRest;
const showMacros = isMobile ? activeTab === 0 : true;
const showFood = isMobile ? activeTab === 1 : true;
const showMacros = activeTab === 0;
const showFood = activeTab === 1;

const hasRecipesMinimum = recipes.size < RECIPES_MINIMUM;

Expand All @@ -48,18 +47,18 @@ class Plan extends React.Component {
</Typography>
</div>
)}
{isMobile && (
<TabBar
activeTabIndex={activeTab}
onActivate={evt => this.setState({ activeTab: evt.detail.index })}
>
<Tab>Macros</Tab>
<Tab>Food</Tab>
</TabBar>
)}
<Grid>
<GridCell span="12">
<TabBar
activeTabIndex={activeTab}
onActivate={evt => this.setState({ activeTab: evt.detail.index })}
>
<Tab>Macros</Tab>
<Tab>Food</Tab>
</TabBar>
</GridCell>
{showMacros && (
<GridCell span="6" mobile="12">
<GridCell span="12">
<Card outlined>
<div className="flex justify-between px-4 py-6 items-center">
<Typography use="headline5">
Expand Down

0 comments on commit 11a7f4b

Please sign in to comment.