Bio and photo on author screen
MatthewTurk247 opened this issue · 1 comments
MatthewTurk247 commented
- Open a command-line shell.
- Clone the project to your local machine with
git clone https://github.com/TheStanfordDaily/stanforddaily-mobile.git -b dev
and open the folder with your text editor of choice. - Create a branch off
dev
calledauthor-bio
. - Navigate to
screens > Author.js
. - Import
Model
and collect relevant JSON. - Declare a React hook like so:
const [authorDetail, setAuthorDetail] = useState({})
. - Store JSON result with
setAuthorDetail
. - Add new component above
List
. It should be some kind of view withflex-direction: "row"
. - If an image is available, display it in the component.
- If a written bio is available, display it in the component.
Additional reading:
- Isomorphic library used in
Model.js
- Hooks
mhartenorio commented
Hi @MatthewTurk247! So sorry for the delay on starting this. I was able to get most of it done, but I have one problem I'm encountering. If there are two authors in an article, when you click the second author, what shows is the first author's bio and photo. I think I might not be understanding the Model data correctly, can you help me? Thanks so much!