-
Notifications
You must be signed in to change notification settings - Fork 0
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
added styles using tailwindCss, delete not working #35
Conversation
Visit the preview URL for this PR (updated for commit 472cb5c): https://tcl-72-smart-shopping-list--pr35-ij-home-mowl982q.web.app (expires Sun, 07 Apr 2024 16:24:35 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f7f2b0c98e4c5bce6be0f9b2cd44669f154caa67 |
UI Updates looks great and working fine. Great work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI Updates looks great and working fine. Great work
…e view and new styles for small screens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good, the list can be a bit more centered. I think the background should be just one solid color like #A2A8D3
I think a better title is "Create a shopping list"
button can be "Create new list"
and last button can be "Edit existing list"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is working as expected, great work @ijayhub 🚀 ! I left some non-blocking notes
await updateDoc(userDocRef, { | ||
sharedLists: arrayRemove(docRef), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done 💥✨! we don't want the user to have a shared list that does not exist 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay changed that
src/components/SingleList.jsx
Outdated
<button onClick={handleClick}>{name}</button> | ||
</li> | ||
<hr /> | ||
<MdOutlineDeleteForever className="text-red-700" onClick={handleDelete} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delete button should be commented out as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check again working now
src/views/Home.css
Outdated
@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; | ||
} | ||
:hover .btn { | ||
background-color: #38598b; | ||
} | ||
.exit-btn { | ||
background-color: yellow; | ||
color: black; | ||
@apply p-3 rounded-xl shadow-md; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of the @apply
directive to make your code more readable 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank u
src/views/Home.jsx
Outdated
|
||
export function Home({ data, setListPath, userId, userEmail }) { | ||
const [name, setName] = useState(''); | ||
const [selectedList, setSelectedList] = useState(null); // State to track the selected list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need this additional state here. We already have the listPath
in the App
, you can pass it as props and use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay... thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/views/Home.jsx
Outdated
setListPath={setListPath} | ||
setListPath={handleListClick} | ||
deleteList={deleteList} // the deleteList function is being passed as a prop | ||
selected={selectedList === item.path} // Checks if the list is selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I said above instead of the selectedList
, use the lisrPath
from the parent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Answer:
|
src/views/Home.jsx
Outdated
// to create a highlighted list | ||
const handleListClick = (path) => { | ||
setListPath(path); | ||
setSelectedList(path); // this update and highlight the list path | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should keep the handleListCLick
, only remove the duplicate setSelectedList(path)
listPath={listPath} // Pass listPath to SingleList | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to pass the listPath further, just use it here.
selected={listpath === item.path}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont really understand...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before you were using another duplicated state selectedList
to check if the list is selected like this :
selected={selectedList === item.path}
.
Now you will use the listPath
, that's it:
selected={listpath === item.path}
Description
I've improved the homepage to give it a more polished and professional look. Now, users can easily highlight and keep track of specific collection IDs (lists) that they want to focus on.
Related Issue
closes #35
Acceptance Criteria
Make everything centered
Remove "Hello from the home (/) page!"
Change "Name of shopping list:" to "Create a shopping list"
Add a button to delete the shopping list
Create a function from the firebase documentation to delete a shopping list/document- not yet
I want the design to look professional.
Highlight the shopping list that is selected
Type of Changes
new feature
andUI enhancement
.Updates
Before
After
Testing Steps / QA Criteria