From 4f9ce70ff80519c63cde0ef0fa3fe6a9f68a2465 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Thu, 16 May 2024 18:23:45 +0530 Subject: [PATCH] (hero): demo queries on click --- frontend/.env.development | 2 +- frontend/src/Hero.tsx | 82 ++++++++++------------ frontend/src/conversation/Conversation.tsx | 2 +- 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index 7a87f76..9569966 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,3 +1,3 @@ # Please put appropriate value -VITE_API_HOST=http://0.0.0.0:7091 +VITE_API_HOST=http://127.0.0.1:7091 VITE_API_STREAMING=true \ No newline at end of file diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index b12ec44..f267744 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -1,13 +1,25 @@ -import { useDarkTheme, useMediaQuery } from './hooks'; import DocsGPT3 from './assets/cute_docsgpt3.svg'; -import { useSelector } from 'react-redux'; -import { selectConversations } from './preferences/preferenceSlice'; -import Arrow2 from './assets/dropdown-arrow.svg'; -export default function Hero({ className = '' }: { className?: string }) { - // const isMobile = window.innerWidth <= 768; - const { isMobile } = useMediaQuery(); - const [isDarkTheme] = useDarkTheme(); - const conversations = useSelector(selectConversations); +const demos: { header: string, query: string }[] = [ + { + header: "Learn about DocsGPT", + query: "What is DocsGPT ?" + }, + { + header: "Summarise documentation", + query: "Summarise current context" + }, + { + header: "Write Code", + query: "Write code for api request for /api/answer" + }, + { + header: "Learning Assistance", + query: "Write potential questions that can be answered by context" + } +]; + +export default function Hero({ handleQuestion }: { handleQuestion: (question: string) => void }) { + return (
- +
-
-

- Chat with your documentation -

- - Upload documents and get your answers - -
-
-

- Chat with your documentation -

- - Upload documents and get your answers - -
-
-

- Chat with your documentation -

- - Upload documents and get your answers - -
-
-

- Chat with your documentation -

- - Upload documents and get your answers - -
+ { + demos.map((demo) => ( + <> + + + )) + }
- ); + ); } diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 6839d71..5835090 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -168,7 +168,7 @@ export default function Conversation() { })} )} - {queries.length === 0 && } + {queries.length === 0 && }