instead of the grid-five-column, i have edited the cart grid to only need 3 columns so…
- User
instead of the grid-five-column, i have edited the cart grid to only need 3 columns so that i can move the order-total--amount to the right of the grid on desktop and bottom of grid on mobile. Rewrite the code to implement this: import styled from "styled-components"; import { useCartContext } from "./context/cart_context"; import CartItem from "./components/CartItem"; import { NavLink } from "react-router-dom"; import { Button } from "./styles/Button"; import FormatPrice from "./Helpers/FormatPrice"; import { useAuth0 } from "@auth0/auth0-react";
const Cart = () => { const { cart, clearCart, total_price, shipping_fee } = useCartContext(); // console.log("🚀 ~ file: Cart.js ~ line 6 ~ Cart ~ cart", cart);
const { isAuthenticated, user } = useAuth0();
if (cart.length === 0) { return ( No Cart in Item ); }
return ( Your Cart
code<div className="cart_heading grid grid-five-column"> <p>Item</p> <p className="cart-hide">Price</p> <p>Remove</p> </div> <hr /> <div className="cart-item"> {cart.map((curElem) => { return <CartItem key={curElem.id} {...curElem} />; })} </div> <hr /> <div className="cart-two-button"> <NavLink to="/products"> <Button> continue Shopping </Button> </NavLink> <Button className="btn btn-clear" onClick={clearCart}> clear cart </Button> </div> {/* order total_amount */} <div className="order-total--amount"> <div className="order-total--subdata"> <div> <p>subtotal:</p> <p> <FormatPrice price={total_price} /> </p> </div> <hr /> <div> <p>order total:</p> <p> <FormatPrice price={shipping_fee + total_price} /> </p> </div> </div> </div> </div> </Wrapper>); };
const EmptyDiv = styled.div` display: grid; place-items: center; height: 50vh;
- Assistant
- User
show me the required css to get the total_amount to the right of the grid-three-column(which has disorganized(not centered) columns after changing from grid-five-column)
- Assistant
- User
How do i add :import GooglePayButton from "@google-pay/button-react"; import { PayPalButtons } from '@paypal/react-paypal-js'; import { PayPalScriptProvider } from '@paypal/react-paypal-js'; to my cart at just below the Order Total amount in such a way that a user can checkout directly on the cart page. The data used for the product is in a json with a single product snippet: { "id": "web-a", "name": "Blog Website Template", "price": 60, "image": "images/products/blog.png", "description": "This is a modern design html template for a blog website made with a keen attention to detail and incorporating some 3D aspects to its design.", "category": "HTMLTemplates", "featured": true },
- Assistant