Skip to content

fix(ui): add isDark prop to Skeleton component and resolve type errors (closes #1081) - #1202

Open
rupesh-kumar-sah wants to merge 1 commit into
rinafcode:mainfrom
rupesh-kumar-sah:fix/issue-1081-skeleton-isdark-prop
Open

rupesh-kumar-sah wants to merge 1 commit into
rinafcode:mainfrom
rupesh-kumar-sah:fix/issue-1081-skeleton-isdark-prop

Conversation

@rupesh-kumar-sah

Copy link
Copy Markdown

Summary

Closes #1081

Problem

The shared UI skeleton component src/components/ui/Skeleton.tsx declared SkeletonProps without an isDark field. However, skeleton screens such as src/components/mobile/TeamDashboard/DashboardSkeleton.tsx and src/components/mobile/CourseViewerSkeleton.tsx pass isDark to <UISkeleton ... isDark={isDark} />, causing TypeScript errors (Property 'isDark' does not exist on type 'IntrinsicAttributes & SkeletonProps').

Solution

  1. Added isDark?: boolean to SkeletonProps in src/components/ui/Skeleton.tsx.
  2. Applied theme-aware placeholder background styling:
    • isDark ? '#334155' : '#E5E7EB' consistent with design tokens across src/components/common/SkeletonLoader.tsx and DashboardSkeleton.tsx.
  3. Cleaned up imports: Removed unused StyleSheet import from src/components/ui/Skeleton.tsx.
  4. Enhanced Unit Tests: Added comprehensive test cases to tests/components/Skeleton.test.tsx validating dark mode styling when isDark=true and default light styling when isDark is false or omitted.

Verification

  • Unit Tests: npm test tests/components/Skeleton.test.tsx passed (16/16 tests green).
  • ESLint: npx eslint src/components/ui/Skeleton.tsx tests/components/Skeleton.test.tsx (0 errors, 0 warnings).
  • Prettier: Verified full code formatting compliance.
  • TypeScript: Verified zero type errors on Skeleton and consuming dashboard components.

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.

UI Skeleton's SkeletonProps does not declare the isDark prop that skeleton screens pass

1 participant