import { useEffect } from 'react' import { useDispatch } from 'react-redux' import Subtitle from '../../../components/Typography/Subtitle' import { setPageTitle, showNotification } from '../../common/headerSlice' function FeaturesContent(){ const dispatch = useDispatch() return( <>

Features

{/* Authentication*/}

Authentication

JWT based Authentication logic is present in /app/auth.js. In the file you can see we are adding bearer token in header for every request. Every routes under /routes/ folder will need authentication. For public routes like login, register you will have to add routes in App.js file and also include the path in PUBLIC_ROUTES variable under /app/auth.js file so that auto redirect to login page is not triggered.

{/* Left Sidebar*/}

Left Sidebar

This is main internal navigation (for pages that will come after login only), all sidebar menu items with their icons are present in /routes/sidebar.js file, while path and page components mapping are respectively present in /routes/index.js file.

{/* Add New Page*/}

Add New Page

All public routes are present in App.js file. Steps to add new public page -

All protected routes are present in /routes/sidebar.js file

{/* Right Sidebar*/}

Right Sidebar

This is used for showing long list contents like notifications, settings etc.. We are using redux to show and hide and it is single component and can be called from any file with dispatch method. To add new content follow following steps:
{/* Themes*/}

Themes

By default we have added light and dark theme and Daisy UI comes with a number of themes, which you can use with no extra effort, you just have to include it in tailwind.config.js file, you can add themes like cupcake, corporate, reto etc... Also we can configure themes colors in config file, for more documentation on themes checkout Daisy UI documentation.

{/* Modal*/}

Modal

With global modal functionality you dont have to create seperate modal for each page. We are using redux to show and hide and it is a single component and can be called from any file with dispatch method. Code for showing modal is present in modalSlice and layout container component. To show modal just call openModal() function of modalSlice using dispatch.
To add new modal in any page follow following steps:
{/* Notification*/}

Notification

Many times we have to show notification to user be it on successfull form submission or any api success. And requirement can come to show notification from any page, so global notification handling is needed.

Code for showing notification is present in headerSlice and layout container component. To show notification just call showNotification() function of headerSlice using dispatch. To show success message notification pass status as 1 and for showing error message pass status as 0.

{'import { useDispatch } from "react-redux"\n  const dispatch = useDispatch()\n  dispatch(showNotification({message : "Message here", status : 1}))'}

Click on this button to check

) } export default FeaturesContent