|
@@ -1,4 +1,4 @@
|
|
|
-import React, { Component, ReactEventHandler } from "react";
|
|
|
|
|
|
|
+import React, { Component } from "react";
|
|
|
import {
|
|
import {
|
|
|
fetchIfNeeded as fetch,
|
|
fetchIfNeeded as fetch,
|
|
|
receiveRecipes as receive,
|
|
receiveRecipes as receive,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
import Button from "components/Button";
|
|
import Button from "components/Button";
|
|
|
import Card from 'components/Card';
|
|
import Card from 'components/Card';
|
|
|
import RecipeCard from 'components/RecipeCard';
|
|
import RecipeCard from 'components/RecipeCard';
|
|
|
-import Recipe, { DBRecipe } from 'types/recipes';
|
|
|
|
|
|
|
+import { DBRecipe } from 'types/recipes';
|
|
|
import Navbar from 'components/Navbar';
|
|
import Navbar from 'components/Navbar';
|
|
|
import { Link, RouteComponentProps } from 'react-router-dom';
|
|
import { Link, RouteComponentProps } from 'react-router-dom';
|
|
|
import Input from 'components/Input';
|
|
import Input from 'components/Input';
|
|
@@ -46,12 +46,25 @@ interface RecipeListProps extends RouteComponentProps {
|
|
|
deleteRecipe: (id: string) => undefined
|
|
deleteRecipe: (id: string) => undefined
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-class RecipeList extends Component<RecipeListProps, {phoneDisplay: boolean, search: string}> {
|
|
|
|
|
|
|
+enum Layout {
|
|
|
|
|
+ VerticalSplit,
|
|
|
|
|
+ Module,
|
|
|
|
|
+ List
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+type RecipeListState = {
|
|
|
|
|
+ phoneDisplay: boolean,
|
|
|
|
|
+ search: string,
|
|
|
|
|
+ view: Layout
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+class RecipeList extends Component<RecipeListProps, RecipeListState> {
|
|
|
constructor(props: RecipeListProps) {
|
|
constructor(props: RecipeListProps) {
|
|
|
super(props);
|
|
super(props);
|
|
|
this.state = {
|
|
this.state = {
|
|
|
phoneDisplay: this.props.ui.display === Display.Mobile,
|
|
phoneDisplay: this.props.ui.display === Display.Mobile,
|
|
|
search: '',
|
|
search: '',
|
|
|
|
|
+ view: Layout.Module
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -155,8 +168,12 @@ class RecipeList extends Component<RecipeListProps, {phoneDisplay: boolean, sear
|
|
|
<Link to='/recipes/create'>
|
|
<Link to='/recipes/create'>
|
|
|
<Button unelevated>
|
|
<Button unelevated>
|
|
|
Create Recipe
|
|
Create Recipe
|
|
|
|
|
+
|
|
|
</Button>
|
|
</Button>
|
|
|
</Link>
|
|
</Link>
|
|
|
|
|
+ <Button icon="view_module" active></Button>
|
|
|
|
|
+ <Button icon="view_list"></Button>
|
|
|
|
|
+ <Button icon="view_sidebar"></Button>
|
|
|
</Navbar>
|
|
</Navbar>
|
|
|
{
|
|
{
|
|
|
isFetching && (<Spinner/>)
|
|
isFetching && (<Spinner/>)
|