Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tony miller MVP complete #263

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
File renamed without changes.
File renamed without changes.
16,782 changes: 16,782 additions & 0 deletions react-redux-app/package-lock.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions react-redux-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "react-redux-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.3",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^12.8.0",
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"es5-ext": "^0.10.53",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-scripts": "4.0.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"web-vitals": "^1.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added react-redux-app/public/favicon.ico
Binary file not shown.
48 changes: 48 additions & 0 deletions react-redux-app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/salmon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap"
rel="stylesheet"
/>
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Grubspace - Your quick and easy source for 5000+ recipes."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/salmon.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added react-redux-app/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added react-redux-app/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions react-redux-app/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions react-redux-app/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Binary file added react-redux-app/public/salmon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
136 changes: 136 additions & 0 deletions react-redux-app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
@import "https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300";

body {
background-color: black;
font-family: "Baloo 2", cursive;
}

a {
color: white;
text-decoration: none;
margin: 1rem auto;
padding: 0rem 2rem;
}

.nav {
background-color: #9f703a;
padding: 3rem 0;
opacity: 0.7;
}

h1 {
font-family: "Courgette", cursive;
font-family: 'Permanent Marker', cursive;
color: white;
text-shadow: 0 0 1rem black;
}

h2,
h3,
h4,
h6,
p {
color: white;
}

.header {
min-height: 50vh;
align-items: center;
background-image: url(../src/images/cuttingboard.jpg);
background-size: cover;
}

a:hover {
color: lime;
}

.route-components {
text-align: center;
}

.sizer {
max-width: 60%;
min-width: 60%;
}

.parallax-bg {
background-image: url(../src/images/grubspacer.jpg);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
}

.cards {
background-color: white;
background-image: url(../src/images/cuttingboard.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
text-align: center;
align-items: center;

}

.btn {
line-height: 50px;
height: 50px;
text-align: center;
width: 250px;
cursor: pointer;
}

/*
========================
BUTTON ONE
========================
*/
.btn-one {
color: #fff;
transition: all 0.3s;
position: relative;
opacity: 1;
}
.btn-one span {
transition: all 0.3s;
}
.btn-one::before {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
opacity: 0;
transition: all 0.3s;
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: rgba(255, 255, 255, 0.5);
border-bottom-color: rgba(255, 255, 255, 0.5);
transform: scale(0.1, 1);
}
.btn-one:hover span {
letter-spacing: 2px;
}
.btn-one:hover::before {
opacity: 1;
transform: scale(1, 1);
}
.btn-one::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
transition: all 0.3s;
background-color: rgba(255, 255, 255, 0.1);
}
.btn-one:hover::after {
opacity: 0;
transform: scale(0.1, 1);
}
19 changes: 19 additions & 0 deletions react-redux-app/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import Title from "./components/title";
import Recipes from "./components/recipes";

import "bootstrap/dist/css/bootstrap.css";
import "./App.css";

function App() {
return (
<div className="parallax-bg jumbotron" style={{ minHeight: "100vh" }}>
<div className="container">
<Title />
<Recipes />
</div>
</div>
);
}

export default App;
8 changes: 8 additions & 0 deletions react-redux-app/src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
37 changes: 37 additions & 0 deletions react-redux-app/src/actions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import axios from "axios";
// import { connect } from "react-redux";

export const FETCHING_API_START = "FETCHING_API_LOADING";
export const FETCHING_API_SUCCESS = "FETCHING_API_SUCCESS";
export const FETCHING_API_FAILURE = "FETCHING_API_FAIL";
export const SEARCH_VALUE = "SEARCH_VALUE";

export const searchValue = (newSearch) => {
console.log("5. new searchValue from index.js", newSearch);
return { type: SEARCH_VALUE, payload: newSearch };
};

export const getRecipe = (props) => (dispatch) => {
console.log("6. props from actions", props);
const options = {
method: "GET",
url:
"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/search",
params: { query: props },
headers: {
"x-rapidapi-key": "b461d692bemshe80b4354ca6ba03p184f2ejsn08a3bb994638",
"x-rapidapi-host": "spoonacular-recipe-food-nutrition-v1.p.rapidapi.com",
},
};
console.log("API call is going");
dispatch({ type: FETCHING_API_START });
axios
.request(options)
.then((res) => {
dispatch({ type: FETCHING_API_SUCCESS, payload: res.data.results });
})
.catch((error) => {
dispatch({ type: FETCHING_API_FAILURE, payload: error });
console.log("This API request failed", error);
});
};
Loading