generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from the-collab-lab/ij-home
added styles using tailwindCss, delete not working
- Loading branch information
Showing
9 changed files
with
120 additions
and
52 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -8,3 +8,7 @@ | |
.SingleList-label { | ||
margin-left: 0.2em; | ||
} | ||
.selected { | ||
background-color: #000000; | ||
color: #e69500; | ||
} |
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 |
---|---|---|
@@ -1,26 +1,35 @@ | ||
import React from 'react'; | ||
import './SingleList.css'; | ||
import { MdOutlineDeleteForever } from 'react-icons/md'; | ||
import { deleteList } from '../api'; | ||
import { Button } from '@mui/material'; | ||
|
||
export function SingleList({ name, path, setListPath }) { | ||
function handleClick() { | ||
export function SingleList({ name, path, setListPath, listPath, email }) { | ||
// Function to handle selecting a list | ||
const handleClick = () => { | ||
setListPath(path); | ||
localStorage.setItem('list', name); | ||
} | ||
}; | ||
|
||
// Function to handle deleting a list | ||
const handleDelete = async () => { | ||
const listPath = '/' + path; | ||
await deleteList(listPath, email); | ||
localStorage.setItem('tcl-shopping-list-path', ''); | ||
window.location.reload(); | ||
}; | ||
|
||
return ( | ||
<li className="SingleList"> | ||
<Button | ||
style={{ | ||
color: ' #113f67', | ||
backgroundColor: '#e7eaf6', | ||
margin: '10px', | ||
textTransform: 'capitalize', | ||
}} | ||
variant="contained" | ||
onClick={handleClick} | ||
> | ||
<span className="text-lg font-bold">{name}</span> | ||
</Button> | ||
</li> | ||
<div | ||
className={`flex items-center justify-between ${path === listPath ? 'selected' : ''}`} | ||
> | ||
<li className="SingleList"> | ||
<button onClick={handleClick}>{name}</button> | ||
</li> | ||
<hr /> | ||
<MdOutlineDeleteForever | ||
className="text-red-700 cursor-pointer" | ||
onClick={handleDelete} | ||
/> | ||
</div> | ||
); | ||
} |
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,34 @@ | ||
.home { | ||
background: rgba(255, 255, 255, 0.24); | ||
border-radius: 16px; | ||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); | ||
backdrop-filter: blur(4.7px); | ||
-webkit-backdrop-filter: blur(4.7px); | ||
border: 1px solid rgba(255, 255, 255, 0.3); | ||
@apply rounded-2xl shadow-2xl px-4 md:px-24 text-black mt-8; | ||
} | ||
#list { | ||
@apply mt-8 flex flex-col justify-center items-center; | ||
} | ||
.input { | ||
@apply border border-blue-700 text-black bg-white p-3 rounded-xl; | ||
width: 70%; | ||
} | ||
.btn { | ||
background-color: #113767; | ||
@apply text-white p-3 rounded-xl shadow-md mb-8 cursor-pointer; | ||
} | ||
:hover .btn { | ||
background-color: #38598b; | ||
} | ||
|
||
/* ..........................small screen................ */ | ||
@media only screen and (max-width: 600px) { | ||
.btn, | ||
.singleList { | ||
font-size: 14px !important; | ||
} | ||
.input { | ||
width: 100%; | ||
} | ||
} |
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