Skip to content

Commit

Permalink
deps: upgrade dependancies for delete warnings, react-calendly and re…
Browse files Browse the repository at this point in the history
…act typed + delete useless code
  • Loading branch information
JW-Rami committed Feb 10, 2024
1 parent 56d1ff4 commit c9e9655
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 351 deletions.
293 changes: 14 additions & 279 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
"framer-motion": "^7.8.0",
"gsap": "^3.11.3",
"react": "^18.2.0",
"react-bootstrap": "^2.5.0",
"react-calendly": "^4.2.0",
"react-calendly": "^4.3.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-hook-form": "^7.40.0",
"react-router-dom": "^6.4.5",
"react-router-hash-link": "^2.4.3",
"react-scripts": "5.0.1",
"react-type-animation": "^2.1.2",
"react-type-animation": "^3.2.0",
"sass": "^1.70.0",
"semantic-ui-react": "^2.1.4",
"swiper": "^8.0.0",
Expand Down
8 changes: 1 addition & 7 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Home from "./page/Home/Home";
import Services from "./page/Services/Services";
import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { useState } from "react";
import Navbar from "./components/Navbar/Navbar";
import MentionsLegales from "./components/MentionsLegales/MentionsLegales";
Expand Down Expand Up @@ -41,12 +41,6 @@ function App() {
<Route path="/Bitcoin-price" element={<BitcoinPrice />} />
</Routes>
)}
{/* <Routes>
<Route path='/' element={<Home handlingLangage={handlingLangage} langageState={langageState} />}/>
<Route path='/Services' element={<Services langageState={langageState} />} />
<Route path="/MentionsLegales" element={<MentionsLegales langageState={{langageState}}/>}/>
<Route path="/Bitcoin-price" element={<BitcoinPrice/>}/>
</Routes> */}
</BrowserRouter>
);
}
Expand Down
7 changes: 2 additions & 5 deletions src/components/AnimationsComponent/AnimationsComponent.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from "react";
import "./Animations-Component.css";
import { delay, motion, useScroll } from "framer-motion";
import { motion, useScroll } from "framer-motion";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
// import { ScrollSmoother } from "gsap/ScrollSmoother";
import { useEffect, useRef } from "react";
import { useEffect } from "react";

function AnimationsComponent() {
const { scrollYProgress } = useScroll();
Expand Down Expand Up @@ -38,8 +37,6 @@ function AnimationsComponent() {

useEffect(() => {
slideInTop("#cta-form-text");
}, []);
useEffect(() => {
slideInTop("#form");
}, []);

Expand Down
136 changes: 89 additions & 47 deletions src/components/Calendly/Calendly.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ function Calendly({ urlEnd, docRefFromHomeState }) {
setCalendlyWidth("80%");
}
};
function checkIfInView() {
const rect = calendlyRef.current.getBoundingClientRect();
// console.log('Checking if Calendly is in view...')
if (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <=
(window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
) {
getIpAddress();
// handleCalendlyViewed();
window.removeEventListener("scroll", checkIfInView); // Supprimez l'écouteur d'événements une fois que le calendly est en vue
}
}
// function checkIfInView() {
// const rect = calendlyRef.current.getBoundingClientRect();
// // console.log('Checking if Calendly is in view...')
// if (
// rect.top >= 0 &&
// rect.left >= 0 &&
// rect.bottom <=
// (window.innerHeight || document.documentElement.clientHeight) &&
// rect.right <= (window.innerWidth || document.documentElement.clientWidth)
// ) {
// getIpAddress();
// // handleCalendlyViewed();
// window.removeEventListener("scroll", checkIfInView); // Supprimez l'écouteur d'événements une fois que le calendly est en vue
// }
// }

async function getIpAddress() {
try {
Expand All @@ -61,35 +61,35 @@ function Calendly({ urlEnd, docRefFromHomeState }) {
}
}

async function handleCalendlyViewed() {
if (docRefFromHomeState) {
try {
const viewedAt = new Date();
const docRef = doc(db, "calendlyViewed", docRefFromHomeState);
await updateDoc(docRef, {
date: viewedAt,
ip_address: userIpAddress,
});
console.log("Document updated with ID: ", docRefFromHomeState);
} catch (e) {
console.error("Error updating document: ", e);
}
} else {
try {
// await getIpAddress(); // Attendre que getIpAddress se termine
const viewedAt = new Date();
const calendlyViewedCollection = collection(db, "calendlyViewed");
const docRef = await addDoc(calendlyViewedCollection, {
date: viewedAt,
ip_address: userIpAddress,
});
console.log("Document written with ID: ", docRef.id);
setDocRefState(docRef.id);
} catch (e) {
console.error("Error adding document: ", e);
}
}
}
// async function handleCalendlyViewed() {
// if (docRefFromHomeState) {
// try {
// const viewedAt = new Date();
// const docRef = doc(db, "calendlyViewed", docRefFromHomeState);
// await updateDoc(docRef, {
// date: viewedAt,
// ip_address: userIpAddress,
// });
// console.log("Document updated with ID: ", docRefFromHomeState);
// } catch (e) {
// console.error("Error updating document: ", e);
// }
// } else {
// try {
// // await getIpAddress(); // Attendre que getIpAddress se termine
// const viewedAt = new Date();
// const calendlyViewedCollection = collection(db, "calendlyViewed");
// const docRef = await addDoc(calendlyViewedCollection, {
// date: viewedAt,
// ip_address: userIpAddress,
// });
// console.log("Document written with ID: ", docRef.id);
// setDocRefState(docRef.id);
// } catch (e) {
// console.error("Error adding document: ", e);
// }
// }
// }

async function handleDateTimeSelected() {
try {
Expand All @@ -114,14 +114,56 @@ function Calendly({ urlEnd, docRefFromHomeState }) {
}
}
useEffect(() => {
async function handleCalendlyViewed() {
if (docRefFromHomeState) {
try {
const viewedAt = new Date();
const docRef = doc(db, "calendlyViewed", docRefFromHomeState);
await updateDoc(docRef, {
date: viewedAt,
ip_address: userIpAddress,
});
console.log("Document updated with ID: ", docRefFromHomeState);
} catch (e) {
console.error("Error updating document: ", e);
}
} else {
try {
// await getIpAddress(); // Attendre que getIpAddress se termine
const viewedAt = new Date();
const calendlyViewedCollection = collection(db, "calendlyViewed");
const docRef = await addDoc(calendlyViewedCollection, {
date: viewedAt,
ip_address: userIpAddress,
});
console.log("Document written with ID: ", docRef.id);
setDocRefState(docRef.id);
} catch (e) {
console.error("Error adding document: ", e);
}
}
}
handleCalendlyViewed();
}, [userIpAddress]);
}, [userIpAddress, docRefFromHomeState]);

useEffect(() => {
handleResize();
function checkIfInView() {
const rect = calendlyRef.current.getBoundingClientRect();
// console.log('Checking if Calendly is in view...')
if (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <=
(window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
) {
getIpAddress();
// handleCalendlyViewed();
window.removeEventListener("scroll", checkIfInView); // Supprimez l'écouteur d'événements une fois que le calendly est en vue
}
}
window.addEventListener("resize", handleResize);
}, []);
useEffect(() => {
window.addEventListener("scroll", checkIfInView);
return () => {
window.removeEventListener("scroll", checkIfInView); // Nettoyez l'écouteur d'événements lorsque le composant est démonté
Expand Down
2 changes: 1 addition & 1 deletion src/components/Cta/Cta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import "./Cta.css";
import { useLocation, useNavigate } from "react-router-dom";
// import { useLocation, useNavigate } from "react-router-dom";
import { HashLink } from "react-router-hash-link";

const Cta = ({ langageState }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/LandingPage/LandingPage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import "./LandingPage.css";
import { TypeAnimation } from "react-type-animation";
import { Link } from "react-router-dom";
// import { Link } from "react-router-dom";
import { HashLink } from "react-router-hash-link";
import { useState } from "react";
// import { useState } from "react";

function LandingPage({ langageState }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
width: 15%;
height: 30px;
}
.burger > a {
.burger > div {
width: 50px;
height: 20px;
cursor: pointer;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ function Navbar({ handlingLangage, langageState, checkDomain }) {
</label>
</div> */}
<div className="burger">
<a onClick={handleClick}>
<div className="" onClick={handleClick}>
<span className={isClick ? "span span1-active" : "span"}></span>
<span className={isClick ? "span span2-active" : "span"}></span>
<span className={isClick ? "span span3-active" : "span"}></span>
</a>
</div>
</div>
</div>
</section>
Expand Down
3 changes: 2 additions & 1 deletion src/page/BitcoinPrice/BitcoinPrice.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ function BitcoinPrice({bitcoinPriceJwCorpDomain}) {
<div className="tradingview-widget-copyright">
<a
href="https://www.tradingview.com/"
rel="noopener nofollow"
// rel="noopener nofollow"
target="_blank"
rel="noreferrer"
>
{/* <span className="blue-text">
Track all markets on TradingView
Expand Down
6 changes: 3 additions & 3 deletions src/page/Services/Services.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import './Services.css';
import { Link } from 'react-router-dom';
import Navbar from '../../components/Navbar/Navbar';
// import { Link } from 'react-router-dom';
// import Navbar from '../../components/Navbar/Navbar';
import Footer from '../../components/Footer/Footer';
import LandingServices from '../../components/LandingServices/LandingServices';
import ContentServicesPage from '../../components/ContentServicesPage/ContentServicesPage';
import Google from '../../components/Googlemaps/Google';
import Formulaire from '../../components/Formulaire/Formulaire';
// import Formulaire from '../../components/Formulaire/Formulaire';
import Calendly from '../../components/Calendly/Calendly';
const Services = ({langageState}) => {
return (
Expand Down

0 comments on commit c9e9655

Please sign in to comment.