-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e63fb74
commit 9b8f4ea
Showing
20 changed files
with
263 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
.vscode | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const isProduction = process.env.NODE_ENV === 'production'; | ||
|
||
export const analyticsCode = process.env.REACT_APP_GA; | ||
|
||
export const apiToken = process.env.REACT_APP_TOKEN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { | ||
StyleRulesCallback, | ||
withStyles, | ||
WithStyles | ||
} from '@material-ui/core/styles'; | ||
import { RouteComponentProps, Router } from '@reach/router'; | ||
import React from 'react'; | ||
import { compose } from 'recompose'; | ||
|
||
import Button from '@material-ui/core/Button'; | ||
import CreateIngredientForm from './CreateForms/CreateIngredient'; | ||
|
||
type ClassNames = 'root'; | ||
|
||
const styles: StyleRulesCallback<ClassNames> = theme => ({ | ||
root: {} | ||
}); | ||
|
||
type CombinedProps = WithStyles<ClassNames> & RouteComponentProps; | ||
|
||
const AdminLanding: React.SFC<CombinedProps> = props => { | ||
const navigateToIngForm = () => { | ||
props.navigate!('ingredients/create'); | ||
}; | ||
|
||
const navigateToCocktailForm = () => { | ||
props.navigate!('cocktails/create'); | ||
}; | ||
|
||
return ( | ||
<React.Fragment> | ||
<Button onClick={navigateToCocktailForm}>Create Cocktail</Button> | ||
<Button onClick={navigateToIngForm}>Create Ingredient</Button> | ||
<Router> | ||
<CreateIngredientForm path="ingredients/create" /> | ||
</Router> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
const styled = withStyles(styles); | ||
|
||
export default compose<CombinedProps, RouteComponentProps>( | ||
styled, | ||
React.memo | ||
)(AdminLanding); |
27 changes: 27 additions & 0 deletions
27
src/features/AdminLanding/CreateForms/CreateIngredient.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { | ||
StyleRulesCallback, | ||
withStyles, | ||
WithStyles | ||
} from '@material-ui/core/styles'; | ||
import { RouteComponentProps } from '@reach/router'; | ||
import React from 'react'; | ||
import { compose } from 'recompose'; | ||
|
||
type ClassNames = 'root'; | ||
|
||
const styles: StyleRulesCallback<ClassNames> = theme => ({ | ||
root: {} | ||
}); | ||
|
||
type CombinedProps = RouteComponentProps & WithStyles<ClassNames>; | ||
|
||
const CreateIngredientForm: React.SFC<CombinedProps> = props => { | ||
return <div>hello world</div>; | ||
}; | ||
|
||
const styled = withStyles(styles); | ||
|
||
export default compose<CombinedProps, RouteComponentProps>( | ||
styled, | ||
React.memo | ||
)(CreateIngredientForm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './AdminLanding'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.