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

Water @ Hanh Solo Exquisite React Submission #46

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated finalpoem
seattlefurby17 committed Jan 11, 2021
commit 3fc69ff410ef1b45527425830212d4e793fcc165
31 changes: 11 additions & 20 deletions src/components/FinalPoem.js
Original file line number Diff line number Diff line change
@@ -3,35 +3,26 @@ import PropTypes from 'prop-types';
import './FinalPoem.css';

const FinalPoem = (props) => {

Choose a reason for hiding this comment

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

Just a note that it looks like the tests are failing because you used different props like isRevealed instead of isSubmitted. That's why it looks like the tests are failing.


if (props.isRevealed) {
return (
<div className="FinalPoem">
<section className="FinalPoem__poem">
<h3>Final Poem</h3>
</section>

<div className="FinalPoem__reveal-btn-container">
<input
type="button" value="We are finished: Reveal the Poem"
className="FinalPoem__reveal-btn"
onClick={ props.revealPoem }
/>
<div>
{(props.submissions).map((string, index) => (
<p key={index}>
{string}
</p>
))}
</div>
</div>
<div>
{(props.submissions).map((string, index) => (
<p key={index}>
{string}
</p>
))}
</div>
</div>
)}
else {
)

} else {
return(
<div className="FinalPoem">
<section className="FinalPoem__poem">
<h3>Final Poem</h3>
</section>
<div className="FinalPoem__reveal-btn-container">
<input
type="button" value="We are finished: Reveal the Poem"
1 change: 0 additions & 1 deletion src/components/PlayerSubmissionForm.js
Original file line number Diff line number Diff line change
@@ -43,7 +43,6 @@ const PlayerSubmissionForm = (props) => {
updateWords(setInitialState());
};


return (
<div className="PlayerSubmissionForm">
<h3>Player Submission Form for Player # { props.index }</h3>

Choose a reason for hiding this comment

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

This will cause all the tests in Game.test.js to pass.

Suggested change
<h3>Player Submission Form for Player # { props.index }</h3>
<h3>Player Submission Form for Player #{ props.index }</h3>

18 changes: 11 additions & 7 deletions src/components/RecentSubmission.js
Original file line number Diff line number Diff line change
@@ -3,13 +3,17 @@ import PropTypes from 'prop-types';
import './RecentSubmission.css';

const RecentSubmission = (props) => {

Choose a reason for hiding this comment

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

Just to note the tests for this component are passing, so you didn't need to skip them.

return (
<div className="RecentSubmission">
<h3>The Most Recent Submission</h3>
<p className="RecentSubmission__submission">{ props.submission }</p>
</div>
);
}
if (props.submission) {
return (
<div className="RecentSubmission">
<h3>The Most Recent Submission</h3>
<p className="RecentSubmission__submission">{ props.submission }</p>
</div>
);
} else {
return (null)
}
};

RecentSubmission.propTypes = {
submission: PropTypes.string.isRequired,
46 changes: 46 additions & 0 deletions src/components/finalpoemtest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const FinalPoem = (props) => {

Choose a reason for hiding this comment

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

I'm not sure what this file is for.


if (props.isRevealed) {

//event handler
const showButton= (event) => {

return (
<div className="FinalPoem">
<section className="FinalPoem__poem">
<h3>Final Poem</h3>
</section>

<div className="FinalPoem__reveal-btn-container">
<input
type="button" value="We are finished: Reveal the Poem"
className="FinalPoem__reveal-btn"
onClick={ props.revealPoem }
/>
<section>
{(props.submissions).map((string, index) => (
<p key={index}>
{string}
</p>
))}
</section>
</div>
</div>
)}
else {
return(
<div className="FinalPoem">
<section className="FinalPoem__poem">
<h3>Final Poem</h3>
</section>

<div className="FinalPoem__reveal-btn-container">
<input
type="button" value="We are finished: Reveal the Poem"
className="FinalPoem__reveal-btn"
onClick={ props.revealPoem }
/>
</div>
</div>
)}
};