Skip to content

Commit 22f629f

Browse files
author
Programming-Sai
committed
Done With the Dashboard. Moving Onto the Editor
1 parent 48ad251 commit 22f629f

File tree

18 files changed

+272
-200
lines changed

18 files changed

+272
-200
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
node_modules
2-
node_modules
1+
node_modules/
2+
.next/

src/app/admin/dashboard/dashboard.module.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@
123123
grid-template-columns: repeat(3, 1fr);
124124
grid-template-areas:
125125
"a a b"
126-
"c d b"
127-
"e f f"
128-
"h h g"
126+
"e d b"
127+
"c f f"
128+
"c h g"
129129
"i i g"
130130
;
131131
grid-auto-rows: 200px auto fit-content;
@@ -145,12 +145,13 @@
145145

146146
.card2:hover{
147147
border: 1px solid var(--border-color);
148-
transform: scale(1.05);
148+
transform: scale(1.03);
149149
}
150150

151151
.card3{
152152
grid-area: c;
153-
height: 500px;
153+
height: 425px;
154+
width: 425px;
154155
}
155156

156157

@@ -184,6 +185,7 @@
184185

185186
.card8{
186187
grid-area: h;
188+
display: none !important;
187189
}
188190

189191

src/app/admin/dashboard/page.jsx

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,29 @@
11
'use client'
2-
import React, { useContext, useEffect } from 'react'
2+
import React, { useContext } from 'react'
33
import styles from './dashboard.module.css';
4-
import ThemeToggle from '@/components/themetoggle/ThemeToggle';
5-
import Searchbar from '@/components/searchbar/Searchbar';
64
import { ThemeContext } from '@/context/ThemeContext'
75
import Card from '@/components/card/Card';
86
import { 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';
118
import 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';
1410
import AdminCommentsSection from '@/components/admincommentssection/AdminCommentsSection';
15-
import CommentSection from '@/components/commentsection/CommentSection';
1611
import AdminRecentPosts from '@/components/adminrecentpost/AdminRecentPosts';
1712
import ServerStatus from '@/components/serverstatus/ServerStatus';
1813

1914

2015

2116
const 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

160127
export 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)

src/app/admin/drafts/page.jsx

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,10 @@ const Drafts = () => {
1414
const { setToggleSidePane, toggleSidePane } = useContext(ThemeContext);
1515

1616

17-
useEffect(() => {
18-
window.addEventListener('keydown', handleKeyCombination);
19-
20-
// Cleanup the event listener on component unmount
21-
return () => {
22-
window.removeEventListener('keydown', handleKeyCombination);
23-
};
24-
}, []);
25-
26-
27-
const handleKeyCombination = (event) => {
28-
if ((event.ctrlKey || event.metaKey) && event.key === 'b') {
29-
event.preventDefault();
30-
setToggleSidePane((prev) => !prev);
31-
}
32-
}
33-
34-
35-
36-
17+
3718
return (
3819
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
3920

40-
41-
<div className={styles.top}>
42-
<p className={`${styles.buton} ${styles.open}`} style={{zIndex:100}} onClick={(event) => {
43-
event.stopPropagation();
44-
setToggleSidePane(!toggleSidePane);
45-
}}>
46-
{ '☰' }
47-
</p>
48-
<h2>Drafts</h2>
49-
<ThemeToggle />
50-
{/* <Searchbar /> */}
51-
</div>
52-
5321
</div>
5422
)
5523
}

src/app/admin/editor/editor.module.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
padding: 20px;
77
top: 100%;
88
margin-bottom: 5%;
9-
/* background-color: red; */
109
}
1110

1211

src/app/admin/editor/page.jsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,9 @@ const Editor = () => {
1414
const { setToggleSidePane, toggleSidePane } = useContext(ThemeContext);
1515

1616

17-
useEffect(() => {
18-
window.addEventListener('keydown', handleKeyCombination);
19-
20-
// Cleanup the event listener on component unmount
21-
return () => {
22-
window.removeEventListener('keydown', handleKeyCombination);
23-
};
24-
}, []);
25-
26-
27-
const handleKeyCombination = (event) => {
28-
if ((event.ctrlKey || event.metaKey) && event.key === 'b') {
29-
event.preventDefault();
30-
setToggleSidePane((prev) => !prev);
31-
}
32-
}
33-
34-
35-
36-
3717
return (
3818
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
39-
40-
41-
<div className={styles.top}>
42-
<p className={`${styles.buton} ${styles.open}`} style={{zIndex:100}} onClick={(event) => {
43-
event.stopPropagation();
44-
setToggleSidePane(!toggleSidePane);
45-
}}>
46-
{ '☰' }
47-
</p>
48-
<h2>Editor</h2>
49-
<ThemeToggle />
50-
{/* <Searchbar /> */}
51-
</div>
52-
19+
5320
</div>
5421
)
5522
}

src/app/admin/layout.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
// app/admin/layout.js
22
'use client'
3-
// admin/layout.js
4-
import '../globals.css'; // Main global styles
5-
import './globals.css'; // Admin-specific global styles
3+
import TopBar from '@/components/topbar/TopBar';
4+
import '../globals.css';
5+
import './globals.css';
66
import SideNavbar from '@/components/sidenavbar/SideNavbar';
77
import React from 'react';
88

9+
910
export default function AdminLayout({ children }) {
1011
return (
1112
<div className='container'>
1213
<main className='wrapper'>
1314
<SideNavbar />
15+
<TopBar />
1416
{children}
1517
</main>
1618
</div>

src/app/admin/published-blogs/page.jsx

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,10 @@ const PublishedBlogs = () => {
1414
const { setToggleSidePane, toggleSidePane } = useContext(ThemeContext);
1515

1616

17-
useEffect(() => {
18-
window.addEventListener('keydown', handleKeyCombination);
19-
20-
// Cleanup the event listener on component unmount
21-
return () => {
22-
window.removeEventListener('keydown', handleKeyCombination);
23-
};
24-
}, []);
25-
26-
27-
const handleKeyCombination = (event) => {
28-
if ((event.ctrlKey || event.metaKey) && event.key === 'b') {
29-
event.preventDefault();
30-
setToggleSidePane((prev) => !prev);
31-
}
32-
}
33-
34-
35-
3617

3718
return (
3819
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
3920

40-
41-
<div className={styles.top}>
42-
<p className={`${styles.buton} ${styles.open}`} style={{zIndex:100}} onClick={(event) => {
43-
event.stopPropagation();
44-
setToggleSidePane(!toggleSidePane);
45-
}}>
46-
{ '☰' }
47-
</p>
48-
<h2>Published Blogs</h2>
49-
<ThemeToggle />
50-
{/* <Searchbar /> */}
51-
</div>
52-
5321
</div>
5422
)
5523
}

src/app/admin/settings/page.jsx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,8 @@ const Settings = () => {
1414
const { setToggleSidePane, toggleSidePane } = useContext(ThemeContext);
1515

1616

17-
useEffect(() => {
18-
window.addEventListener('keydown', handleKeyCombination);
19-
20-
// Cleanup the event listener on component unmount
21-
return () => {
22-
window.removeEventListener('keydown', handleKeyCombination);
23-
};
24-
}, []);
25-
26-
27-
const handleKeyCombination = (event) => {
28-
if ((event.ctrlKey || event.metaKey) && event.key === 'b') {
29-
event.preventDefault();
30-
setToggleSidePane((prev) => !prev);
31-
}
32-
}
33-
34-
35-
36-
3717
return (
3818
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
39-
40-
41-
<div className={styles.top}>
42-
<p className={`${styles.buton} ${styles.open}`} style={{zIndex:100}} onClick={(event) => {
43-
event.stopPropagation();
44-
setToggleSidePane(!toggleSidePane);
45-
}}>
46-
{ '☰' }
47-
</p>
48-
<h2>Settings</h2>
49-
<ThemeToggle />
50-
{/* <Searchbar /> */}
51-
</div>
5219

5320
</div>
5421
)

src/app/globals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ body, html {
4343
height: 100%;
4444
min-height: 100vh;
4545
scroll-behavior: smooth;
46+
font-family: 'Open Sans', sans-serif;
47+
}
48+
49+
h1, h2, h3, h4, h5, h6 {
50+
font-family: 'Merriweather', Georgia, serif;
4651
}
4752

4853
a, li {

0 commit comments

Comments
 (0)