-
Notifications
You must be signed in to change notification settings - Fork 42
Adding a new page
You may find yourself needing to add a new page to Huxley! Let's talk about the steps to doing that:
-
Create a component that you want to be displayed. This doesn't have to be complete yet, and can start out with a copy of an existing component -- but it's useful to have a component to play with and be able to view as you make your changes!
-
Add the route to your component. Our frontend routing is done using React Router, and is all in Huxley.js. Import your component to the file and, depending on what user type you want your page displayed for, add its route next to the others. For example, if I wanted to add a new delegate page called
Rooms
, I might do that by adding the following lines of code at around line 208:<Route path="/delegate/rooms"> <DelegateRoomView /> </Route>
You should have a
Route
tag with thepath
parameter as the path you are trying to add your new page at; inside the tag should be the component you want to display at that page. -
Add a navigation tab to your new page. If you're adding a new delegate page, you should add a new navigation tab in
DelegateView
; for advisors, inAdvisorView
; and for chairs, inChairView
. -
Iterate on and finish your component. That's it! Just make sure the component you're using for your page is what you want it to be, and you're good to go!