Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
uwituzeb committed Jul 18, 2024
2 parents 21a956a + ad149af commit fce855c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
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;
3 changes: 2 additions & 1 deletion src/Routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import OrderComponent from "../Components/orders";
const AppRoutes: React.FC = () => (
<div>
<Routes>
<Route path="/" element={<Homepage />} />

<Route path="" element={<Homepage />} />
<Route path="/login" element={<Signin />} />
<Route path="/checkout" element={<Checkout />} />
<Route path="/cart" element={<Cart />} />
Expand Down
1 change: 1 addition & 0 deletions src/pages/Homepage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const Homepage: React.FC = () => {
<BestDeals />
<ContactSection />
<Footer />
<VoiceflowChatWidget />
</div>
);
};
Expand Down

0 comments on commit fce855c

Please sign in to comment.