Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecom #33

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Ecom #33

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3ad039f
react ecom code till navabr video 6
thapatechnical Sep 26, 2022
b74b278
added hero section Home and About Page
thapatechnical Sep 27, 2022
e8c02c6
added service & trusted section of homepage
thapatechnical Sep 29, 2022
fa42d5d
added contact form with formsfree
thapatechnical Sep 30, 2022
894f2ec
added fotter component
thapatechnical Oct 1, 2022
77b7279
error page added
thapatechnical Oct 2, 2022
5b21160
added productcontext
thapatechnical Oct 4, 2022
25d5de0
axios to fecth api data
thapatechnical Oct 5, 2022
a3a6851
added product reducer section
thapatechnical Oct 6, 2022
b565133
feature section of homepage added
thapatechnical Oct 7, 2022
b926732
format the price for indian currency updated
thapatechnical Oct 8, 2022
99d63b4
single product page context & UI
thapatechnical Oct 9, 2022
eaf05be
page navigation & simple UI of Single Product added
thapatechnical Oct 11, 2022
0956c0f
image dynamic protfolio section added
thapatechnical Oct 13, 2022
3968b08
star starings added
thapatechnical Oct 13, 2022
874af1c
colors and add to cart quanity both code added
thapatechnical Oct 15, 2022
c7ce267
gird and list view added
thapatechnical Oct 17, 2022
75d1e9f
testing
thapatechnical Oct 19, 2022
f3f97c4
sorting product page done
thapatechnical Oct 20, 2022
c2c6dd9
product page sort completed
thapatechnical Oct 25, 2022
f62c71f
product filter section till colros
thapatechnical Oct 29, 2022
f485c3a
Till colors filter done
thapatechnical Nov 1, 2022
73b3d4d
ecom code till cart remove button
thapatechnical Nov 5, 2022
ed2f5b7
addtocart done
thapatechnical Nov 15, 2022
22fb5ee
frontendDone
thapatechnical Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 38 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-router-dom": "^6.3.0",
"react-router-dom": "^6.4.1",
"react-scripts": "5.0.1",
"styled-components": "^5.3.5",
"web-vitals": "^2.1.4"
Expand Down
19 changes: 19 additions & 0 deletions src/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import HeroSection from "./components/HeroSection";
import { useProductContext } from "./context/productcontex";

const About = () => {
const { myName } = useProductContext();

const data = {
name: "Thapa Ecommerce",
};

return (
<>
{myName}
<HeroSection myData={data} />
</>
);
};

export default About;
56 changes: 55 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import About from "./About";
import Home from "./Home";
import Products from "./Products";
import Contact from "./Contact";
import Cart from "./Cart";
import SingleProduct from "./SingleProduct";
import ErrorPage from "./ErrorPage";
import { GlobalStyle } from "./GlobalStyle";
import { ThemeProvider } from "styled-components";
import Header from "./components/Header";
import Footer from "./components/Footer";

const App = () => {
return <div>Welcome to Thapa React E-Commerce Website</div>;
const theme = {
colors: {
heading: "rgb(24 24 29)",
text: "rgba(29 ,29, 29, .8)",
white: "#fff",
black: " #212529",
helper: "#8490ff",

bg: "#F6F8FA",
footer_bg: "#0a1435",
btn: "rgb(98 84 243)",
border: "rgba(98, 84, 243, 0.5)",
hr: "#ffffff",
gradient:
"linear-gradient(0deg, rgb(132 144 255) 0%, rgb(98 189 252) 100%)",
shadow:
"rgba(0, 0, 0, 0.02) 0px 1px 3px 0px,rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;",
shadowSupport: " rgba(0, 0, 0, 0.16) 0px 1px 4px",
},
media: {
mobile: "768px",
tab: "998px",
},
};

return (
<ThemeProvider theme={theme}>
<Router>
<GlobalStyle />
<Header />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/products" element={<Products />} />
<Route path="/contact" element={<Contact />} />
<Route path="/singleproduct/:id" element={<SingleProduct />} />
<Route path="/cart" element={<Cart />} />
<Route path="*" element={<ErrorPage />} />
</Routes>
<Footer />
</Router>
</ThemeProvider>
);
};

export default App;
82 changes: 81 additions & 1 deletion src/Cart.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,89 @@
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";

const Cart = () => {
return <Wrapper></Wrapper>;
const { cart, clearCart, total_price, shipping_fee } = useCartContext();
// console.log("🚀 ~ file: Cart.js ~ line 6 ~ Cart ~ cart", cart);

if (cart.length === 0) {
return (
<EmptyDiv>
<h3>No Cart in Item </h3>
</EmptyDiv>
);
}

return (
<Wrapper>
<div className="container">
<div className="cart_heading grid grid-five-column">
<p>Item</p>
<p className="cart-hide">Price</p>
<p>Quantity</p>
<p className="cart-hide">Subtotal</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>
<div>
<p>shipping fee:</p>
<p>
<FormatPrice price={shipping_fee} />
</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;
}
`;

const Wrapper = styled.section`
padding: 9rem 0;

Expand Down
50 changes: 49 additions & 1 deletion src/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,55 @@ const Contact = () => {
}
`;

return <Wrapper></Wrapper>;
return (
<Wrapper>
<h2 className="common-heading">Contact page</h2>

<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3782.265588856342!2d73.91455641541671!3d18.562061287384868!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3bc2c147b8b3a3bf%3A0x6f7fdcc8e4d6c77e!2sPhoenix%20Marketcity%20-%20Viman%20Nagar!5e0!3m2!1sen!2sin!4v1664345115285!5m2!1sen!2sin"
width="100%"
height="400"
style={{ border: 0 }}
allowFullScreen=""
loading="lazy"
referrerPolicy="no-referrer-when-downgrade"></iframe>

<div className="container">
<div className="contact-form">
<form
action="https://formspree.io/f/xeqdgwnq"
method="POST"
className="contact-inputs">
<input
type="text"
placeholder="username"
name="username"
required
autoComplete="off"
/>

<input
type="email"
name="Email"
placeholder="Email"
autoComplete="off"
required
/>

<textarea
name="Message"
cols="30"
rows="10"
required
autoComplete="off"
placeholder="Enter you message"></textarea>

<input type="submit" value="send" />
</form>
</div>
</div>
</Wrapper>
);
};

export default Contact;
Loading