Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
agha-naveed committed Sep 10, 2024
1 parent 3321d26 commit 75a673e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 258 deletions.
17 changes: 1 addition & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"dompurify": "^3.1.6",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-speech-recognition": "^3.10.0",
"typed.js": "^2.1.0"
"react-icons": "^5.3.0"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
Expand Down
12 changes: 0 additions & 12 deletions src/App.jsx

This file was deleted.

107 changes: 0 additions & 107 deletions src/SpeechToText.jsx

This file was deleted.

108 changes: 0 additions & 108 deletions src/VoiceToText.jsx

This file was deleted.

14 changes: 6 additions & 8 deletions src/components/Homepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import DOMPurify from 'dompurify';
import "@fontsource/poppins"
import logo from '../assets/my-logo.webp'
import { IoSearch, IoSettings, IoCloseOutline, IoAdd } from "react-icons/io5";
import { FaMicrophone } from "react-icons/fa";
import { FiMessageSquare } from "react-icons/fi";
import { CgMenuLeft } from "react-icons/cg";
import { Context } from '../context/Context';

export default function Homepage() {
let [sidebar, setSidebar] = useState(false)
let ref = useRef()

const {onSent, recentPrompt, showResult, loading, resultData, setInput, input, prevPrompt, setRecentPrompt, newChat} = useContext(Context)

const loadPrompt = async (prompt) => {
Expand All @@ -33,8 +32,6 @@ export default function Homepage() {





const wrapCodeBlocks = (content) => {
content = content.replace(/```(.*?)```/gs, (match, code) => {
return `<pre><code>${escapeHTML(code)}</code></pre>`;
Expand All @@ -61,6 +58,7 @@ export default function Homepage() {
const sanitizedHTML = renderContent(resultData);



return (
<div className='w-full min-h-screen dark:bg-slate-800 dark:text-white text-black grid items-center p-5 font-poppins'>
<nav className='flex justify-between place-self-start w-full h-[60px] items-center p-5 z-50'>
Expand Down Expand Up @@ -127,12 +125,12 @@ export default function Homepage() {
</div>

<div className="search-bar w-full grid">
<div className='w-full flex'>
<div className='w-full flex text-black'>


<input type="text" ref={ref} placeholder='Enter Prompt...' className='w-full h-12 text-black border-none outline-none rounded-l-3xl pl-6 pr-1' onChange={getSearchData} value={input} onKeyDown={pressEnter} />
<button className="search-icon bg-white h-auto px-[7px]">
<FaMicrophone className='w-[40px] h-[40px] p-[7px] text-2xl text-white rounded-full bg-slate-800' />
</button>


<button onClick={() => {input && onSent()}} className="search-icon bg-white rounded-r-3xl h-auto px-[7px]">
<IoSearch className='w-[40px] h-[40px] p-[7px] text-2xl text-white rounded-full bg-slate-800' />
</button>
Expand Down
4 changes: 0 additions & 4 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { createRoot } from 'react-dom/client'
import './index.css'
import Homepage from './components/Homepage'
import ContextProvider from './context/Context'
import VoiceToText from './VoiceToText'
import App from './App'

// import

Expand All @@ -14,7 +12,5 @@ createRoot(document.getElementById('root')).render(

<Homepage />
</ContextProvider>
<VoiceToText />
{/* <App /> */}
</StrictMode>,
)

0 comments on commit 75a673e

Please sign in to comment.