Skip to content

Conversation

BrunohSL
Copy link

No description provided.

src/App.js Outdated
name: 'teste4',
initiative: 2,
hp: 0,
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mandar sem os dados de teste.

const nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
while (characters[nextTurn].hp <= 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linha em branco a mais aqui

src/App.js Outdated
nextTurn += 1;

if (nextTurn >= characters.length - 1) {
nextTurn = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E se todo mundo estiver morto? É uma possibilidade? @victormiguez

const CharacterForm = ({ handleSubmit }) => (
<Formik
initialValues={{ name: '', initiative: '' }}
initialValues={{ name: '', initiative: '', hp: '' }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seta o valor inicial de iniciativa e hp aqui pra 0 pra fazer mais sentido. O campo só vai lidar com números.

src/App.js Outdated
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
while (characters[nextTurn].hp <= 0) {

nextTurn += 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aqui pode ser só nextTurn++

const nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
this.setState({ turn: nextTurn });
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
const teste = characters.filter((character) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colocar um nome mais descritivo pra essa const.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants