Skip to content

Commit

Permalink
Merge pull request #9 from atlp-rwanda/ft-chatBot
Browse files Browse the repository at this point in the history
Ft chat bot
  • Loading branch information
David-Neza authored Jul 17, 2024
2 parents 4d1bb3d + 6385a44 commit ad149af
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Components/ChatWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { useEffect } from 'react';

const VoiceflowChatWidget = () => {
useEffect(() => {
const script = document.createElement('script');
script.onload = () => {
window.voiceflow.chat.load({
verify: { projectID: '667d389695d66da905e86ce4' },
url: 'https://general-runtime.voiceflow.com',
versionID: 'production'
});
};
script.src = 'https://cdn.voiceflow.com/widget/bundle.mjs';
script.type = 'text/javascript';
document.body.appendChild(script);

return () => {
document.body.removeChild(script);
};
}, []);

return null;
};

export default VoiceflowChatWidget;
1 change: 1 addition & 0 deletions src/Routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Forgotpassword from "../Lib/ForgotPassword";
const AppRoutes: React.FC = () => (
<div>
<Routes>

<Route path="" element={<Homepage />} />
<Route path="/login" element={<Signin />} />
<Route path="/checkout" element={<Checkout />} />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Homepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HeroSection from '../Components/Homepage/HeroSection';
import BestDeals from '../Components/Homepage/BestDeals';
import AboutCrafters from '../Components/Homepage/AboutCrafters'
import PopularProducts from '../Components/Homepage/PopularProducts';
import VoiceflowChatWidget from '../Components/ChatWidget';


const Homepage: React.FC = () => {
Expand All @@ -18,6 +19,7 @@ const Homepage: React.FC = () => {
<BestDeals />
<ContactSection />
<Footer />
<VoiceflowChatWidget />
</div>
);
};
Expand Down

0 comments on commit ad149af

Please sign in to comment.