## "Game" of Thrones ![](https://media2.giphy.com/media/XOJYJNZWnaNQ4/giphy.gif?cid=ecf05e470b3eb144871efdb9da11a96414eb54dbf0c37733&rid=giphy.gif =500x) A quiz for fans --- ## Live Demo ## :warning: GOT is very NSFW! :warning: ![](https://media.giphy.com/media/l0MYDgjSpyzrKlBo4/giphy.gif =300x) Please avert your eyes if you are uncomfortable with extremely graphic language ! --- ### Planning - Quick decision, simple API - Very brief Miro - Comprehensive plan in hackMD - List of all components and props - Didn't need project board as only 2 - One issue per component - Few other issues --- ### Sketching up in Miro ![](https://i.imgur.com/JDCkkcO.png) Just to get started, not regarded as gospel. --- ### Planning components ```javascript= <GameBoard> state needed... question correctAnswer props required... difficulty updateScore <Question question={question}/> <Answers> difficulty={difficulty} correctAnswer={correctAnswer} /> </GameBoard> ``` --- ### Execution - Deployed early - Frequent driver swapping (aim for 15 mins) - Quick merges / no code review! - Jitsi proved better than zoom yesterday --- ### Things we're pleased with - Got to do some CSS this week! - Got a fully working product! - Created custom prettier config at start - Disabled other formatters so no in-fighting --- ## Expectations vs Reality (Tom) ![](https://media2.giphy.com/media/wLvhV2uZRg1OM/giphy.webp?cid=ecf05e4761c3201134e41238b613e389d3cde3f3849a2a96&rid=giphy.webp =400x) --- ## React (Also Tom!) ![](https://media0.giphy.com/media/KEPQfFa3CtzCE/100.webp?cid=ecf05e4761c3201134e41238b613e389d3cde3f3849a2a96&rid=100.webp =600x) --- ### Problems - Understanding where things should go - Understanding when things actually happen - DOM events behaving not as we expected - Adding/removing stuff in useEffect can be tricky to get right --- ### What we wish we could do better - More testing - Understand react flow better - We still have some non-idiomatic code - We're still not sure how to get rid of it! --- ### Code examples --- ## Using local images ```javascript= <img className="Answer__img" src={require( "../img/characters/" + props.thisAnswer.shortName + ".jpg")} alt="quiz answer button" /> ``` --- ## Turning SVG into a React component ```javascript= import React from "react"; function ComponentName(props) { return ( <svg fill={props.color} height={props.height} width={props.width} // svg code goes here /> ); } export default ComponentName; ``` --- The End! ![](https://static2.srcdn.com/wordpress/wp-content/uploads/2019/05/Game-of-Thrones-Ending-Explained.jpg) Thanks for watching.
{"metaMigratedAt":"2023-06-15T07:55:31.138Z","metaMigratedFrom":"Content","title":"Untitled","breaks":true,"contributors":"[{\"id\":\"0e4f99ec-9dff-4b8d-9f98-aa3f5444e9ce\",\"add\":1324,\"del\":230},{\"id\":\"89613c1e-a1b5-4e82-9c3e-7813a336c5a6\",\"add\":1765,\"del\":0}]"}
    182 views
   Owned this note