diff --git a/ui/autoMate/src/main/index.ts b/ui/autoMate/src/main/index.ts index 29ce755..fe606da 100644 --- a/ui/autoMate/src/main/index.ts +++ b/ui/autoMate/src/main/index.ts @@ -6,7 +6,7 @@ import icon from '../../resources/icon.png?asset' function createWindow(): void { // Create the browser window. const mainWindow = new BrowserWindow({ width: 600, - height: 500, + height: 350, show: false, // transparent: true, // frame: false, diff --git a/ui/autoMate/src/renderer/src/App.tsx b/ui/autoMate/src/renderer/src/App.tsx index dbf38c4..0ede833 100644 --- a/ui/autoMate/src/renderer/src/App.tsx +++ b/ui/autoMate/src/renderer/src/App.tsx @@ -1,16 +1,14 @@ -import { useState } from "react" import Result from "./components/Result" import Search from "./components/Search" -import { CodeContext } from "./context/CodeContext" -import { DataType } from "@renderer/data" +import { CodeProvider } from "./context/CodeContext" + function App(): JSX.Element { - const [data, setData] = useState([]) return ( - + - + ) } diff --git a/ui/autoMate/src/renderer/src/context/CodeContext.tsx b/ui/autoMate/src/renderer/src/context/CodeContext.tsx index 1b49f83..263a41c 100644 --- a/ui/autoMate/src/renderer/src/context/CodeContext.tsx +++ b/ui/autoMate/src/renderer/src/context/CodeContext.tsx @@ -1,4 +1,4 @@ -import { Dispatch, SetStateAction, createContext } from "react" +import { Dispatch, SetStateAction, createContext, useState } from "react" import { DataType } from "@renderer/data" interface ContextProps { data: DataType[] @@ -6,3 +6,11 @@ interface ContextProps { } export const CodeContext = createContext(undefined) +interface Props { + children: React.ReactNode +} +export const CodeProvider = ({children}:Props)=>{ + const [data, setData] = useState([]) + return {children} +} + diff --git a/ui/autoMate/src/renderer/src/hooks/useSearch.ts b/ui/autoMate/src/renderer/src/hooks/useSearch.ts index 2555895..779db65 100644 --- a/ui/autoMate/src/renderer/src/hooks/useSearch.ts +++ b/ui/autoMate/src/renderer/src/hooks/useSearch.ts @@ -9,7 +9,7 @@ export default()=>{ setData( codes.filter((code) => code.content.toLowerCase().includes(e.target.value.toLowerCase() || '@@@@@@') - ) + ).slice(0, 8) ) } return {search, handleSearch}