-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce9e94d
commit 040565f
Showing
19 changed files
with
351 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -44,5 +44,5 @@ | |
"last 1 safari version" | ||
] | ||
}, | ||
"proxy": "http://localhost:5000/" | ||
"proxy": "http://localhost:5001/" | ||
} |
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
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,5 +1,3 @@ | ||
|
||
|
||
const INITIAL_STATE = {} | ||
|
||
export const userRegistrationReducer = (state = INITIAL_STATE, action) => { | ||
|
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 |
---|---|---|
@@ -1,24 +1,31 @@ | ||
import react from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import StripeCheckout from 'react-stripe-checkout'; | ||
import {placeOrder} from '../actions/orderAction'; | ||
import { placeOrder } from '../actions/orderAction'; | ||
import SuccessNotification from '../components/SuccessNotification'; | ||
import Spinneer from '../components/Spinner'; | ||
|
||
|
||
export default function Checkout({subtotal}) { | ||
export default function Checkout({ subtotal }) { | ||
const dispatch = useDispatch(); | ||
|
||
const orderState = useSelector(state => state.orderReducer); | ||
const { loading, error, success } = orderState; | ||
const tokenHandler = (token) => { | ||
dispatch(placeOrder(token,subtotal)) | ||
dispatch(placeOrder(token, subtotal)) | ||
} | ||
return( | ||
return ( | ||
<div> | ||
<StripeCheckout | ||
amount={subtotal} | ||
shippingAddress | ||
stripeKey="pk_test_51JKBHIE4KLe4LrYx9WSpEPvxqFdwENbNOPmEP1KTnOufYSRrdZA2POSMVZFtahGFf2eCOVa6TMm5M2dxIwMUrmxY00Vt7op0aN" | ||
token={tokenHandler} | ||
amount={subtotal} | ||
shippingAddress | ||
stripeKey="pk_test_51JKBHIE4KLe4LrYx9WSpEPvxqFdwENbNOPmEP1KTnOufYSRrdZA2POSMVZFtahGFf2eCOVa6TMm5M2dxIwMUrmxY00Vt7op0aN" | ||
token={tokenHandler} | ||
> | ||
<button className="btn" style={{backgroundColor:"red"}}>pay now</button> | ||
<button className="btn" style={{ backgroundColor: "red" }}>pay now</button> | ||
</StripeCheckout> | ||
{success && <SuccessNotification title="your payment was successful!" details="your order is being processed"></SuccessNotification>} | ||
{loading && <Spinneer />} | ||
{error && <p>{error}</p>} | ||
</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
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,53 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
|
||
|
||
const Filter = ({ searchTermFromFilterComponent }) => { | ||
const dispatch = useDispatch(); | ||
const [searchTerm, setSearchTerm] = useState(""); | ||
const [categorie, setCategorie] = useState("all"); | ||
|
||
|
||
useEffect(() => { | ||
|
||
searchTermFromFilterComponent(searchTerm, categorie) | ||
|
||
}, [searchTerm, categorie]) | ||
|
||
|
||
|
||
/* input changer -> state change -> rerender -> this function getExecuted*/ | ||
|
||
return ( | ||
<div className="row shadow-lg p-3 mb-5 bg-white rounded d-flex m-auto justify-content-center align-items-center"> | ||
<div className="className col-md-3 d-flex align-items-center"> | ||
<input className="form-control" | ||
type="text" name="" id="" placeholder="search product" | ||
onChange={(e) => { | ||
setSearchTerm(e.target.value) | ||
}} | ||
/> | ||
</div> | ||
|
||
|
||
<div className="col-md-3 mt-2"> | ||
<select className="form-control" | ||
value={categorie} | ||
onChange={(e) => { | ||
setCategorie(e.target.value) | ||
}}> | ||
<option value="all">All</option> | ||
<option value="veg">veg</option> | ||
<option value="nonveg">nonveg</option> | ||
</select> | ||
</div> | ||
|
||
<div className="col-md-3 mt-2"> | ||
<button className="form-control btn" style={{ backgroundColor: "red" }}>Filter</button> | ||
</div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default Filter; |
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,30 @@ | ||
import React from 'react' | ||
|
||
|
||
|
||
const OrderTable = () => { | ||
return ( | ||
<div className="table"> | ||
<table class="table"> | ||
<thead class="thead-dark"> | ||
<tr> | ||
<th scope="col">#</th> | ||
<th scope="col">First</th> | ||
<th scope="col">Last</th> | ||
<th scope="col">Handle</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th scope="row">1</th> | ||
<td>Mark</td> | ||
<td>Otto</td> | ||
<td>@mdo</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
||
</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
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,13 @@ | ||
import React from 'react'; | ||
|
||
|
||
|
||
const SuccessNotification = ({ text, details }) => { | ||
return ( | ||
<div class="alert alert-success" role="alert"> | ||
<h1>{text}</h1> | ||
</div> | ||
) | ||
} | ||
|
||
export default SuccessNotification; |
Oops, something went wrong.