Creating some blank pages

Let's create blank pages for signing in, asking a question, viewing search results, and viewing a question with its answers by carrying out the following steps:

  1. Create a file called SignInPage.tsx with the following content:
import React from 'react';
import { Page } from './Page';

export const SignInPage = () => <Page title="Sign In" />;

Here, we have used the Page component we created in the previous chapter to create an empty page that has the title Sign In. We are going to use a similar approach for the other pages we need to create.

  1. Create a file called AskPage.tsx with the following content:
import React from 'react';
import { Page } from './Page';

export const AskPage = () => <Page title="Ask a question" />;
  1. Create a file called SearchPage.tsx with the following content:
import React from 'react';
import { Page } from './Page';

export const SearchPage = () => <Page title="Search Results" />;
  1. Create a file called QuestionPage.tsx with the following content:
import React from 'react';
import { Page } from './Page';

export const QuestionPage = () => <Page>Question Page</Page>;

The title on the question page is going to be styled differently, which is why we are not using the title prop on the Page component. We have simply added some text on the page for the time being so that we can distinguish this page from the other pages. 

So, that's our pages created. Now, it's time to define all the routes to these pages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.38.219