Skip to content

Commit

Permalink
Feat/chaingpt (#145)
Browse files Browse the repository at this point in the history
* feat: 🎸 chaingpt demo

* refactor: 💡 move chainGPT to src/theme; upgrade to 0.1.1

* ci: 🎡 update chaingpt-component

* feat: 🎸 chaingpt/api/chat -> /api/chaingpt
  • Loading branch information
hzz780 authored Jul 23, 2024
1 parent d0918fb commit 9f9c348
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@docusaurus/core": "3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@mdx-js/react": "^3.0.0",
"chaingpt-component": "^0.1.2",
"clsx": "^2.0.0",
"docusaurus-theme-search-typesense": "^0.20.0-0",
"dotenv": "^16.4.5",
Expand Down
8 changes: 8 additions & 0 deletions src/theme/ChainGPT/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.chainGPTContainer {
position: fixed;
right: 18px;
bottom: 18px;
display: flex;
flex-direction: column;
align-items: end;
}
16 changes: 16 additions & 0 deletions src/theme/ChainGPT/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";
import 'chaingpt-component/dist/index.css';
import styles from "./index.module.css";
import {ChatBoxButton} from 'chaingpt-component';

export default function ChainGPT(): JSX.Element {
return (
<>
<div className={styles.chainGPTContainer}>
<ChatBoxButton
apiUri="/api/chaingpt"
/>
</div>
</>
);
}
20 changes: 13 additions & 7 deletions src/theme/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import React from "react";
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";
import ChainGPT from '@site/src/theme/ChainGPT';

/**
* Reference: https://docusaurus.io/docs/markdown-features/assets#themed-images
*/
export default function Logo(): JSX.Element {
return (
<ThemedImage
alt="aelf"
sources={{
light: useBaseUrl("/img/Logo.aelf.svg"),
dark: useBaseUrl("/img/Logo.aelf.white.svg"),
}}
/>
<>
<ThemedImage
alt="aelf"
sources={{
light: useBaseUrl("/img/Logo.aelf.svg"),
dark: useBaseUrl("/img/Logo.aelf.white.svg"),
}}
/>
<div>
<ChainGPT />
</div>
</>
);
}

0 comments on commit 9f9c348

Please sign in to comment.