-
Notifications
You must be signed in to change notification settings - Fork 44
Feat loading empty state #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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', | ||
|
|
@@ -33,6 +33,15 @@ const HomePage: React.FC = () => { | |
| }, | ||
| ] | ||
|
|
||
| // ✅ EMPTY STATE UI (Issue #79) | ||
| if (!features || 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This conditional return is placed before the |
||
|
|
||
| useGSAP(() => { | ||
| const split = new SplitText('.about-para', { | ||
| type: 'words', | ||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check
!featuresis redundant here. Sincefeaturesis initialized as an array literal on line 17, it will never be a falsy value likenullorundefined. You can simplify the condition for clarity.