Skip to content

Commit

Permalink
Merge pull request #238 from gita/add-gita-ai
Browse files Browse the repository at this point in the history
Add gita ai widget
  • Loading branch information
samanyougarg authored Jan 20, 2024
2 parents c8d573d + 34165ff commit e8c7b29
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 117 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@headlessui/react": "^1.4.1",
"@heroicons/react": "v1",
"@popperjs/core": "2.9.1",
"@sentry/nextjs": "^7.67.0",
"@sentry/nextjs": "^7.70.0",
"@supabase/supabase-js": "^2.0.4",
"@svgr/cli": "^6.1.1",
"@types/express": "^4.17.17",
Expand Down
22 changes: 22 additions & 0 deletions src/app/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Metadata } from "next";
import Script from "next/script";

import { getAllChapters } from "lib/getAllChapters";
import { paramsToLocale } from "shared/functions";
Expand Down Expand Up @@ -129,6 +130,27 @@ export default async function Home({ params }: ParamsWithLocale) {
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLdThree) }}
/>
<Script strategy="lazyOnload" id="botsonic-widget-script">
{`
(function (w, d, s, o, f, js, fjs) {
w["botsonic_widget"] = o;
w[o] =
w[o] ||
function () {
(w[o].q = w[o].q || []).push(arguments);
};
(js = d.createElement(s)), (fjs = d.getElementsByTagName(s)[0]);
js.id = o;
js.src = f;
js.async = 1;
fjs.parentNode.insertBefore(js, fjs);
})(window, document, "script", "Botsonic", "https://widget.writesonic.com/CDN/botsonic.min.js");
Botsonic("init", {
serviceBaseUrl: "https://api.botsonic.ai",
token: "aa0b5e0e-9284-4c52-968f-77f2c959dcdc",
});
`}
</Script>
<HomePage chapters={chapters} locale={locale} />
</>
);
Expand Down
20 changes: 11 additions & 9 deletions src/app/gitagpt/[[...locale]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ export default async function GitagptPage(props: ParamsWithLocale) {
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLdTwo) }}
/>
<div style={{ height: "100vh", width: "100vw" }}>
<iframe
style={{ height: "100%", width: "100%" }}
src="https://widget.writesonic.com/CDN/index.html?service-base-url=https://api.botsonic.ai&token=aa0b5e0e-9284-4c52-968f-77f2c959dcdc&base-origin=https://bot.writesonic.com&instance-name=Botsonic&standalone=true&page-url=https://bot.writesonic.com/61178c5c-aed2-47c0-8759-305d2489956c?t=connect&workspace_id=91c72ad8-79d9-44aa-88e5-6c3738324985"
title="GitaGPT"
>
You need to enable JavaScript to run this app.
</iframe>
</div>
{["en", "hi"].includes(locale) && (
<div style={{ height: "100vh", width: "100vw" }}>
<iframe
style={{ height: "100%", width: "100%" }}
src="https://widget.writesonic.com/CDN/index.html?service-base-url=https://api.botsonic.ai&token=aa0b5e0e-9284-4c52-968f-77f2c959dcdc&base-origin=https://bot.writesonic.com&instance-name=Botsonic&standalone=true&page-url=https://bot.writesonic.com/61178c5c-aed2-47c0-8759-305d2489956c?t=connect&workspace_id=91c72ad8-79d9-44aa-88e5-6c3738324985"
title="GitaGPT"
>
You need to enable JavaScript to run this app.
</iframe>
</div>
)}
</>
);
}
4 changes: 2 additions & 2 deletions src/components/Footers/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const getNavigation = (translate: Translate) => ({
},
{
name: translate("Bhagavad Gita AI"),
href: "https://bhagavadgita.ai",
newTab: true,
href: "/gitagpt",
newTab: false,
},
{
name: translate("Acknowledgements"),
Expand Down
7 changes: 7 additions & 0 deletions src/components/Headers/IndexHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const chapters = [
const mobileNav = [
{ name: "Quotes", href: "/bhagavad-gita-quotes", current: false },
{ name: "About Gita", href: "/about", current: false },
{ name: "Gita AI", href: "/gitagpt", current: false },
];

type Props = {
Expand Down Expand Up @@ -236,6 +237,12 @@ export default function IndexHeader({ locale, translate }: Props) {
>
{translate("About Gita")}
</LinkWithLocale>
<LinkWithLocale
href="/gitagpt"
className="text-base font-medium text-black hover:text-gray-500 focus:outline-none dark:text-white"
>
{translate("Gita AI")}
</LinkWithLocale>
{/* {!loggedIn ? (
<Popover className="relative">
{({ open }) => (
Expand Down
3 changes: 2 additions & 1 deletion src/shared/translate/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@
"Sorry, we couldn't find the page you're looking for": "क्षमा करें, हम वह पेज नहीं ढूंढ सके जिसे आप ढूंढ रहे थे",
"App": "मोबाइल ऐप",
"Privacy": "प्राइवेसी",
"Acknowledgements": "स्वीकृतियाँ"
"Acknowledgements": "स्वीकृतियाँ",
"Gita AI": "गीता एआई"
}
Loading

1 comment on commit e8c7b29

@vercel
Copy link

@vercel vercel bot commented on e8c7b29 Jan 20, 2024

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:

bg-frontend – ./

bg-frontend-git-main-gita-v2.vercel.app
bg-frontend-gita-v2.vercel.app
bg-frontend-lac.vercel.app

Please sign in to comment.