Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hummartapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Ameen
hummartapp
Commits
b74f6ee7
Commit
b74f6ee7
authored
May 19, 2022
by
Muhammad Ameen
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
13f4b693
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Home.js
src/Screens/Home/Home.js
+0
-2
cartReducer.js
src/store/Reducers/cartReducer.js
+4
-0
No files found.
src/Screens/Home/Home.js
View file @
b74f6ee7
...
@@ -21,8 +21,6 @@ const Home = () => {
...
@@ -21,8 +21,6 @@ const Home = () => {
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
console
.
log
(
cart
)
const
openNotification
=
(
item
,
behaviour
)
=>
{
const
openNotification
=
(
item
,
behaviour
)
=>
{
if
(
behaviour
===
"success"
)
{
if
(
behaviour
===
"success"
)
{
console
.
log
(
item
);
console
.
log
(
item
);
...
...
src/store/Reducers/cartReducer.js
View file @
b74f6ee7
...
@@ -70,6 +70,10 @@ export const cartSlice = createSlice({
...
@@ -70,6 +70,10 @@ export const cartSlice = createSlice({
state
.
total
=
state
.
total
=
state
.
total
-
state
.
total
-
action
.
payload
?.
item
?.
data
?.
price
*
action
.
payload
?.
item
?.
counting
;
action
.
payload
?.
item
?.
data
?.
price
*
action
.
payload
?.
item
?.
counting
;
action
.
payload
.
openNotification
(
"Item Remove From Cart Sucessfully"
,
"success"
);
},
},
increaseQuantity
(
state
,
action
)
{
increaseQuantity
(
state
,
action
)
{
state
.
cart
[
action
.
payload
?.
data
?.
id
].
counting
++
;
state
.
cart
[
action
.
payload
?.
data
?.
id
].
counting
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment