Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jan 12, 2025
1 parent e9d8bd9 commit 66bbd37
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
16 changes: 8 additions & 8 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ const config: Config = {
src: "/docs/scripts/redirect.js",
async: true,
},
// {
// src: "https://ory.sh/cmp/init.js",
// async: true,
// },
// {
// src: "https://consent.ory.sh/index.js",
// async: true,
// },
{
src: "https://ory.sh/cmp/init.js",
async: true,
},
{
src: "https://consent.ory.sh/index.js",
async: true,
},
],
}

Expand Down
9 changes: 6 additions & 3 deletions src/theme/KapaWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export default function KapaWidget() {
const [child, setChild] = useState<HTMLScriptElement | undefined>()

const loadKapaWidget = () => {
console.log("Kapai", window.Kapa)

if (isScriptLoaded) {
document.body.removeChild(child)
}
Expand Down Expand Up @@ -57,11 +59,11 @@ export default function KapaWidget() {
<span className="mantine-1ryt1ht mantine-Button-label">
<div
className="mantine-Stack-root mantine-1b4vo4u"
style={{ marginTop: "4px" }}
style={{marginTop: "4px"}}
>
<div
className="mantine-Image-root mantine-yxmaw9"
style={{ width: "2rem" }}
style={{width: "2rem"}}
>
<figure className="mantine-qenwvq mantine-Image-figure">
<div className="mantine-1iugybl mantine-Image-imageWrapper">
Expand All @@ -80,13 +82,14 @@ export default function KapaWidget() {
</div>
<div
className="mantine-Text-root mantine-1y9jqg9"
style={{ textShadow: "rgba(0, 0, 0, 0.2) 1px 1px 2px" }}
style={{textShadow: "rgba(0, 0, 0, 0.2) 1px 1px 2px"}}
>
Ask AI
</div>
</div>
</span>
</div>

</button>
)
}
14 changes: 9 additions & 5 deletions src/theme/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
// SPDX-License-Identifier: Apache-2.0

import React from "react"
import { QueryClient, QueryClientProvider, useQuery } from "react-query"
import {QueryClient, QueryClientProvider, useQuery} from "react-query"
import KapaWidget from "./KapaWidget"

const queryClient = new QueryClient()

function Root({ children }) {
function Root({children}) {
return (
<>
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
<KapaWidget />
</>
)
<KapaWidget/>
<script
dangerouslySetInnerHTML={{
__html: `(function(){let k=window.Kapa;if(!k){let i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};window.Kapa=i}})();`
}}/>
</>)
}

export default Root

0 comments on commit 66bbd37

Please sign in to comment.