Skip to content

Commit 9073c5a

Browse files
committed
Clean up source code: Removed explanatory comments from component and auth files
1 parent 4725330 commit 9073c5a

5 files changed

Lines changed: 1 addition & 12 deletions

File tree

src/app/auth/login/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export default function LoginPage() {
2626
if (err.message === "ACCESS_DENIED") {
2727
addToast("Can't ACCESS sorry", "error");
2828
} else if (err.message === "EMAIL_NOT_VERIFIED") {
29-
// Only show toast, no error box
3029
addToast("Email not verified. Please check your inbox.", "error");
31-
// Redirect to verify-email page
3230
setTimeout(() => router.push("/auth/verify-email"), 2000);
3331
} else {
3432
addToast("Invalid email or password.", "error");

src/app/auth/signup/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default function SignupPage() {
2222
e.preventDefault();
2323
setLoading(true);
2424

25-
// Validate password strength
2625
const passwordValidation = validatePassword(password);
2726
if (!passwordValidation.valid) {
2827
addToast(passwordValidation.message || "Invalid password", "error");

src/app/dashboard/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ export default function DashboardPage() {
1919
router.push("/auth/login");
2020
} else if (!user.emailVerified) {
2121
router.push("/auth/verify-email");
22-
// Normal redirect check is done
2322
}
2423
}
2524
}, [user, loading, router]);
2625

2726
if (loading) return <div className="container" style={{ textAlign: "center", marginTop: "4rem" }}>Loading dashboard...</div>;
28-
if (!user) return null; // Redirecting
29-
27+
if (!user) return null;
3028
return (
3129
<div className="container">
3230
<header style={{ marginBottom: "2rem", display: "flex", justifyContent: "space-between", alignItems: "end" }}>

src/components/public/NotesBrowser.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ChevronRight, File, Film, Image as ImageIcon, Download, Eye, Share2, Se
66
import styles from "./NotesBrowser.module.css";
77

88
export default function NotesBrowser() {
9-
// ... State ... (Same as before)
109
const [departments, setDepartments] = useState<any[]>([]);
1110
const [selectedDept, setSelectedDept] = useState<any>(null);
1211
const [batches, setBatches] = useState<any[]>([]);
@@ -84,7 +83,6 @@ export default function NotesBrowser() {
8483
setSelectedFolder(null);
8584
try {
8685
const realSubjects = await getSubjects(sem.id);
87-
// Append virtual General subject
8886
const generalSubject = { id: "general", name: "General Materials" };
8987
setSubjects([...realSubjects, generalSubject]);
9088
} catch (error) {
@@ -118,12 +116,10 @@ export default function NotesBrowser() {
118116
}
119117
}
120118

121-
// Filter notes based on current view (Folder vs Root)
122119
const filteredNotes = notes.filter(n => {
123120
if (selectedFolder) {
124121
return n.folderId === selectedFolder.id;
125122
} else {
126-
// Show notes that are NOT in any folder (General Notes)
127123
return !n.folderId;
128124
}
129125
});
@@ -150,7 +146,6 @@ export default function NotesBrowser() {
150146
setSearchResults([]);
151147
};
152148

153-
// ... Methods (handleShare, getPreview) ...
154149
const handleShare = async (url: string) => {
155150
try {
156151
await navigator.clipboard.writeText(url);

src/lib/firebase/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const firebaseConfig = {
1212
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
1313
};
1414

15-
// Initialize Firebase
1615
import { getDatabase } from "firebase/database";
1716

1817
const app = !getApps().length ? initializeApp(firebaseConfig) : getApp();

0 commit comments

Comments
 (0)