diff --git a/.gitignore b/.gitignore index 699280ec..d261c091 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ out pages/api-documentation/index.mdx .vercel .env*.local -.ignore.me.* \ No newline at end of file +.ignore.me.* +lefthook.yml diff --git a/assets/close-down.svg b/assets/close-down.svg new file mode 100644 index 00000000..fcba34b2 --- /dev/null +++ b/assets/close-down.svg @@ -0,0 +1,5 @@ + + + diff --git a/assets/community.icon.svg b/assets/community.icon.svg index 1a386617..0aa8b93c 100644 --- a/assets/community.icon.svg +++ b/assets/community.icon.svg @@ -1,4 +1,8 @@ - - - + + + diff --git a/assets/construction.svg b/assets/construction.svg new file mode 100644 index 00000000..2e108b83 --- /dev/null +++ b/assets/construction.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/assets/execution.svg b/assets/execution.svg new file mode 100644 index 00000000..df7a1184 --- /dev/null +++ b/assets/execution.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/javascript.svg b/assets/javascript.svg new file mode 100644 index 00000000..1f203d35 --- /dev/null +++ b/assets/javascript.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/open-in-window.svg b/assets/open-in-window.svg new file mode 100644 index 00000000..8b663935 --- /dev/null +++ b/assets/open-in-window.svg @@ -0,0 +1,6 @@ + + + + diff --git a/assets/react.svg b/assets/react.svg new file mode 100644 index 00000000..3a27f7ce --- /dev/null +++ b/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/ComingSoon.tsx b/components/ComingSoon.tsx new file mode 100644 index 00000000..bea61d9d --- /dev/null +++ b/components/ComingSoon.tsx @@ -0,0 +1,15 @@ +import Construction from '@assets/construction.svg' + +type Props = {} + +export const ComingSoon = ({}: Props) => { + return ( + + Coming Soon + This section is under construction. + + + + + ) +} diff --git a/components/Demo.tsx b/components/Demo.tsx new file mode 100644 index 00000000..87f9feaf --- /dev/null +++ b/components/Demo.tsx @@ -0,0 +1,77 @@ +import Execution from "@assets/execution.svg"; +import CloseDown from "@assets/close-down.svg"; +import OpenInWindow from "@assets/open-in-window.svg"; +import { useState } from "react"; + +type Props = { + title?: string; + message?: string; + example: string; + preload?: boolean; + file?: string +}; + +export const Demo = ({ example, message, title, file = 'src/App.tsx', preload = true }: Props) => { + const [showDemo, setShowDemo] = useState(false); + + const src = `https://stackblitz.com/github/botpress/documentation-examples/tree/master/examples/${example}?embed=1&hideNavigation=1&view=both&file=${encodeURIComponent(file)}`; + + return ( + <> + {showDemo && ( + + )} + setShowDemo(true)} + > + + + { + e.stopPropagation(); + setShowDemo(false); + }} + > + + + + {(preload || showDemo) && ( + + )} + + + + setShowDemo(true)} + > + + <> + + + {title ?? "Live Demo"} + + {message ?? "Click to see a live demo"} + + + e.stopPropagation()} + target="_blank" + > + + + > + + + > + ); +}; diff --git a/components/DocumentationIcon.tsx b/components/DocumentationIcon.tsx index 7c721811..d8e4f842 100644 --- a/components/DocumentationIcon.tsx +++ b/components/DocumentationIcon.tsx @@ -10,6 +10,13 @@ import Rocket from '@assets/learning_center.inline.svg' import Lightning from '@assets/lightning.inline.svg' import Prompt from '@assets/prompt.inline.svg' import StudioLayout from '@assets/studio-layout.inline.svg' +import Desktop from '@assets/desktop.icon.svg' +import ReactIcon from '@assets/react.svg' +import Javascript from '@assets/javascript.svg' +import Code from '@assets/code.icon.svg' +import Community from '@assets/community.icon.svg' +import Dashboard from '@assets/dashboard.icon.svg' + export type DocumentationIcons = | 'book' | 'chip' @@ -22,6 +29,12 @@ export type DocumentationIcons = | 'grid' | 'lightning' | 'rocket' + | 'desktop' + | 'react' + | 'code' + | 'javascript' + | 'community' + | 'dashboard' export function DocumentationIcon(props: { name: DocumentationIcons; className: string }) { const IconElement = (() => { @@ -48,6 +61,18 @@ export function DocumentationIcon(props: { name: DocumentationIcons; className: return Lightning case 'rocket': return Rocket + case 'desktop': + return Desktop + case 'react': + return ReactIcon + case 'code': + return Code + case 'javascript': + return Javascript + case 'community': + return Community + case 'dashboard': + return Dashboard default: return diff --git a/components/Feedback.tsx b/components/Feedback.tsx index 85396322..eb66d4a5 100644 --- a/components/Feedback.tsx +++ b/components/Feedback.tsx @@ -12,6 +12,7 @@ export const Feedback = () => { }, [location]) const sendFeedback = async ({ feedback }: { feedback: 'positive' | 'negative' }) => { + setFeedbackGiven(true) await fetch(process.env.NEXT_PUBLIC_BOT_URL ?? '', { method: 'POST', body: JSON.stringify({ @@ -21,8 +22,6 @@ export const Feedback = () => { }).catch(err => { console.error(err) }) - - setFeedbackGiven(true) } return ( diff --git a/components/LinkCard.tsx b/components/LinkCard.tsx index df33dbd0..e0580db6 100644 --- a/components/LinkCard.tsx +++ b/components/LinkCard.tsx @@ -22,7 +22,9 @@ export function LinkCard({ title, className, href, icon, children }: LinkCardPro )} > - {icon && } + + {icon && } + {title} {children} diff --git a/components/LoadGTM.tsx b/components/LoadGTM.tsx index d8687594..116a8ec4 100644 --- a/components/LoadGTM.tsx +++ b/components/LoadGTM.tsx @@ -8,7 +8,7 @@ type props = { const LoadGTM = (props: props) => { return ( - + +
This section is under construction.
+ {message ?? "Click to see a live demo"} +