What would you like to eat?
@@ -13,5 +17,6 @@ export default function Header() {
- )
+ `
+ );
}
\ No newline at end of file
diff --git a/src/components/RecipeCard/recipecard.js b/src/components/RecipeCard/recipecard.js
index 510e784..45d5742 100644
--- a/src/components/RecipeCard/recipecard.js
+++ b/src/components/RecipeCard/recipecard.js
@@ -1,5 +1,3 @@
-import React, { Component } from 'react';
-
import './recipecard.css';
function toTitleCase(str) {
@@ -12,35 +10,37 @@ function toTitleCase(str) {
export default function RecipeCard(props) {
return (
+ `
-

+
-

+
- {
- toTitleCase(props.data.name)
+ ${
+ toTitleCase(props.recipe.name)
}
- {
- new Array(props.data.rating).map(_useless => (
+ ${
+ new Array(props.recipe.rating).map(_useless => (
+ `
+ `
))
}
-
- {
- `$${props.data.price}`
+ ${
+ `$${props.recipe.price}`
}
@@ -49,18 +49,21 @@ export default function RecipeCard(props) {
- {
- props.data.tags.map(tag => (
+ ${
+ props.recipe.tags.map(tag => (
+ `
- {
+ ${
toTitleCase(tag)
}
+ `
))
}
- )
+ `
+ );
}
\ No newline at end of file
diff --git a/src/components/Recipes/recipes.js b/src/components/Recipes/recipes.js
index 76be210..a8c210c 100644
--- a/src/components/Recipes/recipes.js
+++ b/src/components/Recipes/recipes.js
@@ -1,26 +1,21 @@
-import React, { Component } from 'react';
-import { connect } from 'react-redux';
-
import RecipeCard from '../RecipeCard';
import './recipes.css';
function Recipes(props) {
return (
+ `
- {
+ ${
props.recipes.map((recipe) => (
-
+ RecipeCard({
+ recipe,
+ })
))
}
- )
+ `
+ );
}
-
-function mapStateToProps(state) {
- return {
- recipes: state.data.recipes || [],
- }
-}
-export default connect(mapStateToProps)(Recipes);
\ No newline at end of file
+export default (Recipes);
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index d4a985c..e6f8b88 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,17 +1,13 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { Provider } from 'react-redux'
-import configureStore from './store';
import './index.css';
import App from './App';
-import * as serviceWorker from './serviceWorker';
-ReactDOM.render(
-
-
- ,
- document.getElementById('root')
-);
+window.addEventListener("load", function () {
+ const app = new App();
-// Disable serviceworker for now
-serviceWorker.unregister();
\ No newline at end of file
+ let elem = document.getElementById('root');
+ if (elem !== undefined) {
+ app.renderPromise.then((appHtml) => {
+ elem.innerHTML = appHtml;
+ })
+ }
+});
\ No newline at end of file
diff --git a/src/reducers/initReducer.js b/src/reducers/initReducer.js
deleted file mode 100644
index a66727c..0000000
--- a/src/reducers/initReducer.js
+++ /dev/null
@@ -1,11 +0,0 @@
-export default (state = {}, action) => {
- switch (action.type) {
- case 'INIT':
- return {
- ...state,
- ...action.payload,
- }
- default:
- return state
- }
-}
\ No newline at end of file
diff --git a/src/reducers/rootReducer.js b/src/reducers/rootReducer.js
deleted file mode 100644
index bca9107..0000000
--- a/src/reducers/rootReducer.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import { combineReducers } from 'redux';
-import initReducer from './initReducer';
-
-export default combineReducers({
- data: initReducer,
-});
\ No newline at end of file