Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28,995 changes: 28,995 additions & 0 deletions Fronted Projects/FoodBank/package-lock.json

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions Fronted Projects/FoodBank/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "foodbank",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.1",
"react": "^18.2.0",
"react-datepicker": "^4.8.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"reactstrap": "^9.1.4",
"web-vitals": "^2.1.4"
},
"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 Fronted Projects/FoodBank/public/favicon.ico
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions Fronted Projects/FoodBank/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.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>FoodBank</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 Fronted Projects/FoodBank/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 Fronted Projects/FoodBank/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 Fronted Projects/FoodBank/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 Fronted Projects/FoodBank/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:
52 changes: 52 additions & 0 deletions Fronted Projects/FoodBank/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.header{
height: 200px;
width: 100%;
background-color : #E9EEF6;
padding-top: 50px;
}

.card-container{
height: 300px;
width: 300px;
box-shadow: 0px 3px 50px #A5A5A5;
}

.card-wrapper{
width: 350px;
height: 350px;
box-shadow: 0px 3px 50px #A5A5A5;
display: flex;
flex-direction: column;
}

.card-top{
width: 100%;
height: 2%;
}

.task-holder{
width: 100%;
height: 98%;
padding: 10px 10px;
display : flex;
flex-direction: column;
position: relative;
}

.card-header{
margin-top: 10px;
margin-bottom: 10px;
max-width: 80px;
height: 30px;
padding: 1px 1px !important;
text-align: center;
}

.task-container{
height: 600px;
width: 100%;
display: flex;
flex-wrap: wrap;
background-color: #F6F7F8;
padding : 40px 100px;
}
22 changes: 22 additions & 0 deletions Fronted Projects/FoodBank/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// import logo from './logo.svg';
import './App.css';
import Donate from './components/Donate';
import 'bootstrap/dist/css/bootstrap.min.css'
import Home from './components/Home';

function App() {
return (
<>
<div className="home">
<Home/>
</div>
<div className="App">

<Donate />
</div>
</>

);
}

export default App;
8 changes: 8 additions & 0 deletions Fronted Projects/FoodBank/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();
});
62 changes: 62 additions & 0 deletions Fronted Projects/FoodBank/src/components/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, {useState} from 'react';
// import EditTask from '../modals/EditTask'

const Card = ({taskObj, index, deleteTask, updateListArray}) => {
const [modal, setModal] = useState(false);

const colors = [
{
primaryColor : "#5D93E1",
secondaryColor : "#ECF3FC"
},
{
primaryColor : "#F9D288",
secondaryColor : "#FEFAF1"
},
{
primaryColor : "#5DC250",
secondaryColor : "#F2FAF1"
},
{
primaryColor : "#F48687",
secondaryColor : "#FDF1F1"
},
{
primaryColor : "#B964F7",
secondaryColor : "#F3F0FD"
}
]

const toggle = () => {
setModal(!modal);
}

const updateTask = (obj) => {
updateListArray(obj, index)
}

const handleDelete = () => {
deleteTask(index)
}

return (
<div class = "card-wrapper mr-5 mx-auto">
<div class = "card-top" style={{"background-color": colors[index%5].primaryColor}}></div>
<div class = "task-holder">
<span class = "card-header" style={{"background-color": colors[index%5].secondaryColor, "border-radius": "10px"}}>{taskObj.Name}</span>
<p className = "mt-3">{taskObj.Date}</p>
<p className = "mt-3">{taskObj.Time}</p>
<p className = "mt-3">{taskObj.venue}</p>
<p className = "mt-3">{taskObj.Description}</p>

<div style={{"position": "absolute", "right" : "20px", "bottom" : "20px"}}>
{/* <i class = "far fa-edit mr-3" style={{"color" : colors[index%5].primaryColor, "cursor" : "pointer"}} onClick = {() => setModal(true)}></i> */}
<i class="fas fa-trash-alt" style = {{"color" : colors[index%5].primaryColor, "cursor" : "pointer"}} onClick = {handleDelete}></i>
</div>
</div>
{/* <EditTask modal = {modal} toggle = {toggle} updateTask = {updateTask} taskObj = {taskObj}/> */}
</div>
);
};

export default Card;
62 changes: 62 additions & 0 deletions Fronted Projects/FoodBank/src/components/Donate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, {useEffect, useState} from 'react';
import Create from '../modal/Create'
import Card from './Card';

const Donate = () => {
const [modal, setModal] = useState(false);
const [taskList, setTaskList] = useState([])

useEffect(() => {
let arr = localStorage.getItem("taskList")

if(arr){
let obj = JSON.parse(arr)
setTaskList(obj)
}
}, [])


const deleteTask = (index) => {
let tempList = taskList
tempList.splice(index, 1)
localStorage.setItem("taskList", JSON.stringify(tempList))
setTaskList(tempList)
window.location.reload()
}

const updateListArray = (obj, index) => {
let tempList = taskList
tempList[index] = obj
localStorage.setItem("taskList", JSON.stringify(tempList))
setTaskList(tempList)
window.location.reload()
}

const toggle = () => {
setModal(!modal);
}

const saveTask = (taskObj) => {
let tempList = taskList
tempList.push(taskObj)
localStorage.setItem("taskList", JSON.stringify(tempList))
setTaskList(taskList)
setModal(false)
}


return (
<>
<div className = "header text-center">
<h3>Food Donation App</h3>
<button className = "btn btn-primary mt-2" onClick = {() => setModal(true)} >donate Food</button>
</div>
<div className = "task-container">
{taskList && taskList.map((obj , index) => <Card taskObj = {obj} index = {index} deleteTask = {deleteTask} updateListArray = {updateListArray}/> )}
</div>
<Create toggle = {toggle} modal = {modal} save = {saveTask}/>
</>
);
};

export default Donate;
39 changes: 39 additions & 0 deletions Fronted Projects/FoodBank/src/components/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import "./home.css";
import food1 from "../food1.gif";

export default function Home() {
return (
<div className="container">
<div className="home">
<div className="navbar">
<div className="logo">
<img src={food1} alt="" />
</div>
<div className="content">
<ul>
<li>Home</li>
<li>Our Mission</li>
<li>Donate food</li>
<li>Collect Food</li>
<li>Contact</li>
</ul>
</div>
</div>


</div>

<div className="data">
<div className="left">
<h6>Help hunger vanish...!</h6>
<h1>Be a hero and bring down world hunger to zero.</h1>
<p>Why Foodbanks are key to tackling hunger:
Bridging the Gap – FoodBanks meet the needs of the hungry by efficiently redistributing the food already available in the country.</p>
</div>

</div>

</div>
);
}
Loading