diff --git a/conf/sample.env_web-client b/conf/sample.env_web-client index 35fc6972c..e024bb762 100644 --- a/conf/sample.env_web-client +++ b/conf/sample.env_web-client @@ -5,8 +5,7 @@ NEXT_PUBLIC_DOWNLOAD_APP_IOS=# NEXT_PUBLIC_DOWNLOAD_APP_ANDROID=# NEXT_PUBLIC_GRAPHQL_ENGINE_URL=http://localhost:8080/v1/graphql NEXT_PUBLIC_GRAPHQL_ENGINE_WEB_SOCKET_URL=ws://localhost:8080/v1/graphql -OPENAPI_ENDPOINT=http://host.docker.internal:8000/v1 -OPENAPI_KEY=openapikey +NEXT_PUBLIC_OPENAPI_ENDPOINT=http://localhost:8000/v1/chat/completions KEYCLOAK_CLIENT_ID=hasura KEYCLOAK_CLIENT_SECRET=oMtCPAV7diKpE564SBspgKj4HqlKM4Hy AUTH_ISSUER=http://localhost:8088/realms/$KEYCLOAK_CLIENT_ID diff --git a/web-client/README.md b/web-client/README.md index a35675717..ef0d70d5e 100644 --- a/web-client/README.md +++ b/web-client/README.md @@ -77,9 +77,7 @@ Replace above configuration with your actual infrastructure. | [@tailwindcss/typography](https://tailwindcss.com/docs/typography-plugin) | UI | ^0.5.9 | | [embla-carousel](https://www.embla-carousel.com/) | UI | ^8.0.0-rc11 | | [@apollo/client](https://www.apollographql.com/docs/react/) | State management | ^3.8.1 | -| [mobx](https://mobx.js.org/README.html) | State management | ^6.10.0 | -| [mobx-react-lite](https://www.npmjs.com/package/mobx-react-lite) | State management | ^4.0.3 | -| [mobx-state-tree](https://mobx-state-tree.js.org/) | State management | ^5.1.8 | +| [jotai](https://jotai.org/) | State management | ^2.4.0 | ## Deploy to Netlify diff --git a/web-client/app/_components/AdvancedPrompt/index.tsx b/web-client/app/_components/AdvancedPrompt/index.tsx index 19270ef3f..168e784db 100644 --- a/web-client/app/_components/AdvancedPrompt/index.tsx +++ b/web-client/app/_components/AdvancedPrompt/index.tsx @@ -1,69 +1,29 @@ -"use client"; -import { useCallback } from "react"; -import Image from "next/image"; -import { useStore } from "@/_models/RootStore"; -import { observer } from "mobx-react-lite"; -import { MenuAdvancedPrompt } from "../MenuAdvancedPrompt"; -import { useForm } from "react-hook-form"; -import { useMutation } from "@apollo/client"; -import { CreateMessageDocument, CreateMessageMutation } from "@/graphql"; - -export const AdvancedPrompt: React.FC = observer(() => { - const { register, handleSubmit } = useForm(); - const { historyStore } = useStore(); - - const onAdvancedPrompt = useCallback(() => { - historyStore.toggleAdvancedPrompt(); - }, []); - - const [createMessageMutation] = useMutation( - CreateMessageDocument - ); - const onSubmit = (data: any) => { - historyStore.sendControlNetPrompt( - createMessageMutation, - data.prompt, - data.negativePrompt, - data.fileInput[0] - ); - }; - - return ( -
- -
- -
-
- - -
-
- ); -}); +import { MenuAdvancedPrompt } from "../MenuAdvancedPrompt"; +import { useForm } from "react-hook-form"; +import BasicPromptButton from "../BasicPromptButton"; +import PrimaryButton from "../PrimaryButton"; + +const AdvancedPrompt: React.FC = () => { + const { register, handleSubmit } = useForm(); + + const onSubmit = (data: any) => {}; + + return ( +
+ + +
+ handleSubmit(onSubmit)} + /> +
+ + ); +}; + +export default AdvancedPrompt; diff --git a/web-client/app/_components/AdvancedTextArea/index.tsx b/web-client/app/_components/AdvancedTextArea/index.tsx index 980efedac..26be021a1 100644 --- a/web-client/app/_components/AdvancedTextArea/index.tsx +++ b/web-client/app/_components/AdvancedTextArea/index.tsx @@ -1,27 +1,27 @@ -import { FieldValues, UseFormRegister } from "react-hook-form"; - -type Props = { - formId?: string; - height: number; - title: string; - placeholder: string; - register: UseFormRegister; -}; - -export const AdvancedTextArea: React.FC = ({ - formId = "", - height, - placeholder, - title, - register, -}) => ( -
- -