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
<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;
h3 { font-size: 4.2rem; text-transform: capitalize; font-weight: 300; color: black; } `;
const Wrapper = styled.section` padding: 15rem 0;
p, h3 { color: black; }
button, btn { color: white; border-radius: 10px; }
button:hover, btn:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); }
.grid-four-column { grid-template-columns: repeat(4, 1fr); }
.grid-five-column { grid-template-columns: repeat(4, 1fr) 0.3fr; text-align: center; align-items: center; } .cart-heading { text-align: center; text-transform: uppercase; } hr { margin-top: 1rem; } .cart-item { padding: 3.2rem 0; display: flex; flex-direction: column; gap: 3.2rem; }
.cart-user--profile { display: flex; justify-content: flex-start; align-items: center; gap: 1.2rem; margin-bottom: 5.4rem;
img { width: 8rem; height: 8rem; border-radius: 50%; } h2 { font-size: 2.4rem; } - 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
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.