Skip to content

Implemented Lottie animation for Empty States#377

Open
yashr5120 wants to merge 2 commits into
roshankumar0036singh:mainfrom
yashr5120:main
Open

Implemented Lottie animation for Empty States#377
yashr5120 wants to merge 2 commits into
roshankumar0036singh:mainfrom
yashr5120:main

Conversation

@yashr5120
Copy link
Copy Markdown

@yashr5120 yashr5120 commented May 28, 2026

This pull request introduces a reusable EmptyState component featuring a Lottie animation to standardize and enhance the empty state UI across multiple screens. It also adds the necessary dependencies for Lottie support and refactors several screens to use the new component, replacing previous custom empty state implementations.

New Feature: Reusable Empty State Component

  • Added a new EmptyState component (app/src/components/EmptyState.js) that displays a Lottie animation and customizable messages for empty state scenarios.

fixes #94
test1
test2

Summary by CodeRabbit

  • New Features

    • Introduced a unified empty-state component across the app, providing a consistent visual experience when no events, reminders, or saved items are available.
  • Chores

    • Updated animation library dependencies for improved visual effects.

Review Change Stack

Copilot AI review requested due to automatic review settings May 28, 2026 11:15
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

This PR implements Lottie-based animations for empty states across the app. A reusable EmptyState component was created with theme-aware styling and Lottie animation support, then integrated into nine screens to replace inline empty-state placeholders. Dependencies were updated to support Lottie rendering.

Changes

Lottie Empty State Component & Screen Integration

Layer / File(s) Summary
Animation Dependencies and Configuration
app/app.json, app/package.json
Added @lottiefiles/dotlottie-react (^0.19.4) and updated lottie-react-native to 7.1.0. Reformatted plugin array for consistency.
EmptyState Component Implementation
app/src/components/EmptyState.js
Created a reusable EmptyState component that renders a centered Lottie animation with optional message, subMessage, and children. Component reads theme colors, supports isSmall sizing variant, and includes prop-type validation and React Native styles.
Screen Empty-State Integration
app/src/screens/ClubProfileScreen.js, app/src/screens/MobileAdmin.js, app/src/screens/MyEventsScreen.js, app/src/screens/MyRegisteredEventsScreen.js, app/src/screens/ParticipatingEventsScreen.js, app/src/screens/RemindersScreen.js, app/src/screens/SavedEventsScreen.js, app/src/screens/UserFeed.js
Imported EmptyState and replaced inline empty-state UI (icon + text) with the component across nine screens. Removed local empty-state styling and delegated presentation to the shared component, passing context-specific message and subMessage props.

Sequence Diagram

sequenceDiagram
    participant Screen
    participant EmptyState
    participant Lottie
    participant Theme
    
    Screen->>EmptyState: Render with message, subMessage
    EmptyState->>Theme: useTheme() for colors
    Theme-->>EmptyState: Return color values
    EmptyState->>Lottie: Render animation with dimensions
    Lottie-->>EmptyState: Animated output
    EmptyState-->>Screen: Display animation + text
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

level:intermediate, type:design, type:refactor, quality:clean

Suggested reviewers

  • roshankumar0036singh

Poem

A rabbit built empty states with care,
Lottie animations float through the air—
No events to show? No worries, friend!
A dancing loop makes lonely screens blend. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing a Lottie animation-based EmptyState component that is used across multiple screens.
Linked Issues check ✅ Passed The PR implements Lottie animations for empty states as required by issue #94, adding the EmptyState component with animation support and refactoring multiple screens to use it.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #94: adding Lottie dependencies, creating the EmptyState component, and refactoring screens to use it. The app.json reformatting appears to be incidental formatting.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces a reusable EmptyState component with a Lottie animation and replaces ad-hoc empty UI across multiple screens for visual consistency.

Changes:

  • Adds new EmptyState component using lottie-react-native.
  • Refactors 8 screens to use EmptyState instead of inline empty-state markup.
  • Adds lottie-react-native and @lottiefiles/dotlottie-react dependencies; reformats app.json plugins array.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
app/src/components/EmptyState.js New shared empty state component with Lottie animation.
app/src/screens/UserFeed.js Switches empty UI to EmptyState; uses ListFooterComponent instead of ListEmptyComponent.
app/src/screens/SavedEventsScreen.js Replaces inline empty view with EmptyState.
app/src/screens/RemindersScreen.js Replaces inline empty view with EmptyState.
app/src/screens/ParticipatingEventsScreen.js Replaces empty text with EmptyState.
app/src/screens/MyRegisteredEventsScreen.js Replaces inline empty view with EmptyState.
app/src/screens/MyEventsScreen.js Uses EmptyState with action button as children.
app/src/screens/MobileAdmin.js Replaces inline empty view with EmptyState.
app/src/screens/ClubProfileScreen.js Replaces inline empty view with EmptyState.
app/package.json Adds Lottie dependencies.
app/app.json Reformats plugins array to one line.
Files not reviewed (1)
  • app/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +531 to +533
ListFooterComponent={
displayList.length === 0 ? (
<EmptyState
Comment on lines +57 to +64
animation: {
width: 200,
height: 200,
},
animationSmall: {
width: 120,
height: 120,
},
Comment thread app/package.json
"@expo-google-fonts/outfit": "^0.2.3",
"@expo/vector-icons": "~14.0.4",
"@expo/webpack-config": "^19.0.0",
"@lottiefiles/dotlottie-react": "^0.19.4",
Comment thread app/app.json
"@react-native-community/datetimepicker",
"expo-secure-store"
],
"plugins": ["expo-notifications","@react-native-community/datetimepicker","expo-secure-store"],
</Text>
<EmptyState
message="No events created"
subMessage="You haven't created any events yet."
Comment on lines +19 to +20
<LottieView
source={require('../../assets/empty-state-animation.json')}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/screens/MyEventsScreen.js (1)

200-208: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align CTA copy with the action intent.

Line 207 says “Create Layout”, but this flow creates an event (navigation.navigate('CreateEvent')). Rename it to avoid user confusion.

✏️ Proposed fix
-                            <Text style={styles.createBtnText}>Create Layout</Text>
+                            <Text style={styles.createBtnText}>Create Event</Text>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/screens/MyEventsScreen.js` around lines 200 - 208, The CTA text
"Create Layout" mislabels the action — the button triggers
navigation.navigate('CreateEvent') and should indicate creating an event; update
the Text node inside the TouchableOpacity (the component using
styles.createBtnText) to read something like "Create Event" (or other
event-focused copy) so the TouchableOpacity/ Text accurately reflect the
CreateEvent flow and avoid user confusion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@app/src/screens/MyEventsScreen.js`:
- Around line 200-208: The CTA text "Create Layout" mislabels the action — the
button triggers navigation.navigate('CreateEvent') and should indicate creating
an event; update the Text node inside the TouchableOpacity (the component using
styles.createBtnText) to read something like "Create Event" (or other
event-focused copy) so the TouchableOpacity/ Text accurately reflect the
CreateEvent flow and avoid user confusion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b21b510-51e1-4136-8de3-beec67d599a8

📥 Commits

Reviewing files that changed from the base of the PR and between 52f03e7 and 2a6f064.

⛔ Files ignored due to path filters (1)
  • app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • app/app.json
  • app/assets/empty-state-animation.json
  • app/package.json
  • app/src/components/EmptyState.js
  • app/src/screens/ClubProfileScreen.js
  • app/src/screens/MobileAdmin.js
  • app/src/screens/MyEventsScreen.js
  • app/src/screens/MyRegisteredEventsScreen.js
  • app/src/screens/ParticipatingEventsScreen.js
  • app/src/screens/RemindersScreen.js
  • app/src/screens/SavedEventsScreen.js
  • app/src/screens/UserFeed.js

@yashr5120
Copy link
Copy Markdown
Author

@roshankumar0036singh Kindly review the changes and merge the PR whenever you are free
Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement "Lottie" Animations for Empty States

2 participants