Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop nel #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.4.0",
"bootstrap": "^5.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"reactstrap": "^9.2.0",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
name="description"
content="Web site created using create-react-app"
/>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 4 additions & 0 deletions public/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body{
box-sizing: border-box;
margin: 0;
}
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Home } from "./screens/Home";
import { Home } from "./screens/Home/Home";

function App() {
return (
<div className="App">
Expand Down
7 changes: 7 additions & 0 deletions src/components/Chatting/Chatting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function Chatting(props){
return(
<div>
Aqui vamos a poner los prompts y los resultados
</div>
)
}
72 changes: 51 additions & 21 deletions src/components/Prompt/Prompt.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
import { useState, useEffect } from "react";
export function Prompt(){
import { useState, useEffect, useContext } from "react";
import useChat from "../../hooks/useChat";
import { Button } from "reactstrap";
import axios from "axios";

import './styles.css'

export function Prompt(){
const {chat, addChat} = useChat()
const [userPrompt, setUserPrompt] = useState("")
useEffect(
() => {
console.log(userPrompt)
},
[userPrompt]
)
// useEffect(
// () => {
// },
// [userPrompt])

const submitPrompt = async (e) => {
e.preventDefault()
const req = await axios.get(
`http://127.0.0.1:5000/api/v1/guru-pront?client-question=${userPrompt}`,
)
addChat(req.data)
}
return(
<form>
<div>
<label>Cuentanos sobre tu expectativa en el mercado de pases</label>
</div>
<div>
<input
type="text"
value={userPrompt}
onChange={(e) => setUserPrompt(e.target.value)}
placeholder="Describe la posicion que quieres reforzar en tu equipo y tu presupuesto"
/>
</div>
</form>
<div
className="prompt-container"
>
<form
className="form__prompt-container"
onSubmit={submitPrompt}
>
<div>
<label>
Describe que tipo de jugador buscas y el presupuesto disponible
</label>
</div>
<div>
<textarea
className="textarea__form"
rows={5}
type="text"
value={userPrompt}
onChange={(e) => setUserPrompt(e.target.value)}
placeholder="Describe que tipo de jugador buscas y el presupuesto disponible"
/>
<div
className="submit-container__form"
>
<Button>
Enviar
</Button>
</div>
</div>
</form>
</div>
)
}
18 changes: 18 additions & 0 deletions src/components/Prompt/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.prompt-container{
width: 100%;
background-color: #bfbfbf;
padding:3rem 0;
display: flex;
justify-content: center;
}
.form__prompt-container{
width: 60%;
}
.textarea__form{
display: block;
width: 100%;
}
.submit-container__form{
display: flex;
justify-content: flex-end;
}
Loading