maintenance: Clean up comments throughout component files

This commit is contained in:
2025-09-28 16:22:05 -05:00
parent 7f576bac73
commit 0c00c49850
11 changed files with 18 additions and 10 deletions

View File

@@ -27,8 +27,10 @@ const PostCard = ({ post, onEdit }) => {
const formattedDate = date.toLocaleDateString(undefined, dateOptions);
// Split formatted date to check if time component exists
const parts = formattedDate.split(',');
if (parts.length > 1) {
// Reconstruct with separate date and time formatting for consistency
const timePart = date.toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit', hour12: true });
const datePart = date.toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' });
return `${datePart}, ${timePart}`;

View File

@@ -1,6 +1,5 @@
// MarkdownEditor.jsx
// KendoReact Splitter implementation for dual-pane markdown editing with live preview
// Demonstrates advanced layout components and real-time markdown processing
import React, { useState } from 'react';
import { Splitter, SplitterPane } from '@progress/kendo-react-layout';
import { marked } from 'marked';

View File

@@ -1,6 +1,5 @@
// WysiwygEditor.jsx
// KendoReact Editor implementation for HTML editing with custom toolbar
// Demonstrates custom tool integration and advanced editor configuration
import React, { useState } from 'react';
import { Editor, EditorTools, EditorToolsSettings } from '@progress/kendo-react-editor';
import InlineCodeTool from './custom/InlineCodeTool';

View File

@@ -1,6 +1,5 @@
// EditorModeToggle.jsx
// Custom KendoReact component for switching between HTML and Markdown editing modes
// Demonstrates reusable UI components and state management patterns
import React from 'react';
import { Button } from '@progress/kendo-react-buttons';

View File

@@ -21,14 +21,14 @@ const InlineCodeTool = (props) => {
const hasMark = state.doc.rangeHasMark(from, to, markType);
if (hasMark) {
// Remove code mark if already present
// Remove code mark if already present (toggle off)
tr.removeMark(from, to, markType);
} else {
// Add code mark to selected text
// Add code mark to selected text (toggle on)
tr.addMark(from, to, markType.create());
}
// Dispatch transaction to apply changes
// Dispatch transaction to apply changes to editor
dispatch(tr);
}
}

View File

@@ -24,6 +24,7 @@ const LoginComponent = ({ onLogin }) => {
} else {
console.error("Invalid username or password");
setError("Invalid username or password. Please try again.");
// Clear error after 50 seconds (long timeout for demo purposes)
setTimeout(() => {
setError('');
}, 50000);

View File

@@ -35,7 +35,7 @@ const CampfirePanelBar = ({ isExpanded = true }) => {
const navigate = useNavigate();
const renderItem = (item) => {
// External links
// Handle external links (open in new tab)
if (item.url) {
return (
<PanelBarItem
@@ -79,7 +79,7 @@ const CampfirePanelBar = ({ isExpanded = true }) => {
);
}
// Internal routes
// Handle internal routes (navigate within app)
if (item.route) {
return (
<PanelBarItem
@@ -106,7 +106,7 @@ const CampfirePanelBar = ({ isExpanded = true }) => {
);
}
// Headers with children
// Handle section headers with child items
return (
<PanelBarItem
key={item.title}

View File

@@ -10,10 +10,12 @@ const CampfireBreadcrumb = () => {
const path = location.pathname;
const pathSegments = path.split('/').filter(segment => segment);
// Dashboard routes
if (path === '/dashboard' || path === '/') {
return [{ id: 'dashboard', text: 'Dashboard' }];
}
// Published posts filter
if (path === '/posts') {
return [
{ id: 'dashboard', text: 'Dashboard' },
@@ -21,6 +23,7 @@ const CampfireBreadcrumb = () => {
];
}
// Drafts filter
if (path === '/drafts') {
return [
{ id: 'dashboard', text: 'Dashboard' },
@@ -28,6 +31,7 @@ const CampfireBreadcrumb = () => {
];
}
// New post editor
if (path === '/editor') {
return [
{ id: 'editor', text: 'Editor' },
@@ -35,6 +39,7 @@ const CampfireBreadcrumb = () => {
];
}
// Edit existing post
if (path.startsWith('/editor/')) {
const slug = pathSegments[1];
return [
@@ -43,6 +48,7 @@ const CampfireBreadcrumb = () => {
];
}
// Default fallback
return [{ id: 'dashboard', text: 'Dashboard' }];
};

View File

@@ -18,6 +18,7 @@ export default function Copyright({ isLoginPage, isLoggedIn }) {
}, [isLoginPage]);
// Show copyright on login page with transition, or at bottom after login
// Hide completely when not on login page and not logged in
if (!isLoginPage && !isLoggedIn) {
return null;
}

View File

@@ -48,6 +48,7 @@ const Dashboard = React.forwardRef((props, ref) => {
};
const filter = getFilterFromPath();
// Show sections based on URL filter or show both if no filter
const showPublished = !filter || filter === 'published';
const showDrafts = !filter || filter === 'drafts';

View File

@@ -79,7 +79,7 @@ const EditorPage = React.forwardRef((props, ref) => {
if (editMode === 'html') {
// Switch to markdown mode - keep the existing markdown content
setEditMode('markdown');
// Reset splitter to 50/50
// Reset splitter to 50/50 for markdown editor
setPanes([
{ size: '50%' },
{}