Skip to content

Commit aeea2f8

Browse files
author
hex316aa
committed
Add an informational popup with project details and author information
Implements an AboutModal component with project overview, features, and contact details, accessible via the header's Info icon. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 985aacde-9109-4e26-b972-11f321cb8110 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/748ca40c-adc5-4420-89fe-05eb662dff30/0b4f1aa6-5919-4dc9-a838-28bd1baa1032.jpg
1 parent 745f359 commit aeea2f8

File tree

3 files changed

+128
-1
lines changed

3 files changed

+128
-1
lines changed
269 KB
Loading
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import React from 'react';
2+
import {
3+
Dialog,
4+
DialogContent,
5+
DialogDescription,
6+
DialogHeader,
7+
DialogTitle,
8+
DialogFooter,
9+
} from "@/components/ui/dialog";
10+
import { Button } from "@/components/ui/button";
11+
import { X } from 'lucide-react';
12+
13+
interface AboutModalProps {
14+
open: boolean;
15+
onOpenChange: (open: boolean) => void;
16+
}
17+
18+
export default function AboutModal({ open, onOpenChange }: AboutModalProps) {
19+
const currentDate = new Date().toLocaleDateString('en-US', {
20+
year: 'numeric',
21+
month: 'long',
22+
day: 'numeric'
23+
});
24+
25+
return (
26+
<Dialog open={open} onOpenChange={onOpenChange}>
27+
<DialogContent className="sm:max-w-[600px] max-h-[85vh] overflow-y-auto">
28+
<DialogHeader>
29+
<DialogTitle className="text-center">About CodePatchwork</DialogTitle>
30+
<DialogDescription className="text-center">
31+
A modern visual Code Snippet organization and transformation tool
32+
</DialogDescription>
33+
<button
34+
onClick={() => onOpenChange(false)}
35+
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
36+
>
37+
<X className="h-4 w-4" />
38+
<span className="sr-only">Close</span>
39+
</button>
40+
</DialogHeader>
41+
42+
<div className="py-4">
43+
<h2 className="text-xl font-semibold text-center text-primary">
44+
CodePatchwork v1.0.0
45+
</h2>
46+
<p className="text-center text-muted-foreground text-sm mt-1">
47+
Released {currentDate}
48+
</p>
49+
50+
<div className="mt-6">
51+
<h3 className="text-lg font-semibold">Overview</h3>
52+
<p className="mt-2 text-sm">
53+
CodePatchwork is a visual code snippet manager that combines the visual appeal of Pinterest with the functionality of GitHub Gists. It transforms how developers manage code snippets by replacing scattered text files and notes with a visually appealing, searchable repository.
54+
</p>
55+
</div>
56+
57+
<div className="mt-6">
58+
<h3 className="text-lg font-semibold">Key Features</h3>
59+
<ul className="list-disc pl-5 mt-2 text-sm space-y-1">
60+
<li>Visual organization with Pinterest-style interface</li>
61+
<li>Syntax highlighting for 100+ programming languages</li>
62+
<li>Powerful search and filtering capabilities</li>
63+
<li>Collections for organizing related snippets</li>
64+
<li>Social sharing with customizable links</li>
65+
<li>Tagging system for better discoverability</li>
66+
<li>Google Authentication for secure access</li>
67+
<li>Dark/Light mode for comfortable coding</li>
68+
<li>Import/Export functionality</li>
69+
<li>Responsive design for all devices</li>
70+
</ul>
71+
</div>
72+
73+
<div className="mt-6">
74+
<h3 className="text-lg font-semibold">Technology</h3>
75+
<p className="mt-2 text-sm">
76+
Built with React, TypeScript, Express, PostgreSQL, and Firebase. Uses TailwindCSS for styling, Prism.js for code highlighting, and Drizzle ORM for database operations.
77+
</p>
78+
</div>
79+
80+
<div className="mt-6 border-t pt-4">
81+
<h3 className="text-lg font-semibold text-center">Contact</h3>
82+
<div className="flex flex-col items-center mt-2 text-sm">
83+
<p>Author: 0xWulf</p>
84+
<p>Email: dev@0xwulf.dev</p>
85+
<a
86+
href="https://github.com/hexawolf/CodePatchwork"
87+
target="_blank"
88+
rel="noopener noreferrer"
89+
className="text-blue-500 hover:underline"
90+
>
91+
GitHub Repository
92+
</a>
93+
</div>
94+
</div>
95+
</div>
96+
97+
<DialogFooter>
98+
<Button
99+
onClick={() => onOpenChange(false)}
100+
className="w-full"
101+
>
102+
Close
103+
</Button>
104+
</DialogFooter>
105+
</DialogContent>
106+
</Dialog>
107+
);
108+
}

client/src/components/Header.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState } from "react";
22
import { Button } from "@/components/ui/button";
3-
import { Menu, Plus, Sun, Moon, Upload, Download } from "lucide-react";
3+
import { Menu, Plus, Sun, Moon, Upload, Download, Info } from "lucide-react";
44
import {
55
DropdownMenu,
66
DropdownMenuContent,
@@ -12,6 +12,7 @@ import AddSnippetDialog from "./AddSnippetDialog";
1212
import ImportExportDialog from "./ImportExportDialog";
1313
import GlobalCodeThemeSelector from "./GlobalCodeThemeSelector";
1414
import UserProfileButton from "./UserProfileButton";
15+
import AboutModal from "./AboutModal";
1516

1617
interface HeaderProps {
1718
toggleMobileMenu: () => void;
@@ -33,6 +34,7 @@ export default function Header({ toggleMobileMenu }: HeaderProps) {
3334
// Managing dialog states
3435
const [snippetDialogOpen, setSnippetDialogOpen] = useState(false);
3536
const [importExportDialogOpen, setImportExportDialogOpen] = useState(false);
37+
const [aboutModalOpen, setAboutModalOpen] = useState(false);
3638

3739
const openCreateModal = () => {
3840
setSnippetDialogOpen(true);
@@ -41,6 +43,10 @@ export default function Header({ toggleMobileMenu }: HeaderProps) {
4143
const openImportModal = () => {
4244
setImportExportDialogOpen(true);
4345
};
46+
47+
const openAboutModal = () => {
48+
setAboutModalOpen(true);
49+
};
4450

4551
return (
4652
<>
@@ -74,6 +80,16 @@ export default function Header({ toggleMobileMenu }: HeaderProps) {
7480
)}
7581
</button>
7682

83+
{/* About button */}
84+
<button
85+
type="button"
86+
onClick={openAboutModal}
87+
className="text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white p-1 rounded-md"
88+
aria-label="About CodePatchwork"
89+
>
90+
<Info className="h-6 w-6" />
91+
</button>
92+
7793
{/* Add Snippet Dialog - This is the single place to add new snippets */}
7894
{/* Desktop actions */}
7995
<div className="hidden md:flex items-center space-x-2">
@@ -141,6 +157,9 @@ export default function Header({ toggleMobileMenu }: HeaderProps) {
141157

142158
{/* Import/Export Dialog */}
143159
<ImportExportDialog open={importExportDialogOpen} onOpenChange={setImportExportDialogOpen} />
160+
161+
{/* About Modal */}
162+
<AboutModal open={aboutModalOpen} onOpenChange={setAboutModalOpen} />
144163
</>
145164
);
146165
}

0 commit comments

Comments
 (0)