aafre / aafre/resume-builder

feat(refactor): extract a reusable `Spinner` component to replace duplicated spinner markup across the codebase.

Abierto
#219 0 comentarios 0 reacciones 0 asignados Ver en GitHub
ReactJS refactor tech-debt
Lenguaje dominante
TypeScript
Estrellas
6
Forks
15
Merge medio
7 d 22 h
PR fusionados (30 d)
2

Descripción

## Summary
Extract a reusable `Spinner` component to replace duplicated spinner markup across the codebase.

## Background

During review of PR #214, it was noted that spinner markup is duplicated in multiple places with slight variations. This creates maintenance overhead and inconsistency.

## Current State

Spinner markup is duplicated in:
- `ResumeCard.tsx` - Preview loading overlay (h-8 w-8)
- `ResumeCard.tsx` - Edit button loading (h-4 w-4)
- `MobileActionBar.tsx` - Preview button (h-6 w-6)
- `SectionNavigator.tsx` - Preview button (h-4 w-4)

Each uses slightly different sizes but the same pattern:
```tsx

Proposed Solution

Create a reusable Spinner component:

// components/Spinner.tsx
interface SpinnerProps {
size?: 'sm' | 'md' | 'lg';
color?: 'white' | 'blue';
className?: string;
}

export function Spinner({ size = 'md', color = 'white', className }: SpinnerProps) {
const sizeClasses = {
sm: 'h-4 w-4',
md: 'h-6 w-6',
lg: 'h-8 w-8'
};

const colorClasses = {
white: 'border-white border-t-transparent',
blue: 'border-blue-600 border-t-transparent'
};

return (


);
}

Tasks

- Create Spinner component with size/colour variants
- Add accessibility attributes (role="status", aria-label)
- Replace spinner markup in ResumeCard.tsx
- Replace spinner markup in MobileActionBar.tsx
- Replace spinner markup in SectionNavigator.tsx
- Search for any other spinner instances in the codebase
- Add unit tests for Spinner component

Acceptance Criteria

- Single source of truth for spinner styling
- All existing spinners replaced with a new component
- No visual regression (spinners look identical)
- All tests pass

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.