From 4c6951977e007fd12783fa92c3e1d54d06497b80 Mon Sep 17 00:00:00 2001 From: TaylorS15 Date: Sat, 11 Feb 2023 13:27:02 -0500 Subject: [PATCH] TODOs updated, removed App.css, About page --- frontend/src/App.css | 4 -- frontend/src/App.tsx | 5 +- frontend/src/components/APIKeyModal.tsx | 8 ++- frontend/src/components/About.tsx | 58 +++++++++++++++++++ .../src/components/Navigation/Navigation.tsx | 8 ++- frontend/src/index.css | 4 ++ 6 files changed, 77 insertions(+), 10 deletions(-) delete mode 100644 frontend/src/App.css create mode 100644 frontend/src/components/About.tsx diff --git a/frontend/src/App.css b/frontend/src/App.css deleted file mode 100644 index a43cf76..0000000 --- a/frontend/src/App.css +++ /dev/null @@ -1,4 +0,0 @@ -html, -body { - min-height: 100vh; -} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2c0a6da..dc0b2ca 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -3,13 +3,13 @@ import { Routes, Route } from 'react-router-dom'; import Navigation from './components/Navigation/Navigation'; import DocsGPT from './components/DocsGPT'; import APIKeyModal from './components/APIKeyModal'; -import './App.css'; +import About from './components/About'; export default function App() { //Currently using primitive state management. Will most likely be replaced with Redux. const [isMobile, setIsMobile] = useState(true); const [isMenuOpen, setIsMenuOpen] = useState(true); - const [isApiModalOpen, setIsApiModalOpen] = useState(true); + const [isApiModalOpen, setIsApiModalOpen] = useState(false); const [apiKey, setApiKey] = useState(''); const handleResize = () => { @@ -49,6 +49,7 @@ export default function App() { /> } /> + } /> ); diff --git a/frontend/src/components/APIKeyModal.tsx b/frontend/src/components/APIKeyModal.tsx index 4a23bb7..7c82a43 100644 --- a/frontend/src/components/APIKeyModal.tsx +++ b/frontend/src/components/APIKeyModal.tsx @@ -11,6 +11,10 @@ export default function APIKeyModal({ apiKey: string; setApiKey: React.Dispatch>; }) { + //TODO - Add form validation + //TODO - Connect to backend + //TODO - Add link to OpenAI API Key page + const [formError, setFormError] = useState(false); const handleResetKey = () => { @@ -28,7 +32,7 @@ export default function APIKeyModal({ isApiModalOpen ? 'visible' : 'hidden' } absolute z-30 h-screen w-screen bg-gray-alpha`} > -
+

OpenAI API Key

Before you can start using DocsGPT we need you to provide an API key @@ -54,7 +58,7 @@ export default function APIKeyModal({ Save

- + ); } diff --git a/frontend/src/components/About.tsx b/frontend/src/components/About.tsx new file mode 100644 index 0000000..e1173ca --- /dev/null +++ b/frontend/src/components/About.tsx @@ -0,0 +1,58 @@ +export default function About({ isMenuOpen }: { isMenuOpen: boolean }) { + //TODO - Add hyperlinks to text + //TODO - Styling + + return ( + //Parent div for all content shown through App.tsx routing needs to have this styling. +
+
+

About DocsGPT 🦖

+

+ Find the information in your documentation through AI-powered + open-source chatbot. Powered by GPT-3, Faiss and LangChain. +

+ +
+

+ If you want to add your own documentation, please follow the + instruction below: +

+

+ 1. Navigate to{' '} + /application folder +

+

+ 2. Install dependencies from{' '} + + pip install -r requirements.txt + +

+

+ 3. Prepare a .env file. + Copy .env_sample and + create .env with your + OpenAI API token +

+

+ 4. Run the app with{' '} + python app.py +

+
+ +

+ Currently It uses python pandas documentation, so it will respond to + information relevant to pandas. If you want to train it on different + documentation - please follow this guide. +

+ +

+ If you want to launch it on your own server - follow this guide. +

+
+
+ ); +} diff --git a/frontend/src/components/Navigation/Navigation.tsx b/frontend/src/components/Navigation/Navigation.tsx index e086bf8..ce4ba11 100644 --- a/frontend/src/components/Navigation/Navigation.tsx +++ b/frontend/src/components/Navigation/Navigation.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { NavLink } from 'react-router-dom'; import Arrow1 from './imgs/arrow.svg'; import Key from './imgs/key.svg'; import Info from './imgs/info.svg'; @@ -57,10 +58,13 @@ function DesktopNavigation({
-
+ info

About

-
+
link diff --git a/frontend/src/index.css b/frontend/src/index.css index 54f31b1..8c23069 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -15,6 +15,8 @@ html { line-height: 1.15; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ + min-height: 100vh; + overflow-x: hidden; } /* Sections @@ -26,6 +28,8 @@ html { body { margin: 0; + min-height: 100vh; + overflow-x: hidden; } /**