Skip to content

Commit

Permalink
Merge pull request #105 from fdhhhdjd/developer
Browse files Browse the repository at this point in the history
#93 frontend
  • Loading branch information
fdhhhdjd committed Nov 4, 2022
2 parents 862b86b + 6a0cbcb commit 7a0f2a7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
14 changes: 14 additions & 0 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react-helmet-async": "^1.3.0",
"react-hot-toast": "^2.2.0",
"react-icons": "^4.3.1",
"react-lazy-load-image-component": "^1.5.5",
"react-paypal-express-checkout": "^1.0.5",
"react-phone-number-input": "^3.1.50",
"react-redux": "^7.2.6",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import "react-phone-number-input/style.css";
import { Provider } from "react-redux";
import { BrowserRouter as Router } from "react-router-dom";
import "react-toastify/dist/ReactToastify.css";
import "react-lazy-load-image-component/src/effects/blur.css";
import "react-lazy-load-image-component/src/effects/opacity.css";
import App from "./App";
import "./index.css";
import reportWebVitals from "./reportWebVitals";
Expand Down
18 changes: 14 additions & 4 deletions frontend/src/v1/user_ui/custom_hook/Lazy_Load_Img.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useEffect, useRef } from "react";
const Lazy_Load_Img = ({ url, style }) => {
import { LazyLoadImage, trackWindowScroll } from "react-lazy-load-image-component";
import { comment_png } from "../imports/Assets_Import"
const Lazy_Load_Img = ({ url, style, scrollPosition }) => {
const imgRef = useRef();
useEffect(() => {
const img = imgRef.current;
Expand All @@ -19,7 +21,7 @@ const Lazy_Load_Img = ({ url, style }) => {

return (
<React.Fragment>
{style ? (
{/* {style ? (
<img
alt="...loading"
ref={imgRef}
Expand All @@ -28,9 +30,17 @@ const Lazy_Load_Img = ({ url, style }) => {
/>
) : (
<img alt="...loading" ref={imgRef} className="lazy-load" />
)}
)} */}
<LazyLoadImage
src={url}
PlaceholderSrc={comment_png}
effect="opacity"
alt={url}
placeholderSrc={url}
scrollPosition={scrollPosition}
/>
</React.Fragment>
);
};

export default Lazy_Load_Img;
export default trackWindowScroll(Lazy_Load_Img);

2 comments on commit 7a0f2a7

@vercel
Copy link

@vercel vercel bot commented on 7a0f2a7 Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

serversendemailshopshoes – ./server_send_email

serversendemailshopshoes-fdhhhdjd.vercel.app
full-stack-shop-shoes-bootstrap.vercel.app
serversendemailshopshoes-git-main-fdhhhdjd.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 7a0f2a7 Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.