TheStanfordDaily / stanforddaily-mobile

Breaking news from the Farm right on your phone!
https://stanforddaily.com/mobile-app
9 stars 10 forks source link

Add Sports section to the home screen #282

Closed MatthewTurk247 closed 2 years ago

MatthewTurk247 commented 4 years ago

We will be using React Native components to modify the Headlines.js file located in the screens folder. You can access the code by using in git clone -b dev https://github.com/TheStanfordDaily/stanforddaily-mobile.git the terminal. To add Sports to the home screen, follow these steps:

  1. Add a CardRow directly below the Opinions section and directly above Arts & Life.
  2. Set data={allArticles['sports']}.
  3. Set renderItem={_renderCardRow}
  4. Set title={"Sports"}
  5. Close the component with />.

If you have a different vision for how the Sports section should look, try a FlatList, or feel free to come up with your own reusable component. Remember to send the changes to the repository. If you experience any difficulties with that, try this tutorial.