Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
lauracc97 committed Mar 10, 2024
1 parent 63f6838 commit a46d6c6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 292 deletions.
297 changes: 6 additions & 291 deletions package-lock.json

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

22 changes: 22 additions & 0 deletions webapp/package-lock.json

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

21 changes: 20 additions & 1 deletion webapp/src/components/Game.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React, { useState } from 'react';
import { Container, styled } from '@mui/system';
import Grid from '@mui/material/Grid';
import axios from 'axios';



const StyledContainer = styled(Container)({
textAlign: 'center',
Expand All @@ -14,11 +17,27 @@ const StyledContainer = styled(Container)({


});

const apiEndpoint = 'http://localhost:8005';



const Game = () => {
const [error, setError] = useState('');
const [pregunta, setPregunta] = useState('');
const addPregunta = async () => {

try {
const p = await axios.post(`${apiEndpoint}/randomQuest`, { });
setPregunta(p.data);
} catch (error) {
setError(error.response.data.error);
}
};
addPregunta().then(console.log("hi" + pregunta) );
return (
<StyledContainer>
<h1>Pregunta</h1>
<h1></h1>
<Grid container spacing={2}>
<Grid item xs={12} sm={6}>
<StyledButton>1</StyledButton>
Expand Down

0 comments on commit a46d6c6

Please sign in to comment.