TenantVoice looks to empower tenants to enforce accountability, fostering a collaborative environment that promotes sustained housing quality improvements
In /frontend/src/pages create a new file called Home.jsx where posts from multiple users will be rendered in the /home endpoint. Create a component named HomePage with its own posts state to keep track of. It needs to import the adapter getAllPosts from ../adapters/post-adapter in order get data for and set state for posts. The logged-in user will be able to click to see all posts or click to see posts filtered by thecomplex name in their location.
Requirements
[ ] Home.jsx file
[ ] PostsPage component
[ ] Import useState hook to make state for users
[ ] Import useEffect hook to render all users
[ ] Import getAllPosts adapter
[ ] Return
[ ] h1 named "Feed"
[ ] Two buttons named [Housing Complex Name] Feed and NYCHA-Wide Feed
[ ] First button filters posts by complex of user's location
[ ] Second button shows all posts
[ ] A button that renders a modal for filling out a new post
[ ] If an invalid user clicks on it, navigate to /login
[ ] If a valid user clicks, render modal
[ ] ul that maps over posts
[ ] For post, generate a card with username, description, category, date, problem_duration, img, and upvotes
Context
In
/frontend/src/pages
create a new file calledHome.jsx
where posts from multiple users will be rendered in the/home
endpoint. Create a component namedHomePage
with its ownposts
state to keep track of. It needs to import the adaptergetAllPosts
from../adapters/post-adapter
in order get data for and set state forposts
. The logged-in user will be able to click to see all posts or click to see posts filtered by thecomplex
name in their location.Requirements
Home.jsx
filePostsPage
componentuseState
hook to make state for usersuseEffect
hook to render all usersgetAllPosts
adapterh1
named "Feed"[Housing Complex Name] Feed
andNYCHA-Wide Feed
complex
of user's location/login
ul
that maps overposts
post
, generate a card withusername
,description
,category
,date
,problem_duration
,img
, andupvotes