Ok, so bear with me here. I'm really new to react so if this question has been asked before and I'm just not looking in the right places, I apologize.
I have a react app that I'm building and I've setup from the ground up using a tutorial online which walks through creating a nav bar at the top of the page (this works fine) as it's listed within the App.js file before my router switch.
What I'm trying to do is create a nav on the left pane for a '/settings' page that will only be seen if the path is /settings/* for example
YOu'd see the nav bar up top, then click on settings in my profile menu, and see a nav list on the left side that shows things like "My Account" /settings/myaccount "My Profile" /settings/myprofile "Terms of Service" /settings/tos etc... When you click on each of these pages it'll open a new component /settings/myaccount /settings/myprofile /settings/tos etc...
I also want to make sure my nav is updated on the left side and shows the proper 'item' highlighted. I've heard things about 'lifting' state on this but not sure if that's what I need to do or how to even go about this properly.
My thought was to create some type of component for /settings and then have another route switch in there for myaccount, myprofile, tos, etc... and just display my nav at the top of this /settings component page. Is that a viable option and just have something in that particular component that holds a state of 'isSelected' and set a class to highlight the nav Item in question?
Current code for my Routes.js file
export default ({ childProps }) =>
<Switch>
<AppliedRoute path="/" exact component={Home} props={childProps} />
<AppliedRoute path="/login" exact component={Login} props={childProps} />
<AppliedRoute path="/signup" exact component={Signup} props={childProps} />
<AppliedRoute path="/settings" exact component={Settings} props={childProps} />
{ /* Finally, catch all unmatched routes */ }
<Route component={NotFound} />
</Switch>;
Code for my settings file which I want a nav in and routes to other pages
<Container>
<Row>
<Col lg="lg-2">
<Nav vertical pills>
<NavItem>
<NavLink href="/settings/gear">My Gear</NavLink>
</NavItem>
<NavItem>
<NavLink href="/settings/profile">My Gear</NavLink>
</NavItem>
</Nav>
</Col>
<Col xs = "lg-10">
<div className="Settings">
Settings Page!
<LoaderButton
style={{backgroundColor: "#fc4c02"}}
size="lg"
//disabled={!this.validateForm()}
type="submit"
//isLoading={this.state.isLoading}
text="Connect Strava"
loadingText="Logging in..."
icon={<FontAwesomeIcon icon={faStrava}/>}
onClick={this.handleSubmit}
>
</LoaderButton>
</div>
</Col>
</Row>
</Container>
I don't have the state part set or the routes setup yet within settings. Because I don't want to have to re-do the nav list in every single page