-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: 💥 Added more items to the in respect to issue #6 #23
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 changes have been very Impressive 🥇
just to look at these minor details.
src/data/books.json
Outdated
@@ -0,0 +1,202 @@ | |||
[ |
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 appreciate this moving to a new .json file helps in simplifing 💯
src/data/books.json
Outdated
|
||
"name": "jQuery", | ||
"tagName": "jquery", | ||
"imgUrl": "jquery.png", |
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.
how are these imgurl working ? without giving full http:.... url?
src/reducers/basketReducer.js
Outdated
switch(action.type) { | ||
case ADD_PRODUCT_BASKET: | ||
productSelected = { ...state.products[action.payload]} | ||
// productSelected = { ...state.products[action.payload] } | ||
productSelected = { ...state.books.find(book => book.tagName === action.payload) }; |
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.
This is wondurful to add the new logic but At all other places we are using action.payload as arg , just for consistency comment the new logic and uncomment the older one .
Thanks for the comments.
1. The imgurl for now are the filenames of the image stored in the
public folder and are referenced from home and cart component using
JavaScript literal as thus `.. images/${book.imgurl}` which can be easily
updated show Incase we need to pull the image from a remote url in the
future
2. For the basketReducer.js firstly we need to get all of the items in the
JSON file and that is why I made a find call to the item database with the
action.payload arg. Apart from that every other code is consistent.
Thanks qgain
…On Sat, 20 Aug 2022, 05:48 Kamal Nayan, ***@***.***> wrote:
***@***.**** approved this pull request.
The changes have been very Impressive 🥇
just to look at these minor details.
------------------------------
In src/data/books.json
<#23 (comment)>
:
> @@ -0,0 +1,202 @@
+[
I appreciate this moving to a new .json file helps in simplifing 💯
------------------------------
In src/data/books.json
<#23 (comment)>
:
> + },
+ {
+
+ "name": "JavaScript",
+ "tagName": "javascript",
+ "price": 15,
+ "imgUrl": "javascript.jpg",
+ "numbers": 0,
+ "inCart": false
+
+ },
+ {
+
+ "name": "jQuery",
+ "tagName": "jquery",
+ "imgUrl": "jquery.png",
how are these imgurl working ? without giving full http:.... url?
------------------------------
In src/reducers/basketReducer.js
<#23 (comment)>
:
> switch(action.type) {
case ADD_PRODUCT_BASKET:
- productSelected = { ...state.products[action.payload]}
+ // productSelected = { ...state.products[action.payload] }
+ productSelected = { ...state.books.find(book => book.tagName === action.payload) };
This is wondurful to add the new logic but At all other places we are
using action.payload as arg , just for consistency comment the new logic
and uncomment the older one .
—
Reply to this email directly, view it on GitHub
<#23 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXP2H7SZY2XKGC7YFPCJUDV2BPTBANCNFSM57BXT3VQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
d7d12a1
to
358a6a9
Compare
thanks @Omafovbe these details would be helpful to be put up in README. |
Hey @Omafovbe were these changes merged to the main branch 🤔 I dont see them |
You didn't merge to the main branch but merge to a new branch in the repo.
Check
…On Sat, 3 Sept 2022, 08:29 Kamal Nayan, ***@***.***> wrote:
Assigned #23 <#23> to
@Omafovbe <https://github.com/Omafovbe>.
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXP2H6FDO65CKNBYIAOEYTV4L45FANCNFSM57BXT3VQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
@Omafovbe I dont see it there too new...master Better please open a new PR for merging on the master branch . |
I am eager to see your name in the contribitors list 😄 |
also @Omafovbe revert your last commit done on aug 21 master...Omafovbe:Lets-go-shop:add-more-items
and then open a PR against the master branch as I dont know why you have merged your master branch to ur add to item branch only as per this master...Omafovbe:Lets-go-shop:add-more-items |
Done, reset the branch and opened a new PR. Thanks for the opportunity
…On Sat, Sep 3, 2022 at 9:12 AM Kamal Nayan ***@***.***> wrote:
also @Omafovbe <https://github.com/Omafovbe> revert your last commit done
on aug 21 master...Omafovbe:Lets-go-shop:add-more-items
<master...Omafovbe:Lets-go-shop:add-more-items>
by this command on the add to item branch
git reset --soft HEAD~1
and then open a PR against the master branch
as I dont know why you have merged your master branch to ur add to item
branch only as per this master...Omafovbe:Lets-go-shop:add-more-items
<master...Omafovbe:Lets-go-shop:add-more-items>
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXP2HYUDFC7BAKIOZUTWYDV4MB75ANCNFSM57BXT3VQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Added images and data for more books and updated the cart function to source images from public directory. Also, dynamically add the items to the home component
This PR fixes #6
Notes for Reviewers