Skip to content

Commit 810caba

Browse files
add data
1 parent c605ac6 commit 810caba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+731
-601
lines changed

src/component/molecules/CardModal/index.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,28 @@ export default function CartModal(props) {
111111
<h3> {dollarUSLocale.format(price)}đ</h3>
112112
<div className="evaluate">
113113
{dataStart.slice(0, props.start).map((index, item) => {
114-
return <AiFillStar className="cardpro_evaluate_star" />;
114+
return (
115+
<AiFillStar key={index} className="cardpro_evaluate_star" />
116+
);
115117
})}
116118
</div>
117119
<div>
118120
{props.dataRam &&
119121
props.dataRam.map((item, index) => {
120122
return (
121123
<button
124+
key={index}
122125
onClick={() => handleRam(index)}
123-
className={`CartModal_Ram ${index === activeRam ? "activeRam" : ""
124-
}`}
126+
className={`CartModal_Ram ${
127+
index === activeRam ? "activeRam" : ""
128+
}`}
125129
>
126130
<span>{item}</span>
127131
<img
128132
alt="img"
129-
className={`CartModal_RamImg ${index === activeRam ? "d-block" : "d-none"
130-
}`}
133+
className={`CartModal_RamImg ${
134+
index === activeRam ? "d-block" : "d-none"
135+
}`}
131136
src="https://frontend.tikicdn.com/_desktop-next/static/img/pdp_revamp_v2/selected-variant-indicator.svg"
132137
/>
133138
</button>
@@ -138,10 +143,12 @@ export default function CartModal(props) {
138143
{dataColor.map((item, index) => {
139144
return (
140145
<button
146+
key={index}
141147
style={{ background: item }}
142148
onClick={() => handleColor(index)}
143-
className={`CartModal_color ${index === activeColor ? "activeColor" : ""
144-
}`}
149+
className={`CartModal_color ${
150+
index === activeColor ? "activeColor" : ""
151+
}`}
145152
></button>
146153
);
147154
})}

src/component/molecules/CardProduct/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ const CardProduct = ({
5454
</div>
5555
<div className="cardpro_evaluate">
5656
{dataStart.slice(0, start).map((index, item) => {
57-
return <AiFillStar className="cardpro_evaluate_star" />;
57+
return <AiFillStar key={index} className="cardpro_evaluate_star" />;
5858
})}
5959
{dataStart.slice(0, 5 - start).map((index, item) => {
60-
return <AiFillStar style={{ color: "#8e9195" }} />;
60+
return <AiFillStar key={index} style={{ color: "#8e9195" }} />;
6161
})}
6262
</div>
6363
{cardSale ? (

src/component/molecules/Cart/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function Cart({ ClickClose, deleteProduct, data }) {
3939
{data &&
4040
data.slice(1).map((item, index) => {
4141
return (
42-
<div className="">
42+
<div className="" key={index}>
4343
<div className="content_product">
4444
<div className="cart_single d-flex align-items-center">
4545
<div className="me-2 content_img">

src/component/organisms/Banner/index.js

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import Slider from "react-slick";
33
import "slick-carousel/slick/slick.css";
44
import "slick-carousel/slick/slick-theme.css";
55
import "./index.scss";
6-
6+
import banner1 from "../../../images/banner/banner1.png";
7+
import banner2 from "../../../images/banner/banner2.png";
8+
import banner11 from "../../../images/banner/banner11.png";
9+
import banner12 from "../../../images/banner/banner12.png";
710
const Banner = () => {
811
var settings = {
912
dots: false,
@@ -18,30 +21,16 @@ const Banner = () => {
1821
<div className="row">
1922
<div className="col-xl-9 col-12" style={{ borderRadius: "24px" }}>
2023
<Slider {...settings} className="banner_slider ">
21-
<img
22-
alt="banner"
23-
src="https://cdn.tgdd.vn/2021/12/banner/tet-samsung-830-300-830x300.png"
24-
/>
24+
<img alt="banner" src={banner1} />
2525

26-
<img
27-
alt="banner"
28-
src="https://cdn.tgdd.vn/2022/01/banner/830-300-830x300-4.png"
29-
/>
26+
<img alt="banner" src={banner2} />
3027
</Slider>
3128
</div>
3229
<div className="col-xl-3 d-xl-block d-none">
3330
<div className="banner_left">
34-
<img
35-
className="ImgBanner"
36-
alt="banner"
37-
src="https://cdn.hoanghamobile.com/i/home/Uploads/2022/01/05/san-pham-hot-ip-13.png"
38-
/>
31+
<img className="ImgBanner" alt="banner" src={banner11} />
3932
<p className="m-0 banner_left-title">NHIỀU KHUYẾN MÃI HOT</p>
40-
<img
41-
className="ImgBanner"
42-
alt="banner"
43-
src="https://cdn.hoanghamobile.com/i/home/Uploads/2022/01/07/san-pham-hot-reno6.png"
44-
/>
33+
<img className="ImgBanner" alt="banner" src={banner12} />
4534
</div>
4635
</div>
4736
</div>

src/component/organisms/Layout/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Offcanvas,
77
Nav,
88
Accordion,
9-
NavDropdown,
109
Button,
1110
} from "react-bootstrap";
1211

@@ -37,7 +36,6 @@ import LogIn from "../Login";
3736
import logo from "../../../images/icons/logo.png";
3837
import firebase from "../../../service/firebase";
3938
import { LoginContex } from "../../context";
40-
import { addDocument } from "../../../service/api";
4139
import { Link } from "react-router-dom";
4240

4341
const Layout = ({ children }) => {
@@ -49,13 +47,20 @@ const Layout = ({ children }) => {
4947
const [showCart, setShowCart] = useState(false);
5048
const [showLove, setShowLove] = useState(false);
5149
const [showUser, setShowUser] = useState(false);
52-
50+
const [dataTest, setDataTest] = useState("");
5351
// gọi data redux cart
5452
const dataCart = useSelector((state) => state.cart);
5553

56-
console.log(dataCart);
54+
// console.log(dataCart);
5755
// gọi data login
5856

57+
useEffect(() => {
58+
fetch(`/api/greeting`)
59+
.then((response) => response.json())
60+
// 4. Setting *dogImage* to the image url that we received from the response above
61+
.then((data) => setDataTest(data));
62+
}, []);
63+
console.log(dataTest);
5964
useEffect(() => {
6065
firebase.auth().onAuthStateChanged((user) => {
6166
setUserSucsecss(user);

0 commit comments

Comments
 (0)