├── .env
├── .env.template
├── public
├── robots.txt
├── logo.jpg
├── intro.png
├── favicon.ico
├── logo192.png
├── logo512.png
├── favicon-16x16.png
├── favicon-32x32.png
├── apple-touch-icon.png
├── android-chrome-192x192.png
├── android-chrome-512x512.png
├── manifest.json
└── index.html
├── postcss.config.js
├── src
├── components
│ ├── Typography
│ │ ├── Title.js
│ │ ├── HelperText.js
│ │ ├── ErrorText.js
│ │ └── Subtitle.js
│ ├── CalendarView
│ │ ├── util.js
│ │ └── index.js
│ ├── Input
│ │ ├── SearchBar.js
│ │ ├── ToogleInput.js
│ │ ├── InputText.js
│ │ ├── TextAreaInput.js
│ │ └── SelectBox.js
│ └── Cards
│ │ └── TitleCard.js
├── containers
│ ├── SuspenseContent.js
│ ├── Layout.js
│ ├── ModalLayout.js
│ ├── SidebarSubmenu.js
│ ├── PageContent.js
│ ├── LeftSidebar.js
│ ├── RightSidebar.js
│ └── Header.js
├── setupTests.js
├── App.test.js
├── pages
│ ├── Login.js
│ ├── Register.js
│ ├── DocFeatures.js
│ ├── DocComponents.js
│ ├── GettingStarted.js
│ ├── ForgotPassword.js
│ ├── protected
│ │ ├── Leads.js
│ │ ├── Charts.js
│ │ ├── Team.js
│ │ ├── Bills.js
│ │ ├── Calendar.js
│ │ ├── Dashboard.js
│ │ ├── Transactions.js
│ │ ├── Integration.js
│ │ ├── ProfileSettings.js
│ │ ├── 404.js
│ │ ├── Welcome.js
│ │ └── Blank.js
│ └── Documentation.js
├── reportWebVitals.js
├── utils
│ ├── globalConstantUtil.js
│ └── dummyData.js
├── app
│ ├── store.js
│ ├── init.js
│ └── auth.js
├── features
│ ├── common
│ │ ├── components
│ │ │ ├── NotificationBodyRightDrawer.js
│ │ │ └── ConfirmationModalBody.js
│ │ ├── rightDrawerSlice.js
│ │ ├── headerSlice.js
│ │ └── modalSlice.js
│ ├── calendar
│ │ ├── CalendarEventsBodyRightDrawer.js
│ │ └── index.js
│ ├── user
│ │ ├── components
│ │ │ └── TemplatePointers.js
│ │ ├── LandingIntro.js
│ │ ├── Login.js
│ │ ├── Register.js
│ │ └── ForgotPassword.js
│ ├── dashboard
│ │ ├── components
│ │ │ ├── AmountStats.js
│ │ │ ├── PageStats.js
│ │ │ ├── DashboardStats.js
│ │ │ ├── LineChart.js
│ │ │ ├── BarChart.js
│ │ │ ├── UserChannels.js
│ │ │ ├── DoughnutChart.js
│ │ │ └── DashboardTopBar.js
│ │ └── index.js
│ ├── documentation
│ │ ├── DocGettingStarted.js
│ │ ├── components
│ │ │ ├── DocComponentsNav.js
│ │ │ ├── FeaturesNav.js
│ │ │ ├── GettingStartedNav.js
│ │ │ ├── DocComponentsContent.js
│ │ │ ├── FeaturesContent.js
│ │ │ └── GettingStartedContent.js
│ │ ├── DocFeatures.js
│ │ └── DocComponents.js
│ ├── leads
│ │ ├── leadSlice.js
│ │ ├── components
│ │ │ └── AddLeadModalBody.js
│ │ └── index.js
│ ├── charts
│ │ ├── components
│ │ │ ├── LineChart.js
│ │ │ ├── BarChart.js
│ │ │ ├── ScatterChart.js
│ │ │ ├── StackBarChart.js
│ │ │ ├── DoughnutChart.js
│ │ │ └── PieChart.js
│ │ └── index.js
│ ├── settings
│ │ ├── profilesettings
│ │ │ └── index.js
│ │ ├── billing
│ │ │ └── index.js
│ │ └── team
│ │ │ └── index.js
│ ├── integration
│ │ └── index.js
│ └── transactions
│ │ └── index.js
├── App.css
├── index.css
├── index.js
├── App.js
├── routes
│ ├── index.js
│ └── sidebar.js
└── logo.svg
├── .gitignore
├── tailwind.config.js
├── LICENSE.md
├── package.json
└── README.md
/.env:
--------------------------------------------------------------------------------
1 | REACT_APP_BASE_URL=https://reqres.in/
2 |
--------------------------------------------------------------------------------
/.env.template:
--------------------------------------------------------------------------------
1 | REACT_APP_BASE_URL=https://reqres.in/
2 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/public/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/logo.jpg
--------------------------------------------------------------------------------
/public/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/intro.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/logo512.png
--------------------------------------------------------------------------------
/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/favicon-16x16.png
--------------------------------------------------------------------------------
/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/favicon-32x32.png
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 |
6 | },
7 | }
8 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/robbins23/daisyui-admin-dashboard-template/HEAD/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/src/components/Typography/Title.js:
--------------------------------------------------------------------------------
1 | function Title({className, children}){
2 | return(
3 |
{children}
4 | )
5 | }
6 |
7 | export default Title
--------------------------------------------------------------------------------
/src/components/Typography/HelperText.js:
--------------------------------------------------------------------------------
1 | function HelperText({className, children}){
2 | return(
3 | {children}
4 | )
5 | }
6 |
7 | export default HelperText
--------------------------------------------------------------------------------
/src/components/Typography/ErrorText.js:
--------------------------------------------------------------------------------
1 | function ErrorText({styleClass, children}){
2 | return(
3 | {children}
4 | )
5 | }
6 |
7 | export default ErrorText
--------------------------------------------------------------------------------
/src/components/Typography/Subtitle.js:
--------------------------------------------------------------------------------
1 | function Subtitle({styleClass, children}){
2 | return(
3 | {children}
4 | )
5 | }
6 |
7 | export default Subtitle
--------------------------------------------------------------------------------
/src/containers/SuspenseContent.js:
--------------------------------------------------------------------------------
1 | function SuspenseContent(){
2 | return(
3 |
4 | Loading...
5 |
6 | )
7 | }
8 |
9 | export default SuspenseContent
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/src/pages/Login.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import Login from '../features/user/Login'
4 |
5 | function ExternalPage(){
6 |
7 |
8 | return(
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default ExternalPage
--------------------------------------------------------------------------------
/src/pages/Register.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import Register from '../features/user/Register'
4 |
5 | function ExternalPage(){
6 |
7 |
8 | return(
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default ExternalPage
--------------------------------------------------------------------------------
/src/pages/DocFeatures.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import DocFeatures from '../features/documentation/DocFeatures'
4 |
5 | function ExternalPage(){
6 |
7 |
8 | return(
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default ExternalPage
--------------------------------------------------------------------------------
/src/pages/DocComponents.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import DocComponents from '../features/documentation/DocComponents'
4 |
5 | function ExternalPage(){
6 |
7 |
8 | return(
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default ExternalPage
--------------------------------------------------------------------------------
/src/pages/GettingStarted.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import DocGettingStarted from '../features/documentation/DocGettingStarted'
4 |
5 | function ExternalPage(){
6 |
7 |
8 | return(
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default ExternalPage
--------------------------------------------------------------------------------
/src/pages/ForgotPassword.js:
--------------------------------------------------------------------------------
1 | import {useState, useRef} from 'react'
2 | import {Link} from 'react-router-dom'
3 | import ForgotPassword from '../features/user/ForgotPassword'
4 | import Login from '../features/user/Login'
5 |
6 | function ExternalPage(){
7 |
8 |
9 | return(
10 |
11 |
12 |
13 | )
14 | }
15 |
16 | export default ExternalPage
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 | .env.development2.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | "./src/**/*.{js,jsx,ts,tsx}",
5 | "./node_modules/react-tailwindcss-datepicker/dist/index.esm.js"
6 | ],
7 | darkMode: ["class", '[data-theme="dark"]'],
8 | theme: {
9 | extend: {},
10 | },
11 | plugins: [require("@tailwindcss/typography"), require("daisyui")],
12 | daisyui: {
13 | themes: ["light", "dark"],
14 | },
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/pages/protected/Leads.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Leads from '../../features/leads'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Leads"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Charts.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import Charts from '../../features/charts'
4 | import { setPageTitle } from '../../features/common/headerSlice'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Analytics"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Team.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Team from '../../features/settings/team'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Team Members"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Bills.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Billing from '../../features/settings/billing'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Bills"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Calendar.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Calendar from '../../features/calendar'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Calendar"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/utils/globalConstantUtil.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = Object.freeze({
3 | MODAL_BODY_TYPES : {
4 | USER_DETAIL : "USER_DETAIL",
5 | LEAD_ADD_NEW : "LEAD_ADD_NEW",
6 | CONFIRMATION : "CONFIRMATION",
7 | DEFAULT : "",
8 | },
9 |
10 | RIGHT_DRAWER_TYPES : {
11 | NOTIFICATION : "NOTIFICATION",
12 | CALENDAR_EVENTS : "CALENDAR_EVENTS",
13 | },
14 |
15 | CONFIRMATION_MODAL_CLOSE_TYPES : {
16 | LEAD_DELETE : "LEAD_DELETE",
17 | },
18 | });
19 |
--------------------------------------------------------------------------------
/src/pages/protected/Dashboard.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Dashboard from '../../features/dashboard/index'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Dashboard"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Transactions.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Transactions from '../../features/transactions'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Transactions"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Integration.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import Integration from '../../features/integration'
5 |
6 | function InternalPage(){
7 |
8 | const dispatch = useDispatch()
9 |
10 | useEffect(() => {
11 | dispatch(setPageTitle({ title : "Integrations"}))
12 | }, [])
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/app/store.js:
--------------------------------------------------------------------------------
1 | import { configureStore } from '@reduxjs/toolkit'
2 | import headerSlice from '../features/common/headerSlice'
3 | import modalSlice from '../features/common/modalSlice'
4 | import rightDrawerSlice from '../features/common/rightDrawerSlice'
5 | import leadsSlice from '../features/leads/leadSlice'
6 |
7 | const combinedReducer = {
8 | header : headerSlice,
9 | rightDrawer : rightDrawerSlice,
10 | modal : modalSlice,
11 | lead : leadsSlice
12 | }
13 |
14 | export default configureStore({
15 | reducer: combinedReducer
16 | })
--------------------------------------------------------------------------------
/src/pages/protected/ProfileSettings.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import ProfileSettings from '../../features/settings/profilesettings'
5 |
6 | function InternalPage(){
7 | const dispatch = useDispatch()
8 |
9 | useEffect(() => {
10 | dispatch(setPageTitle({ title : "Settings"}))
11 | }, [])
12 |
13 |
14 | return(
15 |
16 | )
17 | }
18 |
19 | export default InternalPage
--------------------------------------------------------------------------------
/src/app/init.js:
--------------------------------------------------------------------------------
1 | import axios from "axios"
2 |
3 | const initializeApp = () => {
4 |
5 | // Setting base URL for all API request via axios
6 | axios.defaults.baseURL = process.env.REACT_APP_BASE_URL
7 |
8 |
9 | if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
10 | // dev code
11 |
12 |
13 |
14 | } else {
15 | // Prod build code
16 |
17 |
18 |
19 | // Removing console.log from prod
20 | console.log = () => {};
21 |
22 |
23 | // init analytics here
24 | }
25 |
26 | }
27 |
28 | export default initializeApp
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "DashWind",
3 | "name": "DashWind",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/src/components/CalendarView/util.js:
--------------------------------------------------------------------------------
1 | const moment = require("moment");
2 |
3 | module.exports = Object.freeze({
4 | CALENDAR_EVENT_STYLE : {
5 | "BLUE" : "bg-blue-200 dark:bg-blue-600 dark:text-blue-100",
6 | "GREEN" : "bg-green-200 dark:bg-green-600 dark:text-green-100",
7 | "PURPLE" : "bg-purple-200 dark:bg-purple-600 dark:text-purple-100",
8 | "ORANGE" : "bg-orange-200 dark:bg-orange-600 dark:text-orange-100",
9 | "PINK" : "bg-pink-200 dark:bg-pink-600 dark:text-pink-100",
10 | "MORE" : "hover:underline cursor-pointer font-medium "
11 | }
12 |
13 |
14 | });
15 |
--------------------------------------------------------------------------------
/src/features/common/components/NotificationBodyRightDrawer.js:
--------------------------------------------------------------------------------
1 | function NotificationBodyRightDrawer(){
2 | return(
3 | <>
4 | {
5 | [...Array(15)].map((_, i) => {
6 | return
7 | {i % 2 === 0 ? `Your sales has increased by 30% yesterday` : `Total likes for instagram post - New launch this week, has crossed 100k `}
8 |
9 | })
10 | }
11 | >
12 | )
13 | }
14 |
15 | export default NotificationBodyRightDrawer
--------------------------------------------------------------------------------
/src/features/calendar/CalendarEventsBodyRightDrawer.js:
--------------------------------------------------------------------------------
1 | import { CALENDAR_EVENT_STYLE } from "../../components/CalendarView/util"
2 |
3 | const THEME_BG = CALENDAR_EVENT_STYLE
4 |
5 | function CalendarEventsBodyRightDrawer({filteredEvents}){
6 | return(
7 | <>
8 | {
9 | filteredEvents.map((e, k) => {
10 | return
11 | {e.title}
12 |
13 | })
14 | }
15 | >
16 | )
17 | }
18 |
19 | export default CalendarEventsBodyRightDrawer
--------------------------------------------------------------------------------
/src/components/Input/SearchBar.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | import React, { useEffect } from 'react'
4 |
5 | function SearchBar({searchText, styleClass, placeholderText, setSearchText}) {
6 |
7 |
8 |
9 | const updateSearchInput = (value) => {
10 | setSearchText(value)
11 | }
12 |
13 | return (
14 |
15 |
16 | updateSearchInput(e.target.value)} className="input input-sm input-bordered w-full max-w-xs" />
17 |
18 |
19 | )
20 | }
21 |
22 | export default SearchBar
23 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | .loading-indicator:before {
6 | content: '';
7 | background: #00000080;
8 | position: fixed;
9 | width: 100%;
10 | height: 100%;
11 | top: 0;
12 | left: 0;
13 | z-index: 1000;
14 | }
15 |
16 | .loading-indicator:after {
17 | content: ' ';
18 | position: fixed;
19 | top: 40%;
20 | left: 45%;
21 | z-index: 10010;
22 | color:white;
23 | text-align:center;
24 | font-weight:bold;
25 | font-size:1.2rem;
26 | border: 16px solid #f3f3f3; /* Light grey */
27 | border-top: 16px solid #0474bf; /* Blue */
28 | border-radius: 50%;
29 | width: 120px;
30 | height: 120px;
31 | animation: spin 2s linear infinite;
32 | }
--------------------------------------------------------------------------------
/src/features/user/components/TemplatePointers.js:
--------------------------------------------------------------------------------
1 | function TemplatePointers(){
2 | return(
3 | <>
4 | Admin Dashboard Starter Kit
5 | ✓ Light/dark mode toggle
6 | ✓ Redux toolkit and other utility libraries configured
7 | ✓ Calendar, Modal, Sidebar components
8 | ✓ User-friendly documentation
9 | ✓ Daisy UI components, Tailwind CSS support
10 | >
11 | )
12 | }
13 |
14 | export default TemplatePointers
--------------------------------------------------------------------------------
/src/pages/protected/404.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import FaceFrownIcon from '@heroicons/react/24/solid/FaceFrownIcon'
5 |
6 | function InternalPage(){
7 |
8 | const dispatch = useDispatch()
9 |
10 | useEffect(() => {
11 | dispatch(setPageTitle({ title : ""}))
12 | }, [])
13 |
14 | return(
15 |
16 |
17 |
18 |
19 |
404 - Not Found
20 |
21 |
22 |
23 | )
24 | }
25 |
26 | export default InternalPage
--------------------------------------------------------------------------------
/src/components/Input/ToogleInput.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 |
4 | function ToogleInput({labelTitle, labelStyle, type, containerStyle, defaultValue, placeholder, updateFormValue, updateType}){
5 |
6 | const [value, setValue] = useState(defaultValue)
7 |
8 | const updateToogleValue = () => {
9 | setValue(!value)
10 | updateFormValue({updateType, value : !value})
11 | }
12 |
13 | return(
14 |
15 |
19 |
20 | )
21 | }
22 |
23 |
24 | export default ToogleInput
25 |
--------------------------------------------------------------------------------
/src/pages/protected/Welcome.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 | import {Link} from 'react-router-dom'
5 | import TemplatePointers from '../../features/user/components/TemplatePointers'
6 |
7 | function InternalPage(){
8 |
9 | const dispatch = useDispatch()
10 |
11 | useEffect(() => {
12 | dispatch(setPageTitle({ title : ""}))
13 | }, [])
14 |
15 | return(
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | )
25 | }
26 |
27 | export default InternalPage
--------------------------------------------------------------------------------
/src/pages/protected/Blank.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { useDispatch } from 'react-redux'
3 | import { setPageTitle } from '../../features/common/headerSlice'
4 |
5 | import DocumentIcon from '@heroicons/react/24/solid/DocumentIcon'
6 |
7 | function InternalPage(){
8 |
9 | const dispatch = useDispatch()
10 |
11 | useEffect(() => {
12 | dispatch(setPageTitle({ title : "Page Title"}))
13 | }, [])
14 |
15 | return(
16 |
17 |
18 |
19 |
20 |
Blank Page
21 |
22 |
23 |
24 | )
25 | }
26 |
27 | export default InternalPage
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Suspense } from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 | import store from './app/store'
7 | import { Provider } from 'react-redux'
8 | import SuspenseContent from './containers/SuspenseContent';
9 |
10 | const root = ReactDOM.createRoot(document.getElementById('root'));
11 | root.render(
12 | //
13 | }>
14 |
15 |
16 |
17 |
18 | //
19 | );
20 |
21 | // If you want to start measuring performance in your app, pass a function
22 | // to log results (for example: reportWebVitals(console.log))
23 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
24 | reportWebVitals();
25 |
--------------------------------------------------------------------------------
/src/components/Input/InputText.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 |
4 | function InputText({labelTitle, labelStyle, type, containerStyle, defaultValue, placeholder, updateFormValue, updateType}){
5 |
6 | const [value, setValue] = useState(defaultValue)
7 |
8 | const updateInputValue = (val) => {
9 | setValue(val)
10 | updateFormValue({updateType, value : val})
11 | }
12 |
13 | return(
14 |
15 |
18 | updateInputValue(e.target.value)}className="input input-bordered w-full " />
19 |
20 | )
21 | }
22 |
23 |
24 | export default InputText
--------------------------------------------------------------------------------
/src/components/Input/TextAreaInput.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 |
4 | function TextAreaInput({labelTitle, labelStyle, type, containerStyle, defaultValue, placeholder, updateFormValue, updateType}){
5 |
6 | const [value, setValue] = useState(defaultValue)
7 |
8 | const updateInputValue = (val) => {
9 | setValue(val)
10 | updateFormValue({updateType, value : val})
11 | }
12 |
13 | return(
14 |
15 |
18 |
19 |
20 | )
21 | }
22 |
23 |
24 | export default TextAreaInput
--------------------------------------------------------------------------------
/src/features/dashboard/components/AmountStats.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | function AmountStats({}){
4 | return(
5 |
6 |
7 |
Amount to be Collected
8 |
$25,600
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Cash in hand
16 |
$5,600
17 |
18 |
19 |
20 |
21 |
22 | )
23 | }
24 |
25 | export default AmountStats
--------------------------------------------------------------------------------
/src/features/user/LandingIntro.js:
--------------------------------------------------------------------------------
1 | import TemplatePointers from "./components/TemplatePointers"
2 |
3 |
4 |
5 | function LandingIntro(){
6 |
7 | return(
8 |
9 |
10 |
11 |
12 |
DashWind
13 |
14 |
15 |
16 | {/* Importing pointers component */}
17 |
18 |
19 |
20 |
21 |
22 |
23 | )
24 |
25 | }
26 |
27 | export default LandingIntro
--------------------------------------------------------------------------------
/src/features/dashboard/components/PageStats.js:
--------------------------------------------------------------------------------
1 | import HeartIcon from '@heroicons/react/24/outline/HeartIcon'
2 | import BoltIcon from '@heroicons/react/24/outline/BoltIcon'
3 |
4 |
5 | function PageStats({}){
6 | return(
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Total Likes
14 |
25.6K
15 |
21% more than last month
16 |
17 |
18 |
19 |
20 |
21 |
22 |
Page Views
23 |
2.6M
24 |
14% more than last month
25 |
26 |
27 | )
28 | }
29 |
30 | export default PageStats
--------------------------------------------------------------------------------
/src/components/Cards/TitleCard.js:
--------------------------------------------------------------------------------
1 | import Subtitle from "../Typography/Subtitle"
2 |
3 |
4 | function TitleCard({title, children, topMargin, TopSideButtons}){
5 | return(
6 |
7 |
8 | {/* Title for Card */}
9 |
10 | {title}
11 |
12 | {/* Top side button, show only if present */}
13 | {
14 | TopSideButtons && {TopSideButtons}
15 | }
16 |
17 |
18 |
19 |
20 | {/** Card Body */}
21 |
22 | {children}
23 |
24 |
25 |
26 | )
27 | }
28 |
29 |
30 | export default TitleCard
--------------------------------------------------------------------------------
/src/features/dashboard/components/DashboardStats.js:
--------------------------------------------------------------------------------
1 | function DashboardStats({title, icon, value, description, colorIndex}){
2 |
3 | const COLORS = ["primary", "primary"]
4 |
5 | const getDescStyle = () => {
6 | if(description.includes("↗︎"))return "font-bold text-green-700 dark:text-green-300"
7 | else if(description.includes("↙"))return "font-bold text-rose-500 dark:text-red-400"
8 | else return ""
9 | }
10 |
11 | return(
12 |
13 |
14 |
{icon}
15 |
{title}
16 |
{value}
17 |
{description}
18 |
19 |
20 | )
21 | }
22 |
23 | export default DashboardStats
--------------------------------------------------------------------------------
/src/features/common/rightDrawerSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice } from '@reduxjs/toolkit'
2 |
3 | export const rightDrawerSlice = createSlice({
4 | name: 'rightDrawer',
5 | initialState: {
6 | header: "", // current title state management
7 | isOpen : false, // right drawer state management for opening closing
8 | bodyType : "", // right drawer content management
9 | extraObject : {},
10 | },
11 | reducers: {
12 |
13 | openRightDrawer: (state, action) => {
14 | const {header, bodyType, extraObject} = action.payload
15 | state.isOpen = true
16 | state.bodyType = bodyType
17 | state.header = header
18 | state.extraObject = extraObject
19 | },
20 |
21 | closeRightDrawer: (state, action) => {
22 | state.isOpen = false
23 | state.bodyType = ""
24 | state.header = ""
25 | state.extraObject = {}
26 | },
27 |
28 | }
29 | })
30 |
31 | export const { openRightDrawer, closeRightDrawer } = rightDrawerSlice.actions
32 |
33 | export default rightDrawerSlice.reducer
--------------------------------------------------------------------------------
/src/features/common/headerSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice } from '@reduxjs/toolkit'
2 |
3 | export const headerSlice = createSlice({
4 | name: 'header',
5 | initialState: {
6 | pageTitle: "Home", // current page title state management
7 | noOfNotifications : 15, // no of unread notifications
8 | newNotificationMessage : "", // message of notification to be shown
9 | newNotificationStatus : 1, // to check the notification type - success/ error/ info
10 | },
11 | reducers: {
12 | setPageTitle: (state, action) => {
13 | state.pageTitle = action.payload.title
14 | },
15 |
16 |
17 | removeNotificationMessage: (state, action) => {
18 | state.newNotificationMessage = ""
19 | },
20 |
21 | showNotification: (state, action) => {
22 | state.newNotificationMessage = action.payload.message
23 | state.newNotificationStatus = action.payload.status
24 | },
25 | }
26 | })
27 |
28 | export const { setPageTitle, removeNotificationMessage, showNotification } = headerSlice.actions
29 |
30 | export default headerSlice.reducer
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Dashwind - Admin Dashboard Template
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/src/features/common/modalSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice } from '@reduxjs/toolkit'
2 |
3 | export const modalSlice = createSlice({
4 | name: 'modal',
5 | initialState: {
6 | title: "", // current title state management
7 | isOpen : false, // modal state management for opening closing
8 | bodyType : "", // modal content management
9 | size : "", // modal content management
10 | extraObject : {},
11 | },
12 | reducers: {
13 |
14 | openModal: (state, action) => {
15 | const {title, bodyType, extraObject, size} = action.payload
16 | state.isOpen = true
17 | state.bodyType = bodyType
18 | state.title = title
19 | state.size = size || 'md'
20 | state.extraObject = extraObject
21 | },
22 |
23 | closeModal: (state, action) => {
24 | state.isOpen = false
25 | state.bodyType = ""
26 | state.title = ""
27 | state.extraObject = {}
28 | },
29 |
30 | }
31 | })
32 |
33 | export const { openModal, closeModal } = modalSlice.actions
34 |
35 | export default modalSlice.reducer
--------------------------------------------------------------------------------
/src/features/documentation/DocGettingStarted.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from "react"
2 | import { useDispatch } from "react-redux"
3 | import TitleCard from "../../components/Cards/TitleCard"
4 | import { setPageTitle, showNotification } from "../common/headerSlice"
5 | import GettingStartedNav from "./components/GettingStartedNav"
6 | import ReadMe from "./components/GettingStartedContent"
7 | import GettingStartedContent from "./components/GettingStartedContent"
8 |
9 |
10 |
11 | function GettingStarted(){
12 |
13 | const dispatch = useDispatch()
14 |
15 | useEffect(() => {
16 | dispatch(setPageTitle({ title : "Documentation"}))
17 | }, [])
18 |
19 |
20 | return(
21 | <>
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | >
34 | )
35 | }
36 |
37 | export default GettingStarted
--------------------------------------------------------------------------------
/src/features/documentation/components/DocComponentsNav.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 | function DocComponentsNav({activeIndex}){
4 |
5 | const SECTION_NAVS = [
6 | {name : "Typography", isActive : activeIndex === 1 ? true : false},
7 | {name : "Form Input", isActive : false},
8 | {name : "Cards", isActive : false},
9 | ]
10 | const [navs, setNavs] = useState(SECTION_NAVS)
11 |
12 | const scrollToSection = (currentIndex) => {
13 | setNavs(navs.map((n, k) => {
14 | if(k === currentIndex)return {...n, isActive : true}
15 | else return {...n, isActive : false}
16 | }))
17 | document.getElementById('component'+(currentIndex+1)).scrollIntoView({behavior: 'smooth' })
18 | }
19 |
20 | return(
21 |
22 | - Components
23 |
24 | {
25 | navs.map((n, k) => {
26 | return(
27 | - scrollToSection(k)} className={n.isActive ? "bordered" : ""}>{n.name}
28 | )
29 | })
30 | }
31 |
32 | )
33 | }
34 |
35 | export default DocComponentsNav
--------------------------------------------------------------------------------
/src/features/leads/leadSlice.js:
--------------------------------------------------------------------------------
1 | import { createSlice, createAsyncThunk } from '@reduxjs/toolkit'
2 | import axios from 'axios'
3 |
4 |
5 |
6 | export const getLeadsContent = createAsyncThunk('/leads/content', async () => {
7 | const response = await axios.get('/api/users?page=2', {})
8 | return response.data;
9 | })
10 |
11 | export const leadsSlice = createSlice({
12 | name: 'leads',
13 | initialState: {
14 | isLoading: false,
15 | leads : []
16 | },
17 | reducers: {
18 |
19 |
20 | addNewLead: (state, action) => {
21 | let {newLeadObj} = action.payload
22 | state.leads = [...state.leads, newLeadObj]
23 | },
24 |
25 | deleteLead: (state, action) => {
26 | let {index} = action.payload
27 | state.leads.splice(index, 1)
28 | }
29 | },
30 |
31 | extraReducers: {
32 | [getLeadsContent.pending]: state => {
33 | state.isLoading = true
34 | },
35 | [getLeadsContent.fulfilled]: (state, action) => {
36 | state.leads = action.payload.data
37 | state.isLoading = false
38 | },
39 | [getLeadsContent.rejected]: state => {
40 | state.isLoading = false
41 | },
42 | }
43 | })
44 |
45 | export const { addNewLead, deleteLead } = leadsSlice.actions
46 |
47 | export default leadsSlice.reducer
--------------------------------------------------------------------------------
/src/features/documentation/DocFeatures.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from "react"
2 | import { useDispatch } from "react-redux"
3 | import TitleCard from "../../components/Cards/TitleCard"
4 | import { setPageTitle, showNotification } from "../common/headerSlice"
5 | import GettingStartedNav from "./components/GettingStartedNav"
6 | import ReadMe from "./components/GettingStartedContent"
7 | import GettingStartedContent from "./components/GettingStartedContent"
8 | import FeaturesNav from "./components/FeaturesNav"
9 | import FeaturesContent from "./components/FeaturesContent"
10 |
11 |
12 |
13 | function Features(){
14 |
15 | const dispatch = useDispatch()
16 |
17 | useEffect(() => {
18 | dispatch(setPageTitle({ title : "Documentation"}))
19 | }, [])
20 |
21 |
22 | return(
23 | <>
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | >
36 | )
37 | }
38 |
39 | export default Features
--------------------------------------------------------------------------------
/src/features/charts/components/LineChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | CategoryScale,
4 | LinearScale,
5 | PointElement,
6 | LineElement,
7 | Title,
8 | Tooltip,
9 | Filler,
10 | Legend,
11 | } from 'chart.js';
12 | import { Line } from 'react-chartjs-2';
13 | import TitleCard from '../../../components/Cards/TitleCard';
14 |
15 | ChartJS.register(
16 | CategoryScale,
17 | LinearScale,
18 | PointElement,
19 | LineElement,
20 | Title,
21 | Tooltip,
22 | Filler,
23 | Legend
24 | );
25 |
26 | function LineChart(){
27 |
28 | const options = {
29 | responsive: true,
30 | plugins: {
31 | legend: {
32 | position: 'top',
33 | },
34 | },
35 | };
36 |
37 |
38 | const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
39 |
40 | const data = {
41 | labels,
42 | datasets: [
43 | {
44 | fill: true,
45 | label: 'MAU',
46 | data: labels.map(() => { return Math.random() * 100 + 500 }),
47 | borderColor: 'rgb(53, 162, 235)',
48 | backgroundColor: 'rgba(53, 162, 235, 0.5)',
49 | },
50 | ],
51 | };
52 |
53 |
54 | return(
55 |
56 |
57 |
58 | )
59 | }
60 |
61 |
62 | export default LineChart
--------------------------------------------------------------------------------
/src/features/dashboard/components/LineChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | CategoryScale,
4 | LinearScale,
5 | PointElement,
6 | LineElement,
7 | Title,
8 | Tooltip,
9 | Filler,
10 | Legend,
11 | } from 'chart.js';
12 | import { Line } from 'react-chartjs-2';
13 | import TitleCard from '../../../components/Cards/TitleCard';
14 |
15 | ChartJS.register(
16 | CategoryScale,
17 | LinearScale,
18 | PointElement,
19 | LineElement,
20 | Title,
21 | Tooltip,
22 | Filler,
23 | Legend
24 | );
25 |
26 | function LineChart(){
27 |
28 | const options = {
29 | responsive: true,
30 | plugins: {
31 | legend: {
32 | position: 'top',
33 | },
34 | },
35 | };
36 |
37 |
38 | const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
39 |
40 | const data = {
41 | labels,
42 | datasets: [
43 | {
44 | fill: true,
45 | label: 'MAU',
46 | data: labels.map(() => { return Math.random() * 100 + 500 }),
47 | borderColor: 'rgb(53, 162, 235)',
48 | backgroundColor: 'rgba(53, 162, 235, 0.5)',
49 | },
50 | ],
51 | };
52 |
53 |
54 | return(
55 |
56 |
57 |
58 | )
59 | }
60 |
61 |
62 | export default LineChart
--------------------------------------------------------------------------------
/src/features/documentation/DocComponents.js:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from "react"
2 | import { useDispatch } from "react-redux"
3 | import TitleCard from "../../components/Cards/TitleCard"
4 | import { setPageTitle, showNotification } from "../common/headerSlice"
5 | import DocComponentsNav from "./components/DocComponentsNav"
6 | import ReadMe from "./components/GettingStartedContent"
7 | import DocComponentsContent from "./components/DocComponentsContent"
8 | import FeaturesNav from "./components/FeaturesNav"
9 | import FeaturesContent from "./components/FeaturesContent"
10 |
11 |
12 |
13 | function DocComponents(){
14 |
15 | const dispatch = useDispatch()
16 |
17 | useEffect(() => {
18 | dispatch(setPageTitle({ title : "Documentation"}))
19 | }, [])
20 |
21 |
22 | return(
23 | <>
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | >
36 | )
37 | }
38 |
39 | export default DocComponents
--------------------------------------------------------------------------------
/src/features/common/components/ConfirmationModalBody.js:
--------------------------------------------------------------------------------
1 | import {useDispatch, useSelector} from 'react-redux'
2 | import axios from 'axios'
3 | import { CONFIRMATION_MODAL_CLOSE_TYPES, MODAL_CLOSE_TYPES } from '../../../utils/globalConstantUtil'
4 | import { deleteLead } from '../../leads/leadSlice'
5 | import { showNotification } from '../headerSlice'
6 |
7 | function ConfirmationModalBody({ extraObject, closeModal}){
8 |
9 | const dispatch = useDispatch()
10 |
11 | const { message, type, _id, index} = extraObject
12 |
13 |
14 | const proceedWithYes = async() => {
15 | if(type === CONFIRMATION_MODAL_CLOSE_TYPES.LEAD_DELETE){
16 | // positive response, call api or dispatch redux function
17 | dispatch(deleteLead({index}))
18 | dispatch(showNotification({message : "Lead Deleted!", status : 1}))
19 | }
20 | closeModal()
21 | }
22 |
23 | return(
24 | <>
25 |
26 | {message}
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | >
37 | )
38 | }
39 |
40 | export default ConfirmationModalBody
--------------------------------------------------------------------------------
/src/features/dashboard/components/BarChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | CategoryScale,
4 | LinearScale,
5 | BarElement,
6 | Title,
7 | Tooltip,
8 | Legend,
9 | } from 'chart.js';
10 | import { Bar } from 'react-chartjs-2';
11 | import TitleCard from '../../../components/Cards/TitleCard';
12 |
13 | ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
14 |
15 | function BarChart(){
16 |
17 | const options = {
18 | responsive: true,
19 | plugins: {
20 | legend: {
21 | position: 'top',
22 | }
23 | },
24 | };
25 |
26 | const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
27 |
28 | const data = {
29 | labels,
30 | datasets: [
31 | {
32 | label: 'Store 1',
33 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
34 | backgroundColor: 'rgba(255, 99, 132, 1)',
35 | },
36 | {
37 | label: 'Store 2',
38 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
39 | backgroundColor: 'rgba(53, 162, 235, 1)',
40 | },
41 | ],
42 | };
43 |
44 | return(
45 |
46 |
47 |
48 |
49 | )
50 | }
51 |
52 |
53 | export default BarChart
--------------------------------------------------------------------------------
/src/features/charts/components/BarChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | CategoryScale,
4 | LinearScale,
5 | BarElement,
6 | Title,
7 | Tooltip,
8 | Legend,
9 | } from 'chart.js';
10 | import { Bar } from 'react-chartjs-2';
11 | import TitleCard from '../../../components/Cards/TitleCard';
12 |
13 | ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
14 |
15 | function BarChart(){
16 |
17 | const options = {
18 | responsive: true,
19 | plugins: {
20 | legend: {
21 | position: 'top',
22 | }
23 | },
24 | };
25 |
26 | const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
27 |
28 | const data = {
29 | labels,
30 | datasets: [
31 | {
32 | label: 'Store 1',
33 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
34 | backgroundColor: 'rgba(255, 99, 132, 1)',
35 | },
36 | {
37 | label: 'Store 2',
38 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
39 | backgroundColor: 'rgba(53, 162, 235, 1)',
40 | },
41 | ],
42 | };
43 |
44 | return(
45 |
46 |
47 |
48 |
49 | )
50 | }
51 |
52 |
53 | export default BarChart
--------------------------------------------------------------------------------
/src/app/auth.js:
--------------------------------------------------------------------------------
1 | import axios from "axios"
2 |
3 | const checkAuth = () => {
4 | /* Getting token value stored in localstorage, if token is not present we will open login page
5 | for all internal dashboard routes */
6 | const TOKEN = localStorage.getItem("token")
7 | const PUBLIC_ROUTES = ["login", "forgot-password", "register", "documentation"]
8 |
9 | const isPublicPage = PUBLIC_ROUTES.some( r => window.location.href.includes(r))
10 |
11 | if(!TOKEN && !isPublicPage){
12 | window.location.href = '/login'
13 | return;
14 | }else{
15 | axios.defaults.headers.common['Authorization'] = `Bearer ${TOKEN}`
16 |
17 | axios.interceptors.request.use(function (config) {
18 | // UPDATE: Add this code to show global loading indicator
19 | document.body.classList.add('loading-indicator');
20 | return config
21 | }, function (error) {
22 | return Promise.reject(error);
23 | });
24 |
25 | axios.interceptors.response.use(function (response) {
26 | // UPDATE: Add this code to hide global loading indicator
27 | document.body.classList.remove('loading-indicator');
28 | return response;
29 | }, function (error) {
30 | document.body.classList.remove('loading-indicator');
31 | return Promise.reject(error);
32 | });
33 | return TOKEN
34 | }
35 | }
36 |
37 | export default checkAuth
--------------------------------------------------------------------------------
/src/features/documentation/components/FeaturesNav.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 | function FeaturesNav({activeIndex}){
4 |
5 | const SECTION_NAVS = [
6 | {name : "Authentication", isActive : activeIndex === 1 ? true : false},
7 | {name : "Sidebar", isActive : false},
8 | {name : "Add New Page", isActive : false},
9 | {name : "Right sidebar", isActive : false},
10 | {name : "Themes", isActive : false},
11 | {name : "Modal", isActive : false},
12 | {name : "Notification", isActive : false},
13 | ]
14 | const [navs, setNavs] = useState(SECTION_NAVS)
15 |
16 | const scrollToSection = (currentIndex) => {
17 | setNavs(navs.map((n, k) => {
18 | if(k === currentIndex)return {...n, isActive : true}
19 | else return {...n, isActive : false}
20 | }))
21 | document.getElementById('feature'+(currentIndex+1)).scrollIntoView({behavior: 'smooth' })
22 | }
23 |
24 | return(
25 |
26 | - Features
27 |
28 | {
29 | navs.map((n, k) => {
30 | return(
31 | - scrollToSection(k)} className={n.isActive ? "bordered" : ""}>{n.name}
32 | )
33 | })
34 | }
35 |
36 | )
37 | }
38 |
39 | export default FeaturesNav
--------------------------------------------------------------------------------
/src/features/documentation/components/GettingStartedNav.js:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 | function GettingStartedNav({activeIndex}){
4 |
5 | const SECTION_NAVS = [
6 | {name : "Introduction", isActive : activeIndex === 1 ? true : false},
7 | {name : "How to Use", isActive : false},
8 | {name : "Tailwind CSS", isActive : false},
9 | {name : "Daisy UI", isActive : false},
10 | {name : "Chart JS", isActive : false},
11 | {name : "Redux Toolkit", isActive : false},
12 | {name : "Hero Icons", isActive : false},
13 | {name : "Project Structure", isActive : false},
14 | ]
15 | const [navs, setNavs] = useState(SECTION_NAVS)
16 |
17 | const scrollToSection = (currentIndex) => {
18 | setNavs(navs.map((n, k) => {
19 | if(k === currentIndex)return {...n, isActive : true}
20 | else return {...n, isActive : false}
21 | }))
22 | document.getElementById('getstarted'+(currentIndex+1)).scrollIntoView({behavior: 'smooth' })
23 | }
24 |
25 | return(
26 |
27 | - Getting Started
28 |
29 | {
30 | navs.map((n, k) => {
31 | return(
32 | - scrollToSection(k)} className={n.isActive ? "bordered" : ""}>{n.name}
33 | )
34 | })
35 | }
36 |
37 | )
38 | }
39 |
40 | export default GettingStartedNav
--------------------------------------------------------------------------------
/src/features/charts/components/ScatterChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | Filler,
4 | ArcElement,
5 | Tooltip,
6 | Legend,
7 | } from 'chart.js';
8 | import { Scatter } from 'react-chartjs-2';
9 | import TitleCard from '../../../components/Cards/TitleCard';
10 |
11 | ChartJS.register(ArcElement, Tooltip, Legend,
12 | Tooltip,
13 | Filler,
14 | Legend);
15 |
16 | function ScatterChart(){
17 |
18 | const options = {
19 | scales: {
20 | y: {
21 | beginAtZero: true,
22 | },
23 | },
24 | };
25 |
26 | const data = {
27 | datasets: [
28 | {
29 | label: 'Orders > 1k',
30 | data: Array.from({ length: 100 }, () => ({
31 | x: Math.random() * 11,
32 | y: Math.random() * 31,
33 | })),
34 | backgroundColor: 'rgba(255, 99, 132, 1)',
35 | },
36 | {
37 | label: 'Orders > 2K',
38 | data: Array.from({ length: 100 }, () => ({
39 | x: Math.random() * 12,
40 | y: Math.random() * 12,
41 | })),
42 | backgroundColor: 'rgba(0, 0, 255, 1)',
43 | },
44 | ],
45 | };
46 |
47 | return(
48 |
49 |
50 |
51 | )
52 | }
53 |
54 |
55 | export default ScatterChart
--------------------------------------------------------------------------------
/src/components/Input/SelectBox.js:
--------------------------------------------------------------------------------
1 |
2 | import axios from 'axios'
3 | import capitalize from 'capitalize-the-first-letter'
4 | import React, { useState, useEffect } from 'react'
5 | import InformationCircleIcon from '@heroicons/react/24/outline/InformationCircleIcon'
6 |
7 |
8 | function SelectBox(props){
9 |
10 | const {labelTitle, labelDescription, defaultValue, containerStyle, placeholder, labelStyle, options, updateType, updateFormValue} = props
11 |
12 | const [value, setValue] = useState(defaultValue || "")
13 |
14 |
15 | const updateValue = (newValue) =>{
16 | updateFormValue({updateType, value : newValue})
17 | setValue(newValue)
18 | }
19 |
20 |
21 | return (
22 |
23 |
28 |
29 |
37 |
38 | )
39 | }
40 |
41 | export default SelectBox
42 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { lazy, useEffect } from 'react'
2 | import './App.css';
3 | import { BrowserRouter as Router, Route, Routes, Navigate } from 'react-router-dom'
4 | import { themeChange } from 'theme-change'
5 | import checkAuth from './app/auth';
6 | import initializeApp from './app/init';
7 |
8 | // Importing pages
9 | const Layout = lazy(() => import('./containers/Layout'))
10 | const Login = lazy(() => import('./pages/Login'))
11 | const ForgotPassword = lazy(() => import('./pages/ForgotPassword'))
12 | const Register = lazy(() => import('./pages/Register'))
13 | const Documentation = lazy(() => import('./pages/Documentation'))
14 |
15 |
16 | // Initializing different libraries
17 | initializeApp()
18 |
19 |
20 | // Check for login and initialize axios
21 | const token = checkAuth()
22 |
23 |
24 | function App() {
25 |
26 | useEffect(() => {
27 | // 👆 daisy UI themes initialization
28 | themeChange(false)
29 | }, [])
30 |
31 |
32 | return (
33 | <>
34 |
35 |
36 | } />
37 | } />
38 | } />
39 | } />
40 |
41 | {/* Place new routes over this */}
42 | } />
43 |
44 | }/>
45 |
46 |
47 |
48 | >
49 | )
50 | }
51 |
52 | export default App
53 |
--------------------------------------------------------------------------------
/src/containers/Layout.js:
--------------------------------------------------------------------------------
1 | import PageContent from "./PageContent"
2 | import LeftSidebar from "./LeftSidebar"
3 | import { useSelector, useDispatch } from 'react-redux'
4 | import RightSidebar from './RightSidebar'
5 | import { useEffect } from "react"
6 | import { removeNotificationMessage } from "../features/common/headerSlice"
7 | import {NotificationContainer, NotificationManager} from 'react-notifications';
8 | import 'react-notifications/lib/notifications.css';
9 | import ModalLayout from "./ModalLayout"
10 |
11 | function Layout(){
12 | const dispatch = useDispatch()
13 | const {newNotificationMessage, newNotificationStatus} = useSelector(state => state.header)
14 |
15 |
16 | useEffect(() => {
17 | if(newNotificationMessage !== ""){
18 | if(newNotificationStatus === 1)NotificationManager.success(newNotificationMessage, 'Success')
19 | if(newNotificationStatus === 0)NotificationManager.error( newNotificationMessage, 'Error')
20 | dispatch(removeNotificationMessage())
21 | }
22 | }, [newNotificationMessage])
23 |
24 | return(
25 | <>
26 | { /* Left drawer - containing page content and side bar (always open) */ }
27 |
32 |
33 | { /* Right drawer - containing secondary content like notifications list etc.. */ }
34 |
35 |
36 |
37 | {/** Notification layout container */}
38 |
39 |
40 | {/* Modal layout container */}
41 |
42 |
43 | >
44 | )
45 | }
46 |
47 | export default Layout
--------------------------------------------------------------------------------
/src/features/calendar/index.js:
--------------------------------------------------------------------------------
1 | import { useState } from 'react'
2 | import CalendarView from '../../components/CalendarView'
3 | import moment from 'moment'
4 | import { CALENDAR_INITIAL_EVENTS } from '../../utils/dummyData'
5 | import { useDispatch } from 'react-redux'
6 | import { openRightDrawer } from '../common/rightDrawerSlice'
7 | import { RIGHT_DRAWER_TYPES } from '../../utils/globalConstantUtil'
8 | import { showNotification } from '../common/headerSlice'
9 |
10 |
11 |
12 | const INITIAL_EVENTS = CALENDAR_INITIAL_EVENTS
13 |
14 | function Calendar(){
15 |
16 | const dispatch = useDispatch()
17 |
18 | const [events, setEvents] = useState(INITIAL_EVENTS)
19 |
20 | // Add your own Add Event handler, like opening modal or random event addition
21 | // Format - {title :"", theme: "", startTime : "", endTime : ""}, typescript version comming soon :)
22 | const addNewEvent = (date) => {
23 | let randomEvent = INITIAL_EVENTS[Math.floor(Math.random() * 10)]
24 | let newEventObj = {title : randomEvent.title, theme : randomEvent.theme, startTime : moment(date).startOf('day'), endTime : moment(date).endOf('day')}
25 | setEvents([...events, newEventObj])
26 | dispatch(showNotification({message : "New Event Added!", status : 1}))
27 | }
28 |
29 | // Open all events of current day in sidebar
30 | const openDayDetail = ({filteredEvents, title}) => {
31 | dispatch(openRightDrawer({header : title, bodyType : RIGHT_DRAWER_TYPES.CALENDAR_EVENTS, extraObject : {filteredEvents}}))
32 | }
33 |
34 | return(
35 | <>
36 |
41 | >
42 | )
43 | }
44 |
45 | export default Calendar
--------------------------------------------------------------------------------
/src/containers/ModalLayout.js:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react'
2 | import { MODAL_BODY_TYPES } from '../utils/globalConstantUtil'
3 | import { useSelector, useDispatch } from 'react-redux'
4 | import { closeModal } from '../features/common/modalSlice'
5 | import AddLeadModalBody from '../features/leads/components/AddLeadModalBody'
6 | import ConfirmationModalBody from '../features/common/components/ConfirmationModalBody'
7 |
8 |
9 | function ModalLayout(){
10 |
11 |
12 | const {isOpen, bodyType, size, extraObject, title} = useSelector(state => state.modal)
13 | const dispatch = useDispatch()
14 |
15 | const close = (e) => {
16 | dispatch(closeModal(e))
17 | }
18 |
19 |
20 |
21 | return(
22 | <>
23 | {/* The button to open modal */}
24 |
25 | {/* Put this part before
31 |
32 |
33 |
43 | tag */}
26 |
27 |
28 |
29 |
{title}
30 |
31 |
32 | {/* Loading modal body according to different modal type */}
33 | {
34 | {
35 | [MODAL_BODY_TYPES.LEAD_ADD_NEW] :
,
36 | [MODAL_BODY_TYPES.CONFIRMATION] : ,
37 | [MODAL_BODY_TYPES.DEFAULT] :
38 | }[bodyType]
39 | }
40 |
41 |
42 | >
43 | )
44 | }
45 |
46 | export default ModalLayout
--------------------------------------------------------------------------------
/src/features/charts/components/StackBarChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | CategoryScale,
4 | LinearScale,
5 | BarElement,
6 | Title,
7 | Tooltip,
8 | Legend,
9 | } from 'chart.js';
10 | import { Bar } from 'react-chartjs-2';
11 | import TitleCard from '../../../components/Cards/TitleCard';
12 |
13 | ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
14 |
15 | function StackBarChart(){
16 |
17 | const options = {
18 | responsive: true,
19 | scales: {
20 | x: {
21 | stacked: true,
22 | },
23 | y: {
24 | stacked: true,
25 | },
26 | },
27 | };
28 |
29 | const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
30 |
31 | const data = {
32 | labels,
33 | datasets: [
34 | {
35 | label: 'Store 1',
36 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
37 | backgroundColor: 'rgba(255, 99, 132, 1)',
38 | },
39 | {
40 | label: 'Store 2',
41 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
42 | backgroundColor: 'rgba(53, 162, 235, 1)',
43 | },
44 | {
45 | label: 'Store 3',
46 | data: labels.map(() => { return Math.random() * 1000 + 500 }),
47 | backgroundColor: 'rgba(235, 162, 235, 1)',
48 | },
49 | ],
50 | };
51 |
52 | return(
53 |
54 |
55 |
56 |
57 | )
58 | }
59 |
60 |
61 | export default StackBarChart
--------------------------------------------------------------------------------
/src/features/dashboard/components/UserChannels.js:
--------------------------------------------------------------------------------
1 | import TitleCard from "../../../components/Cards/TitleCard"
2 |
3 | const userSourceData = [
4 | {source : "Facebook Ads", count : "26,345", conversionPercent : 10.2},
5 | {source : "Google Ads", count : "21,341", conversionPercent : 11.7},
6 | {source : "Instagram Ads", count : "34,379", conversionPercent : 12.4},
7 | {source : "Affiliates", count : "12,359", conversionPercent : 20.9},
8 | {source : "Organic", count : "10,345", conversionPercent : 10.3},
9 | ]
10 |
11 | function UserChannels(){
12 | return(
13 |
14 | {/** Table Data */}
15 |
16 |
17 |
18 |
19 | |
20 | Source |
21 | No of Users |
22 | Conversion |
23 |
24 |
25 |
26 | {
27 | userSourceData.map((u, k) => {
28 | return(
29 |
30 | | {k+1} |
31 | {u.source} |
32 | {u.count} |
33 | {`${u.conversionPercent}%`} |
34 |
35 | )
36 | })
37 | }
38 |
39 |
40 |
41 |
42 | )
43 | }
44 |
45 | export default UserChannels
--------------------------------------------------------------------------------
/src/pages/Documentation.js:
--------------------------------------------------------------------------------
1 | import {Link} from 'react-router-dom'
2 | import FeaturesNav from '../features/documentation/components/FeaturesNav'
3 | import GettingStartedContent from '../features/documentation/components/GettingStartedContent'
4 | import GettingStartedNav from '../features/documentation/components/GettingStartedNav'
5 | import Title from '../components/Typography/Title'
6 | import DocComponentsNav from '../features/documentation/components/DocComponentsNav'
7 | import FeaturesContent from '../features/documentation/components/FeaturesContent'
8 | import DocComponentsContent from '../features/documentation/components/DocComponentsContent'
9 |
10 | function Documentation(){
11 | return(
12 | <>
13 |
14 |
15 |
16 |
17 |
Dashwind
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | >
35 | )
36 | }
37 |
38 | export default Documentation
--------------------------------------------------------------------------------
/src/features/charts/index.js:
--------------------------------------------------------------------------------
1 | import LineChart from './components/LineChart'
2 | import BarChart from './components/BarChart'
3 | import DoughnutChart from './components/DoughnutChart'
4 | import PieChart from './components/PieChart'
5 | import ScatterChart from './components/ScatterChart'
6 | import StackBarChart from './components/StackBarChart'
7 | import Datepicker from "react-tailwindcss-datepicker";
8 | import { useState } from 'react'
9 |
10 |
11 |
12 |
13 | function Charts(){
14 |
15 | const [dateValue, setDateValue] = useState({
16 | startDate: new Date(),
17 | endDate: new Date()
18 | });
19 |
20 | const handleDatePickerValueChange = (newValue) => {
21 | console.log("newValue:", newValue);
22 | setDateValue(newValue);
23 | }
24 |
25 | return(
26 | <>
27 |
38 | {/** ---------------------- Different charts ------------------------- */}
39 |
40 |
41 |
42 |
43 |
44 |
45 |
49 |
50 |
51 |
52 |
53 |
54 | >
55 | )
56 | }
57 |
58 | export default Charts
--------------------------------------------------------------------------------
/src/features/charts/components/DoughnutChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | Filler,
4 | ArcElement,
5 | Title,
6 | Tooltip,
7 | Legend,
8 | } from 'chart.js';
9 | import { Doughnut } from 'react-chartjs-2';
10 | import TitleCard from '../../../components/Cards/TitleCard';
11 | import Subtitle from '../../../components/Typography/Subtitle';
12 |
13 | ChartJS.register(ArcElement, Tooltip, Legend,
14 | Tooltip,
15 | Filler,
16 | Legend);
17 |
18 | function DoughnutChart(){
19 |
20 | const options = {
21 | responsive: true,
22 | plugins: {
23 | legend: {
24 | position: 'top',
25 | },
26 | },
27 | };
28 |
29 | const labels = ['Electronics', 'Home Applicances', 'Beauty', 'Furniture', 'Watches', 'Apparel'];
30 |
31 | const data = {
32 | labels,
33 | datasets: [
34 | {
35 | label: '# of Orders',
36 | data: [122, 219, 30, 51, 82, 13],
37 | backgroundColor: [
38 | 'rgba(255, 99, 132, 0.8)',
39 | 'rgba(54, 162, 235, 0.8)',
40 | 'rgba(255, 206, 86, 0.8)',
41 | 'rgba(75, 192, 192, 0.8)',
42 | 'rgba(153, 102, 255, 0.8)',
43 | 'rgba(255, 159, 64, 0.8)',
44 | ],
45 | borderColor: [
46 | 'rgba(255, 99, 132, 1)',
47 | 'rgba(54, 162, 235, 1)',
48 | 'rgba(255, 206, 86, 1)',
49 | 'rgba(75, 192, 192, 1)',
50 | 'rgba(153, 102, 255, 1)',
51 | 'rgba(255, 159, 64, 1)',
52 | ],
53 | borderWidth: 1,
54 | }
55 | ],
56 | };
57 |
58 | return(
59 |
60 |
61 |
62 | )
63 | }
64 |
65 |
66 | export default DoughnutChart
--------------------------------------------------------------------------------
/src/features/dashboard/components/DoughnutChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | Filler,
4 | ArcElement,
5 | Title,
6 | Tooltip,
7 | Legend,
8 | } from 'chart.js';
9 | import { Doughnut } from 'react-chartjs-2';
10 | import TitleCard from '../../../components/Cards/TitleCard';
11 | import Subtitle from '../../../components/Typography/Subtitle';
12 |
13 | ChartJS.register(ArcElement, Tooltip, Legend,
14 | Tooltip,
15 | Filler,
16 | Legend);
17 |
18 | function DoughnutChart(){
19 |
20 | const options = {
21 | responsive: true,
22 | plugins: {
23 | legend: {
24 | position: 'top',
25 | },
26 | },
27 | };
28 |
29 | const labels = ['Electronics', 'Home Applicances', 'Beauty', 'Furniture', 'Watches', 'Apparel'];
30 |
31 | const data = {
32 | labels,
33 | datasets: [
34 | {
35 | label: '# of Orders',
36 | data: [122, 219, 30, 51, 82, 13],
37 | backgroundColor: [
38 | 'rgba(255, 99, 132, 0.8)',
39 | 'rgba(54, 162, 235, 0.8)',
40 | 'rgba(255, 206, 86, 0.8)',
41 | 'rgba(75, 192, 192, 0.8)',
42 | 'rgba(153, 102, 255, 0.8)',
43 | 'rgba(255, 159, 64, 0.8)',
44 | ],
45 | borderColor: [
46 | 'rgba(255, 99, 132, 1)',
47 | 'rgba(54, 162, 235, 1)',
48 | 'rgba(255, 206, 86, 1)',
49 | 'rgba(75, 192, 192, 1)',
50 | 'rgba(153, 102, 255, 1)',
51 | 'rgba(255, 159, 64, 1)',
52 | ],
53 | borderWidth: 1,
54 | }
55 | ],
56 | };
57 |
58 | return(
59 |
60 |
61 |
62 | )
63 | }
64 |
65 |
66 | export default DoughnutChart
--------------------------------------------------------------------------------
/src/containers/SidebarSubmenu.js:
--------------------------------------------------------------------------------
1 | import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon'
2 | import {useEffect, useState} from 'react'
3 | import { Link, useLocation } from 'react-router-dom'
4 |
5 |
6 | function SidebarSubmenu({submenu, name, icon}){
7 | const location = useLocation()
8 | const [isExpanded, setIsExpanded] = useState(false)
9 |
10 |
11 | /** Open Submenu list if path found in routes, this is for directly loading submenu routes first time */
12 | useEffect(() => {
13 | if(submenu.filter(m => {return m.path === location.pathname})[0])setIsExpanded(true)
14 | }, [])
15 |
16 | return (
17 |
18 |
19 | {/** Route header */}
20 |
setIsExpanded(!isExpanded)}>
21 | {icon} {name}
22 |
23 |
24 |
25 | {/** Submenu list */}
26 |
27 |
28 | {
29 | submenu.map((m, k) => {
30 | return(
31 | -
32 |
33 | {m.icon} {m.name}
34 | {
35 | location.pathname == m.path ? () : null
37 | }
38 |
39 |
40 | )
41 | })
42 | }
43 |
44 |
45 |
46 | )
47 | }
48 |
49 | export default SidebarSubmenu
--------------------------------------------------------------------------------
/src/features/charts/components/PieChart.js:
--------------------------------------------------------------------------------
1 | import {
2 | Chart as ChartJS,
3 | Filler,
4 | ArcElement,
5 | Title,
6 | Tooltip,
7 | Legend,
8 | } from 'chart.js';
9 | import { Pie } from 'react-chartjs-2';
10 | import TitleCard from '../../../components/Cards/TitleCard';
11 | import Subtitle from '../../../components/Typography/Subtitle';
12 |
13 | ChartJS.register(ArcElement, Tooltip, Legend,
14 | Tooltip,
15 | Filler,
16 | Legend);
17 |
18 | function PieChart(){
19 |
20 | const options = {
21 | responsive: true,
22 | plugins: {
23 | legend: {
24 | position: 'top',
25 | },
26 | },
27 | };
28 |
29 | const labels = ['India', 'Middle East', 'Europe', 'US', 'Latin America', 'Asia(non-india)'];
30 |
31 | const data = {
32 | labels,
33 | datasets: [
34 | {
35 | label: '# of Orders',
36 | data: [122, 219, 30, 51, 82, 13],
37 | backgroundColor: [
38 | 'rgba(255, 99, 255, 0.8)',
39 | 'rgba(54, 162, 235, 0.8)',
40 | 'rgba(255, 206, 255, 0.8)',
41 | 'rgba(75, 192, 255, 0.8)',
42 | 'rgba(153, 102, 255, 0.8)',
43 | 'rgba(255, 159, 255, 0.8)',
44 | ],
45 | borderColor: [
46 | 'rgba(255, 99, 255, 1)',
47 | 'rgba(54, 162, 235, 1)',
48 | 'rgba(255, 206, 255, 1)',
49 | 'rgba(75, 192, 255, 1)',
50 | 'rgba(153, 102, 255, 1)',
51 | 'rgba(255, 159, 255, 1)',
52 | ],
53 | borderWidth: 1,
54 | }
55 | ],
56 | };
57 |
58 | return(
59 |
60 |
61 |
62 | )
63 | }
64 |
65 |
66 | export default PieChart
--------------------------------------------------------------------------------
/src/containers/PageContent.js:
--------------------------------------------------------------------------------
1 | import Header from "./Header"
2 | import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'
3 | import routes from '../routes'
4 | import { Suspense, lazy } from 'react'
5 | import SuspenseContent from "./SuspenseContent"
6 | import { useSelector } from 'react-redux'
7 | import { useEffect, useRef } from "react"
8 |
9 | const Page404 = lazy(() => import('../pages/protected/404'))
10 |
11 |
12 | function PageContent(){
13 | const mainContentRef = useRef(null);
14 | const {pageTitle} = useSelector(state => state.header)
15 |
16 |
17 | // Scroll back to top on new page load
18 | useEffect(() => {
19 | mainContentRef.current.scroll({
20 | top: 0,
21 | behavior: "smooth"
22 | });
23 | }, [pageTitle])
24 |
25 | return(
26 |
27 |
28 |
29 | }>
30 |
31 | {
32 | routes.map((route, key) => {
33 | return(
34 | }
39 | />
40 | )
41 | })
42 | }
43 |
44 | {/* Redirecting unknown url to 404 page */}
45 | } />
46 |
47 |
48 |
49 |
50 |
51 | )
52 | }
53 |
54 |
55 | export default PageContent
56 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 |
Daisy UI Admin Dashboard Template - DashWind
28 |
29 |
30 |
44 |