Skip to content

Commit

Permalink
Token propio y scroll top top
Browse files Browse the repository at this point in the history
  • Loading branch information
hendaniel committed Sep 7, 2020
1 parent 0f74a9d commit 86a976d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/api/API.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const PRODUCTS = "https://coding-challenge-api.aerolab.co/products";
export const USER = "https://coding-challenge-api.aerolab.co/user/me";
export const HISTORY = "https://coding-challenge-api.aerolab.co/user/history";
export const AUTH_TOKEN =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWRkOWU5OTQ0NGZlNDAwNmRhOTkyNGQiLCJpYXQiOjE1OTE1ODIzNjF9.-f40dyUIGFsBSB_PTeBGdSLI58I21-QBJNi9wkODcKk";
export const REDEEEM = "https://coding-challenge-api.aerolab.co/redeem";
export const ADD_POINTS = "https://coding-challenge-api.aerolab.co/user/points";
export const AUTH_TOKEN =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZjU1OGMxZjc0MjM1MjAwMWVkOTA5YTMiLCJpYXQiOjE1OTk0NDE5NTF9.Qv5K-KCe54K_TIJkJAnGAJAKsDfRRXAEaa5UXGaWZLQ";
2 changes: 1 addition & 1 deletion src/components/Products/Product.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Product = ({
style={{ backgroundColor: "#92a2a7da" }}
>
<div className="action">
<h3>{cost - (points | 0)}</h3>
<h3>{cost}</h3>
<img src={coin} alt="coin" />
<button onClick={showCoinsModal}>Get more coins</button>
</div>
Expand Down
22 changes: 19 additions & 3 deletions src/components/Products/ProductsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,30 @@ const ProductsList = () => {
<>
<div className="cards">
{currentData().map((item, key) => {
return <Product item={item} key={key} onFetch={setProductResponse} />;
return (
<Product item={item} key={key} onFetch={setProductResponse} />
);
})}
</div>
<div className="container-pagination">
<div className="pagination">
<ul>
<button onClick={() => prev()}>Previous</button>
<button onClick={() => next()}>Next</button>
<button
onClick={() => {
prev();
window.scrollTo(0, 0);
}}
>
Previous
</button>
<button
onClick={() => {
next();
window.scrollTo(0, 0);
}}
>
Next
</button>
</ul>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Products/products.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
margin-right: 18%;
justify-content: center;
span {
padding: 15px;
padding: 10px;
margin-right: 5px;
color: white;
display: inline-flex;
Expand Down

0 comments on commit 86a976d

Please sign in to comment.