mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
1.9 KiB
1.9 KiB
Logo Sizing Fix
Problem
SVG logos from logoapi.sportcreative.eu were being displayed too large in circular containers, causing them to be cut off by the circular border.
Solution
Implemented a comprehensive fix that includes:
1. CSS Updates (frontend/src/styles/logos.css)
- Added specific styles for SVG logos in circular containers
- Added padding to prevent cutoff
- Added utility classes for consistent logo display
2. Utility Functions (frontend/src/utils/logoUtils.ts)
isLogoApiUrl()- Detects logoapi URLsgetLogoStyle()- Returns appropriate styling based on logo source and container typegetLogoClassName()- Returns appropriate CSS classesgetLogoProps()- Returns complete props for Chakra UI Image components
3. Component Updates
- TeamLogo component: Now uses utility functions for consistent styling
- ClubModal component: Added padding for logoapi SVGs in circular containers
- Navbar component: Added padding for logoapi SVGs in circular containers
- MatchesPage: Added padding for logoapi SVGs in match displays
4. Key Changes
- Changed
objectFitfromcovertocontainfor better logo display - Added conditional padding (4-6px) for logoapi SVGs in circular containers
- Added
boxSizing: border-boxto ensure proper sizing calculations
Usage
The fix is automatically applied to all components that display logos. No additional configuration is needed.
Testing
To test the fix:
- Navigate to any page with team logos
- Verify that SVG logos from logoapi are properly sized within circular containers
- Check that logos are not cut off by the circular border
- Ensure logos maintain their aspect ratio
Files Modified
frontend/src/styles/logos.cssfrontend/src/utils/logoUtils.ts(new)frontend/src/components/common/TeamLogo.tsxfrontend/src/components/home/ClubModal.tsxfrontend/src/components/Navbar.tsxfrontend/src/pages/MatchesPage.tsx