diff --git a/Components/Buttons/Button.jsx b/Components/Buttons/Button.jsx new file mode 100644 index 0000000..aa8a54b --- /dev/null +++ b/Components/Buttons/Button.jsx @@ -0,0 +1,13 @@ +import Link from "next/link"; +const Button = ({ buttonText, buttonLink ="/",}) => { + return ( + + + + ); +}; + +export default Button; + diff --git a/Components/Buttons/ContactButton.jsx b/Components/Buttons/ContactButton.jsx new file mode 100644 index 0000000..7dc6e4d --- /dev/null +++ b/Components/Buttons/ContactButton.jsx @@ -0,0 +1,19 @@ +const ContactButton = ({buttonText}) => { + const openChatScreen = () => { + const chatButton = document.getElementsByClassName('videoask-embed__button--SgLKO')[0]; + if (chatButton) { + chatButton.click(); + } + }; + + return ( + + ); + }; + + export default ContactButton; \ No newline at end of file diff --git a/Components/Elements/VideoAsk.jsx b/Components/Elements/VideoAsk.jsx index 89027d5..97aef97 100644 --- a/Components/Elements/VideoAsk.jsx +++ b/Components/Elements/VideoAsk.jsx @@ -1,25 +1,30 @@ -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; const VideoAsk = () => { - useEffect(() => { - window.VIDEOASK_EMBED_CONFIG = { - "kind": "widget", - "url": "https://www.videoask.com/f8fah1r34", - "options": { - "widgetType": "VideoThumbnailSmall", - "text": "Talk", - "backgroundColor": "#FFFFFF", - "position": "bottom-right", - "dismissible": true - } - }; - const script = document.createElement('script'); - script.src = 'https://www.videoask.com/embed/embed.js'; - script.async = true; - document.body.appendChild(script); - }, []); +const [isMounted, setIsMounted] = useState(false); - return null; +useEffect(() => { +setIsMounted(true); +if (isMounted) { + window.VIDEOASK_EMBED_CONFIG = { + "kind": "widget", + "url": "https://www.videoask.com/f8fah1r34", + "options": { + "widgetType": "VideoThumbnailSmall", + "text": "Talk", + "backgroundColor": "#FFFFFF", + "position": "bottom-right", + "dismissible": true + } + }; + const script = document.createElement('script'); + script.src = 'https://www.videoask.com/embed/embed.js'; + script.async = true; + document.body.appendChild(script); +} +}, [isMounted]); + +return null; }; export default VideoAsk; \ No newline at end of file diff --git a/Components/Layout/ContactFormSection.jsx b/Components/Layout/ContactFormSection.jsx index 7f53426..74b9674 100644 --- a/Components/Layout/ContactFormSection.jsx +++ b/Components/Layout/ContactFormSection.jsx @@ -1,36 +1,30 @@ -import VideoButton from "/home/clyde/Code/shiloh/Components/Buttons/video-button.jsx"; -import Link from "next/link"; +import ContactButton from "../Buttons/ContactButton.jsx"; import ContactThreeJsComponent from "../Elements/ContactThreeJsComponent.jsx"; const ContactFormSection = ({ text, - videoId, - buttonOneText, - buttonTwoText, - buttonLink = "/", // add a default value, + buttonText, }) => { - return ( + <>
- + +

{text}

- - - {buttonTwoText} - +
+ ); }; -export default ContactFormSection; \ No newline at end of file +export default ContactFormSection; diff --git a/pages/index.js b/pages/index.js index 7ea6eab..2977009 100644 --- a/pages/index.js +++ b/pages/index.js @@ -50,7 +50,9 @@ export default function Home() { buttonLink="/contactus" /> );