Create a New Page

-> Follow the below steps to create new page.

1. Create a new folder in src/pages. ex. NewPage, and then create a ts file in src/pages/NewPage with name Index.tsx file.

Layout Components
import React from 'react';
import { Container } from "reactstrap";

//Import Breadcrumb
import Breadcrumb from 'Components/Common/Breadcrumb';

    const NewPage = () => {
        //meta title
        document.title="New Page | Skote - React Admin & Dashboard Template";
        return (
            <>
                <div className="page-content">
                    <Container fluid>
                        <Breadcrumbs title="New Page" breadcrumbItem="New Page" />
                        {/* write Html code or structure */}
                    </Container>
                </div>
            </>
        );
    }

export default NewPage;
Without Layout Components
import React from 'react';
import { Container } from 'react-bootstrap';
                            
const AuthLogIn = () => {
    document.title = "Log In| Skote - Admin & Dashboard Template";
    return (
        <React.Fragment>
            <div>
                <Container>
                    // write the code here...
                </Container>
            </div>
        </React.Fragment>
    )
}
export default AuthLogIn;

2. Add your new page's route in src/Routes/allRoutes.tsx file.

  • Check the Routes section to see how to add routes to the web application.
  • if you want to create a page with blank layout, then add your page's routes in publicRoutes :-
  • import newPage from "../pages/AuthLogIn";
    
    const publicRoutes = [
        { path: "/auth-login", component: <AuthLogIn /> }                                          
    ]
    
  • if you want to create a page with full layout, then add your page's routes in authProtectedRoutes :-
  • import newPage from "../pages/NewPage/index";
    
    const authProtectedRoutes = [
        { path: "/index", component: <Index /> }                                          
    ]
    © Skote.