feat: move to icons component#163
Conversation
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant Footer
participant Header
participant IconsModule as icons.tsx
Footer->>IconsModule: import { Heart }
Header->>IconsModule: import { Kinotio, Discord }
IconsModule-->>Footer: Provides Heart component
IconsModule-->>Header: Provides Kinotio, Discord components
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
components/icons.tsx (2)
2-84: Use a more precise SVG prop type. Right now each component is typed as(props: React.ComponentProps<'svg'>): React.ReactElementConsider defining a shared alias instead:
type IconProps = React.SVGProps<SVGSVGElement>; const Kinotio: React.FC<IconProps> = props => ( <svg {...props} …> … </svg> );Using
React.SVGProps<SVGSVGElement>gives full coverage of standard SVG attributes and improves readability.
155-159: Mark decorative icons as aria‑hidden. TheHearticon is purely decorative and currently lacks any accessibility hint. Addaria-hidden="true"(orrole="img"plusaria-labelfor meaningful icons) to prevent screen readers from announcing it unnecessarily:-<svg viewBox='0 0 24 24' fill='currentColor' {...props}> +<svg aria-hidden="true" viewBox='0 0 24 24' fill='currentColor' {...props}>components/footer.tsx (1)
9-11: Addaria-hiddenfor decorative usage. The<Heart />inside the footer conveys purely stylistic information. Either rely on the component’s internalaria-hidden, or add it at usage to silence screen readers:-<Heart /> +<Heart aria-hidden="true" />components/header.tsx (2)
4-5: Combine icon imports into one statement. You can merge the two separate imports for brevity and clarity:-import { Kinotio } from '@/components/icons' -import { Discord } from '@/components/icons' +import { Kinotio, Discord } from '@/components/icons'
2-2: Use consolidated GitHub icon for consistency. Sincecomponents/icons.tsxexports its ownGithubcomponent, consider switching the import here:-import { Github } from 'lucide-react' +import { Github } from '@/components/icons'This ensures all icons come from a single source and avoids mixing external/icon-library imports.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
components/footer.tsx(1 hunks)components/header.tsx(1 hunks)components/icons.tsx(1 hunks)components/icons/discord.tsx(0 hunks)components/icons/heart.tsx(0 hunks)components/icons/kinotio.tsx(0 hunks)
💤 Files with no reviewable changes (3)
- components/icons/heart.tsx
- components/icons/discord.tsx
- components/icons/kinotio.tsx
🔇 Additional comments (2)
components/icons.tsx (1)
1-221: Unified icon module is a great consolidation. Centralizing all SVG icon components into one file streamlines imports and reduces redundancy across the codebase.components/footer.tsx (1)
1-1: Import updated to consolidated icon module. TheHeartcomponent is now imported from the new@/components/iconsentry point, which aligns with the PR’s refactoring.
This is an automated pull request for branch feat/icons-component
Summary by CodeRabbit
New Features
Refactor
Chores