11'use client'
2- import React , { useContext , useEffect } from 'react'
2+ import React , { useContext } from 'react'
33import styles from './dashboard.module.css' ;
4- import ThemeToggle from '@/components/themetoggle/ThemeToggle' ;
5- import Searchbar from '@/components/searchbar/Searchbar' ;
64import { ThemeContext } from '@/context/ThemeContext'
75import Card from '@/components/card/Card' ;
86import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
9- import { faCab , faClock , faComputer , faEarth , faFileAlt , faNewspaper , faStopwatch , faTv } from '@fortawesome/free-solid-svg-icons' ;
10- import RecentPosts from '@/components/recentposts/RecentPosts' ;
7+ import { faEarth , faNewspaper , faStopwatch , faTv } from '@fortawesome/free-solid-svg-icons' ;
118import PopularPosts from '@/components/popularposts/PopularPosts' ;
12-
13- import { PostPerformanceChart , GrowthRateChart , FeedbackChart , EngagementMetricsChart , ContentEngagementChart , TrafficOverviewChart } from '@/components/charts/Charts' ;
9+ import { PostPerformanceChart , GrowthRateChart , ContentEngagementChart , TrafficSourcesChart } from '@/components/charts/Charts' ;
1410import AdminCommentsSection from '@/components/admincommentssection/AdminCommentsSection' ;
15- import CommentSection from '@/components/commentsection/CommentSection' ;
1611import AdminRecentPosts from '@/components/adminrecentpost/AdminRecentPosts' ;
1712import ServerStatus from '@/components/serverstatus/ServerStatus' ;
1813
1914
2015
2116const DashBoard = ( ) => {
22- const { setToggleSidePane , toggleSidePane } = useContext ( ThemeContext ) ;
17+ const { toggleSidePane } = useContext ( ThemeContext ) ;
2318
2419 const circumference = 2 * Math . PI * 36 ;
2520
26- const handleKeyCombination = ( event ) => {
27- if ( ( event . ctrlKey || event . metaKey ) && event . key === 'b' ) {
28- event . preventDefault ( ) ;
29- setToggleSidePane ( ( prev ) => ! prev ) ;
30- }
31- }
32-
33- useEffect ( ( ) => {
34- window . addEventListener ( 'keydown' , handleKeyCombination ) ;
35-
36- // Cleanup the event listener on component unmount
37- return ( ) => {
38- window . removeEventListener ( 'keydown' , handleKeyCombination ) ;
39- } ;
40- } , [ ] ) ;
41-
21+
22+
23+
4224 return (
4325 < div className = { `${ styles . container } ${ toggleSidePane ? styles . active : '' } ` } style = { toggleSidePane ? { '--left' : '80px' , zIndex :10 } : { '--left' : '250px' , zIndex :10 } } >
4426
45-
46-
47-
48- < div className = { styles . top } >
49- < p className = { `${ styles . buton } ${ styles . open } ` } style = { { zIndex :100 } } onClick = { ( event ) => {
50- event . stopPropagation ( ) ;
51- setToggleSidePane ( ! toggleSidePane ) ;
52- } } >
53- { '☰' }
54- </ p >
55- < h2 > Dashboard</ h2 >
56- < ThemeToggle />
57- { /* <Searchbar /> */ }
58- </ div >
5927
6028
6129 < div className = { styles . topContainer } >
@@ -121,8 +89,7 @@ const DashBoard = () => {
12189
12290
12391 < Card className = { `${ styles . card } ${ styles . card3 } ` } >
124- { /* Pie Chart, Content Engagement */ }
125- { /* <FeedbackChart /> */ }
92+ < TrafficSourcesChart />
12693 </ Card >
12794
12895 < Card className = { `${ styles . card } ${ styles . card4 } ` } >
@@ -158,3 +125,8 @@ const DashBoard = () => {
158125}
159126
160127export default DashBoard
128+
129+
130+
131+ // TODO When the page reaches a tablet screen, in the css medai query change the --left progerty so it stays, 80px.
132+ // TODO Add a subtitle to each blog (Optionally)
0 commit comments