Skip to content

Commit 60136f0

Browse files
author
Programming-Sai
committed
Done with the published blogs, drafts and settings page. On to make small adjustments and clean ups, then complete about and contact pages
1 parent 12a4546 commit 60136f0

File tree

20 files changed

+1311
-40
lines changed

20 files changed

+1311
-40
lines changed

package-lock.json

Lines changed: 190 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@fortawesome/fontawesome-svg-core": "^6.6.0",
13+
"@fortawesome/free-brands-svg-icons": "^6.6.0",
1314
"@fortawesome/free-solid-svg-icons": "^6.6.0",
1415
"@fortawesome/react-fontawesome": "^0.2.2",
1516
"@tiptap/extension-blockquote": "^2.9.1",
@@ -29,6 +30,7 @@
2930
"lucide-react": "^0.453.0",
3031
"next": "^14.2.14",
3132
"react": "18.2.0",
33+
"react-data-table-component": "^7.6.2",
3234
"react-dom": "18.2.0",
3335
"react-dropzone": "^14.2.10",
3436
"react-quill": "^2.0.0",

public/bubble-theme-dark.png

26.1 KB
Loading

public/bubble-theme-light.png

28.3 KB
Loading

public/snow-theme-dark.png

24.8 KB
Loading

public/snow-theme-light.png

27.4 KB
Loading

src/app/admin/drafts/page.jsx

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
11
'use client'
2-
import React, { useContext, useEffect } from 'react'
2+
import React, { useContext } from 'react'
33
import styles from './drafts.module.css';
4-
import ThemeToggle from '@/components/themetoggle/ThemeToggle';
5-
import Searchbar from '@/components/searchbar/Searchbar';
64
import { ThemeContext } from '@/context/ThemeContext'
7-
import Card from '@/components/card/Card';
8-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9-
import { faCab, faClock, faComputer, faEarth, faFileAlt, faNewspaper, faStopwatch, faTv } from '@fortawesome/free-solid-svg-icons';
5+
import BlogTable from '@/components/blogtable/BlogTable';
6+
107

118

129

1310
const Drafts = () => {
1411
const { setToggleSidePane, toggleSidePane } = useContext(ThemeContext);
1512

13+
const blogData = [
14+
{ id: 1, title: 'A Deep Dive into the World of Music', date: '01 Oct 2024', thumbnail: '/culture.png', category: 'Music', views: 150, comments: 5, shares: 10 },
15+
{ id: 2, title: 'Top 10 Must-Watch Movies of 2024', date: '05 Oct 2024', thumbnail: '/travel.png', category: 'Movies', views: 0, comments: 2, shares: 4 },
16+
{ id: 3, title: 'Exploring the Vibrant Lifestyle Trends in 2024', date: '07 Oct 2024', thumbnail: '/style.png', category: 'Lifestyle', views: 200, comments: 8, shares: 12 },
17+
{ id: 4, title: 'Breaking News: What You Need to Know', date: '10 Oct 2024', thumbnail: '/coding.png', category: 'News', views: 0, comments: 3, shares: 5 },
18+
{ id: 5, title: 'The Evolution of Sports in the Modern Age', date: '12 Oct 2024', thumbnail: '/culture.png', category: 'Sports', views: 300, comments: 7, shares: 15 },
19+
{ id: 6, title: 'Fashion Forward: The Trends of Tomorrow', date: '15 Oct 2024', thumbnail: '/fashion.png', category: 'Lifestyle', views: 250, comments: 6, shares: 10 },
20+
{ id: 7, title: 'Traveling the World: Cultural Insights', date: '18 Oct 2024', thumbnail: '/travel.png', category: 'Lifestyle', views: 0, comments: 4, shares: 8 },
21+
{ id: 8, title: 'Coding for Beginners: Your First Steps', date: '20 Oct 2024', thumbnail: '/coding.png', category: 'News', views: 180, comments: 9, shares: 11 },
22+
{ id: 9, title: 'The Future of Travel: Experiences to Embrace', date: '22 Oct 2024', thumbnail: '/travel.png', category: 'Lifestyle', views: 220, comments: 10, shares: 14 },
23+
{ id: 10, title: 'The Importance of Breakfast: Fueling Your Day', date: '23 Oct 2024', thumbnail: '/food.png', category: 'Sports', views: 0, comments: 1, shares: 3 },
24+
{ id: 11, title: 'Sustainable Eating: What You Need to Know', date: '24 Oct 2024', thumbnail: '/culture.png', category: 'Lifestyle', views: 310, comments: 12, shares: 20 },
25+
{ id: 12, title: 'Understanding the Basics of Fashion', date: '25 Oct 2024', thumbnail: '/fashion.png', category: 'Lifestyle', views: 0, comments: 3, shares: 7 },
26+
{ id: 13, title: 'Exploring Vegan Desserts: Sweet Treats', date: '26 Oct 2024', thumbnail: '/food.png', category: 'Lifestyle', views: 145, comments: 6, shares: 10 },
27+
{ id: 14, title: 'Cooking for One: Easy and Delicious Meals', date: '27 Oct 2024', thumbnail: '/food.png', category: 'Lifestyle', views: 0, comments: 5, shares: 6 },
28+
{ id: 15, title: 'Food Pairing: A Guide to Wine and Dine', date: '28 Oct 2024', thumbnail: '/food.png', category: 'Lifestyle', views: 275, comments: 8, shares: 14 },
29+
{ id: 16, title: 'The Science Behind Cooking Techniques', date: '29 Oct 2024', thumbnail: '/food.png', category: 'Lifestyle', views: 0, comments: 4, shares: 7 },
30+
{ id: 17, title: 'Fashion Trends to Watch in 2025', date: '30 Oct 2024', thumbnail: '/style.png', category: 'Lifestyle', views: 360, comments: 9, shares: 13 },
31+
{ id: 18, title: 'Global Cuisines: An Introduction to Spices', date: '31 Oct 2024', thumbnail: '/food.png', category: 'Lifestyle', views: 0, comments: 5, shares: 9 },
32+
{ id: 19, title: 'The Best Sports Moments of the Year', date: '01 Nov 2024', thumbnail: '/coding.png', category: 'Sports', views: 420, comments: 11, shares: 18 },
33+
{ id: 20, title: 'Behind the Scenes: Movie Production Insights', date: '02 Nov 2024', thumbnail: '/style.png', category: 'Movies', views: 110, comments: 4, shares: 7 },
34+
{ id: 21, title: 'Breaking the News: Global Events', date: '03 Nov 2024', thumbnail: '/culture.png', category: 'News', views: 190, comments: 6, shares: 10 },
35+
{ id: 22, title: 'Lifestyle Hacks for a Better You', date: '04 Nov 2024', thumbnail: '/travel.png', category: 'Lifestyle', views: 275, comments: 9, shares: 16 },
36+
{ id: 23, title: 'Music Genres: The Rising Stars', date: '05 Nov 2024', thumbnail: '/coding.png', category: 'Music', views: 130, comments: 5, shares: 9 },
37+
{ id: 24, title: 'The Impact of Sports on Society', date: '06 Nov 2024', thumbnail: '/style.png', category: 'Sports', views: 340, comments: 10, shares: 17 },
38+
{ id: 25, title: 'An Inside Look at 2025 Movie Releases', date: '07 Nov 2024', thumbnail: '/travel.png', category: 'Movies', views: 120, comments: 3, shares: 8 },
39+
];
1640

1741

42+
43+
44+
1845
return (
1946
<div className={`${styles.container} ${toggleSidePane ? styles.active : ''}`} style={toggleSidePane ? {'--left': '80px', zIndex:10} : {'--left': '250px', zIndex:10}}>
20-
47+
<BlogTable data={blogData} page='draft' />
2148
</div>
2249
)
2350
}

src/app/admin/editor/page.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,20 @@ const debounce = (func, delay) => {
5555
const Editor = () => {
5656

5757

58-
const { toggleSidePane, autoSaveDuration } = useContext(ThemeContext);
58+
const { toggleSidePane, autoSaveDuration, autoSave, setAutoSave, quillTheme, setQuillTheme } = useContext(ThemeContext);
5959
const [image, setImage] = useState('');
6060
const [title, setTitle] = useState('');
6161
const [slug, setSlug] = useState('');
6262
const [category, setCategory] = useState('Select A Category');
6363
const [blogContent, setBlogContent] = useState('');
6464
const [description, setDescription] = useState('');
65-
const [quillTheme, setQuillTheme] = useState('snow');
6665
const [draft, setDraft] = useState(true);
6766
const [saved, setSaved] = useState(false);
6867
const [readingTime, setReadingTime] = useState(calculateReadingTime(blogContent));
6968
const [date, setDate] = useState(getCurrentDate());
7069
const [keywords, setKeywords] = useState('');
71-
const [autoSave, setAutoSave] = useState(() => {
72-
const savedValue = localStorage.getItem('autoSave');
73-
return savedValue !== null ? JSON.parse(savedValue) : true; // Change to != null
74-
});
70+
71+
7572

7673
const handleTitleChange = (event) => {
7774
const inputTitle = event.target.value;
@@ -91,6 +88,9 @@ const handleTitleChange = (event) => {
9188
draft,
9289
keywords: (typeof keywords === 'string' ? keywords.split(',').map(keyword => keyword.trim()) : []),
9390
description,
91+
comments:0,
92+
views:0,
93+
shares:0,
9494
};
9595

9696
localStorage.setItem('previewData', JSON.stringify(blogData));

0 commit comments

Comments
 (0)