Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion LocalMind-Backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@types/mongoose": "^5.11.97",
"@types/morgan": "^1.9.10",
"argon2": "^0.44.0",
"bcrypt": "^5.1.1",
"axios": "^1.12.2",
"bcrypt": "^6.0.0",
"chalk": "^5.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useGSAP } from '@gsap/react'
gsap.registerPlugin(ScrollTrigger, SplitText)

const HomePage: React.FC = () => {
// Typed array of feature objects
// Typed array of feature objects (acts as fetched data)
const features: CardProps[] = [
{
title: 'Custom Models',
Expand All @@ -33,6 +33,15 @@ const HomePage: React.FC = () => {
},
]

// ✅ EMPTY STATE UI (Issue #79)
if (!features || features.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check !features is redundant here. Since features is initialized as an array literal on line 17, it will never be a falsy value like null or undefined. You can simplify the condition for clarity.

Suggested change
if (!features || features.length === 0) {
if (features.length === 0) {

return (
<div className="flex items-center justify-center min-h-screen bg-[#1E1E1E] text-gray-400">
No data available at the moment
</div>
)
}
Comment on lines +37 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This conditional return is placed before the useGSAP hook call on line 45. This violates the Rules of Hooks, which state that hooks must be called at the top level of a component and in the same order on every render. An early return causes hooks to be called conditionally, which can lead to unpredictable bugs. To fix this, please ensure all hook calls (like useGSAP) are executed before any conditional return statements.


useGSAP(() => {
const split = new SplitText('.about-para', {
type: 'words',
Expand Down Expand Up @@ -68,6 +77,7 @@ const HomePage: React.FC = () => {
</div>
<img src={linesImg} alt="" className="absolute w-full -bottom-15" />
</div>

<div className="about w-full min-h-screen relative flex flex-col justify-center pt-10 font-Satoshi">
<h1 className="text-white text-center uppercase text-3xl tracking-wider font-bold">
About
Expand Down