-: Our user now gets redirected over
to the feature route after they successfully sign up.
But right now we're not showing anything on this page.
So in this section, I think we should put
in some kind of placeholder feature component
and then make sure that you are not able to visit it
unless you're actually signed into our application.
To get started, I'll flip back over
to my code editor,
and inside my components directory
I'm gonna make a new file called feature.js.
Now remember, the feature component really just
represents any component that you might want to have inside
of your application that you want to be locked down.
So there's nothing special
about calling this feature or anything like that.
Now, inside this component at the very top
I will import React and Component, from React
and I'll define class feature
which will extend component.
Inside there I'll define the render method.
I'll return a div,
with just something that says this is the feature
and then I will do an export default feature
at the bottom of the file.
We made this a class-based component
because we're going to eventually hook
up a lifecycle method to it to make sure
that anytime we show the feature component, we
will attempt to fetch some secret data
from our backend API.
But right now, let's just get this thing on the screen.
Once I've created this component, I'll then go into
my SRC index.js file,
where I will import that component.
So import feature from components feature
and then I'm going to create a new route
inside of my route listings.
So I'm gonna add a third route,
with a path of feature,
and anytime someone goes there
we'll show the feature component.
All right, so that looks good.
Quick test inside the browser,
there's the reload.
And, okay, very good.
So now we've got something to show here.
Let's continue in the next section.
And we're gonna think
about creating a middleware that's going to,
or some amount of middleware,
but a higher order component that's gonna lock
down users' access to this page right here
if they are not signed in.
So quick break and I'll see you in just a minute.