Now that our form is looking pretty good we need to make sure that the submit button gets wired up to
an action creator to create our post.
We also need to make sure that we have a button on here to cancel the creation of a new post as well.
Let's take care of the easier task for right now and we'll say that we want to show a button on here
to allow the user to navigate back to our list of all posts.
So I want to have the ability to easily go to add a post and then click cancel and go back to the big
list.
Now we've already taken care of navigation between components already.
Remember that we use the link tag from re-act router on the outpost button up here.
And so in practice we're going to do the exact same thing again.
Remember whenever you want to navigate a user between different pages or different sets of components
inside of your application you want to be looking for that link tag.
So let's flip back over to our post new component at the top will.
Imports are linked tag from re-act router Daang then we'll place our link tag inside of the render function
we'll put it right underneath the button right here.
So say link whenever someone clicks this we want to go to our route route.
I'll give it a class name of between.
And I think that it would be kind of appropriate to make this thing read to make people understand yeah
if you click this it's going to cancel so as to be in danger on there as well.
And we can say cancel and that's pretty much it.
So let's flip back over refresh the page.
And now when I click Cancel great we can navigate between the two lists.
So this is looking good.
The last thing I think would be really nice is if there was some space between these two buttons right
now they're really sandwiched together.
And so it will look it will look much nicer if we put in a little bit margin left on here.
You know just to get a little bit of space like that.
So to handle that we can use a little bit of CSSA.
I mean if flip back to my code editor and there's two ways that we can add in some CSSA to this project.
We can either add a style rule directly to this link tag or we can open up the style directory inside
of the project and find the style dot CSSA file.
I think this time around since we only have one rule let's just put it inside the style that CSSA file
and just be done with it.
So we'll say look for a anchored tag that exists inside of a form element.
So this is going to select that button that was just created.
I will give it margin left of 5 pixels.
I'm using an anchor tag right here.
Remember that the link tags that we use do end up as rendering as a anchored tag and actually show up
on the screen.
OK.
So let's do one more test.
And know there we go.
Got some nice spacing in there.
OK.
So now he can navigate all around our application.
That means the last thing we need to do is wire up the submit button right here so that whenever a user
presses it it will submit and create this new blog post.
So let's take care of that in the next section.