This commit is contained in:
Tomas Dvorak
2025-10-25 16:33:53 +02:00
parent 857e6f007d
commit 3d621e2187
9 changed files with 238 additions and 121 deletions
@@ -44,9 +44,10 @@ const resolveBackendUrl = (path: string) => {
}
};
const GallerySection: React.FC = () => {
const GallerySection: React.FC<{ zoneramaUrl?: string | null }> = ({ zoneramaUrl }) => {
const [albums, setAlbums] = useState<Album[]>([]);
const [loading, setLoading] = useState(true);
const [profileUrl, setProfileUrl] = useState<string | null>(null);
// Dark mode colors
const cardBg = useColorModeValue('white', 'gray.800');
@@ -72,6 +73,9 @@ const GallerySection: React.FC = () => {
// Get profile albums (newest/main source)
if (profileRes.status === 'fulfilled' && profileRes.value.ok) {
const profileData = await profileRes.value.json();
if (profileData && profileData.input_link) {
setProfileUrl(profileData.input_link);
}
combinedAlbums = [...(profileData.albums || [])];
}
@@ -176,7 +180,7 @@ const GallerySection: React.FC = () => {
📸 Všechny fotografie jsou z platformy{' '}
<Text
as="a"
href="https://zonerama.com"
href={zoneramaUrl || profileUrl || 'https://zonerama.com'}
target="_blank"
rel="noopener noreferrer"
fontWeight="600"
+21 -3
View File
@@ -10,7 +10,6 @@ import {
Button,
HStack,
VStack,
Image,
Text,
Badge,
Link,
@@ -18,6 +17,7 @@ import {
} from '@chakra-ui/react';
import { useCountdown } from '../../hooks/useCountdown';
import { assetUrl, sanitizeClubName } from '../../utils/url';
import { TeamLogo } from '../common/TeamLogo';
export type FacrMatchLike = {
id?: string | number;
@@ -28,6 +28,8 @@ export type FacrMatchLike = {
away?: string;
home_logo_url?: string;
away_logo_url?: string;
home_id?: string;
away_id?: string;
competition?: string;
competitionName?: string;
venue?: string;
@@ -112,7 +114,15 @@ export const MatchModal: React.FC<MatchModalProps> = ({ isOpen, match, onClose,
role={onTeamClick ? 'button' : undefined}
tabIndex={onTeamClick ? 0 : undefined}
>
<Image src={assetUrl(match.home_logo_url) || '/logo192.png'} alt={match.home || 'Domácí'} boxSize="56px" objectFit="contain" />
<TeamLogo
teamId={match.home_id}
teamName={match.home}
facrLogo={match.home_logo_url}
size="custom"
alt={match.home || 'Domácí'}
boxSize="56px"
borderRadius="full"
/>
<Text fontWeight="semibold" noOfLines={1} textAlign="center">{sanitizeClubName(match.home) || 'Domácí'}</Text>
</VStack>
<VStack spacing={1} minW="120px">
@@ -157,7 +167,15 @@ export const MatchModal: React.FC<MatchModalProps> = ({ isOpen, match, onClose,
role={onTeamClick ? 'button' : undefined}
tabIndex={onTeamClick ? 0 : undefined}
>
<Image src={assetUrl(match.away_logo_url) || '/logo192.png'} alt={match.away || 'Hosté'} boxSize="56px" objectFit="contain" />
<TeamLogo
teamId={match.away_id}
teamName={match.away}
facrLogo={match.away_logo_url}
size="custom"
alt={match.away || 'Hosté'}
boxSize="56px"
borderRadius="full"
/>
<Text fontWeight="semibold" noOfLines={1} textAlign="center">{sanitizeClubName(match.away) || 'Hosté'}</Text>
</VStack>
</HStack>
@@ -81,7 +81,7 @@ const PhotosSection: React.FC<{ zoneramaUrl?: string | null }> = ({ zoneramaUrl
📸 Fotografie z{' '}
<Text
as="a"
href="https://zonerama.com"
href={zoneramaUrl || 'https://zonerama.com'}
target="_blank"
rel="noopener noreferrer"
fontWeight="600"