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 - Sophia #37

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Wave 2
SoCodeDo committed Jan 8, 2021
commit 86f7b2f2932d80766f2f5c7c2292cd7f6b500dfa
10 changes: 10 additions & 0 deletions src/components/FinalPoem.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,21 @@ import './FinalPoem.css';

const FinalPoem = (props) => {
console.log(props.poemList)
// props.poemList.forEach((line) => {
// return ( <h3> {line} </h3>)
// })

//figure out how to render this one line at a time

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

{props.poemList.forEach((line) => {
return ( <h3> {line} </h3>)
})}

</section>

<div className="FinalPoem__reveal-btn-container">
8 changes: 5 additions & 3 deletions src/components/Game.js
Original file line number Diff line number Diff line change
@@ -17,15 +17,17 @@ const Game = () => {
const [player, setPlayer] = useState(1);

const addPoem = (poem) => {
const newPoemsList = [...poemList];
let newPoemsList = [...poemList];

newPoemsList.push(poem);
setPlayer(player + 1)

setPoemList(newPoemsList);
};

// console.log(poemList);
const poemListString = poemList.map((obj) => {
return `The ${obj.adj1} ${obj.noun1} ${obj.adv} ${obj.verb} the ${obj.adj2} ${obj.noun2} .`
})

return (
<div className='Game'>
@@ -43,7 +45,7 @@ const Game = () => {

<PlayerSubmissionForm fields={FIELDS} onSubmitCallBack={addPoem} player={player}/>

<FinalPoem poemList={poemList}/>
<FinalPoem poemList={poemListString}/>

</div>
);
1 change: 0 additions & 1 deletion src/components/PlayerSubmissionForm.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@ const PlayerSubmissionForm = () => {

const onUserInputChange = (event) => {
const { name, value } = event.target;

const newPoem = {
...poem,
};
2 changes: 1 addition & 1 deletion src/components/RecentSubmission.test.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { render, screen } from '@testing-library/react';
import RecentSubmission from './RecentSubmission';


describe.skip('Wave 2: RecentSubmission', () => {
describe('Wave 2: RecentSubmission', () => {
test('It renders with a submission and shows the text', () => {
// Act
render(<RecentSubmission submission={'This is a submission'} />);