Skip to content

Commit 7ba8af0

Browse files
Fix club and translator designs
1 parent 3316855 commit 7ba8af0

File tree

3 files changed

+30
-44
lines changed

3 files changed

+30
-44
lines changed

src/components/FeaturedClubCard.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { Button } from '@/components/ui/button';
33
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
44
import { ExternalLink, Users, Gamepad2, Leaf, DollarSign, Music, Shield, Zap } from 'lucide-react';
5+
import EcoProductCarousel from '@/components/EcoProductCarousel';
56

67
interface PlatformLink {
78
name: string;
@@ -99,37 +100,40 @@ const FeaturedClubCard = ({ club }: { club: FeaturedClubProps }) => {
99100
{club.description}
100101
</p>
101102

102-
{/* Sections */}
103-
<div className="space-y-4 mb-6">
103+
{/* Sections - Horizontal Layout */}
104+
<div className="space-y-6 mb-6">
104105
{club.sections.map((section, index) => (
105-
<Card key={index} className="bg-alien-space-dark/60 border-alien-gold/20 backdrop-blur-sm">
106-
<CardHeader className="pb-3">
107-
<CardTitle className="flex items-center text-alien-gold text-sm font-nasalization">
108-
{section.icon}
109-
<span className="ml-2">{section.title}</span>
110-
</CardTitle>
111-
<CardDescription className="text-xs text-gray-300 font-[Exo]">
112-
{section.description}
113-
</CardDescription>
114-
</CardHeader>
115-
<CardContent className="pt-0">
116-
<div className="grid grid-cols-2 gap-2">
117-
{section.platforms.map((platform, pIndex) => (
106+
<div key={index} className="bg-alien-space-dark/60 border border-alien-gold/20 backdrop-blur-sm rounded-lg p-4">
107+
<div className="flex items-center text-alien-gold text-sm font-nasalization mb-3">
108+
{section.icon}
109+
<span className="ml-2">{section.title}</span>
110+
</div>
111+
<p className="text-xs text-gray-300 font-[Exo] mb-4">{section.description}</p>
112+
113+
{/* Special handling for EcoFlow product carousel */}
114+
{club.name === 'Δ EcoFlow' && section.title === 'Eco Products Catalog' ? (
115+
<div className="mt-4">
116+
<EcoProductCarousel />
117+
</div>
118+
) : (
119+
<div className="flex flex-wrap gap-2">
120+
{section.platforms.sort((a, b) => a.name.localeCompare(b.name)).map((platform, pIndex) => (
118121
<Button
119122
key={pIndex}
120123
variant="ghost"
121124
size="sm"
122-
className={`${section.color} text-white hover:bg-white/20 text-xs h-8 justify-start font-[Exo]`}
125+
className={`${section.color} text-white hover:bg-white/20 text-xs h-8 justify-center font-[Exo] min-w-[100px] flex-1 max-w-[140px]`}
123126
onClick={() => platform.url && window.open(platform.url, '_blank')}
124127
disabled={!platform.url}
125128
>
126-
<ExternalLink className="h-3 w-3 mr-1" />
129+
{platform.icon && <img src={platform.icon} alt={platform.name} className="h-3 w-3 mr-1" />}
130+
{!platform.icon && <ExternalLink className="h-3 w-3 mr-1" />}
127131
{platform.name}
128132
</Button>
129133
))}
130134
</div>
131-
</CardContent>
132-
</Card>
135+
)}
136+
</div>
133137
))}
134138
</div>
135139

src/components/Header/DesktopNav.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ const DesktopNav = () => {
3434
{ code: 'jp', name: '日本語 (Nihongo)', lang: 'ja' }
3535
];
3636

37-
const openTranslate = (provider: 'google' | 'deepl') => {
37+
const handleLanguageSelect = (lang: string) => {
3838
const url = window.location.href;
39-
if (provider === 'google') {
40-
window.open(`https://translate.google.com/translate?sl=auto&tl=es&u=${encodeURIComponent(url)}`, '_blank');
41-
} else {
42-
window.open(`https://www.deepl.com/translator#auto/es/${encodeURIComponent(url)}`, '_blank');
39+
// Try Google Translate first, fallback to DeepL
40+
try {
41+
window.open(`https://translate.google.com/translate?sl=auto&tl=${lang}&u=${encodeURIComponent(url)}`, '_blank');
42+
} catch (error) {
43+
window.open(`https://www.deepl.com/translator#auto/${lang}/${encodeURIComponent(url)}`, '_blank');
4344
}
4445
};
4546

@@ -114,6 +115,7 @@ const DesktopNav = () => {
114115
<DropdownMenuItem
115116
key={lang.code}
116117
className="flex items-center gap-3 text-alien-gold hover:text-alien-green hover:bg-alien-space-light/30 cursor-pointer p-3 rounded-lg transition-all duration-300"
118+
onSelect={(e) => { e.preventDefault(); handleLanguageSelect(lang.lang); }}
117119
>
118120
<img
119121
src={`https://flagcdn.com/w20/${lang.code}.png`}
@@ -123,18 +125,6 @@ const DesktopNav = () => {
123125
<span className="font-medium">{lang.name}</span>
124126
</DropdownMenuItem>
125127
))}
126-
<DropdownMenuItem
127-
className="flex items-center gap-3 text-alien-gold hover:text-alien-green hover:bg-alien-space-light/30 cursor-pointer p-3 rounded-lg transition-all duration-300"
128-
onSelect={(e) => { e.preventDefault(); openTranslate('google'); }}
129-
>
130-
<span className="font-medium">Traducir con Google</span>
131-
</DropdownMenuItem>
132-
<DropdownMenuItem
133-
className="flex items-center gap-3 text-alien-gold hover:text-alien-green hover:bg-alien-space-light/30 cursor-pointer p-3 rounded-lg transition-all duration-300"
134-
onSelect={(e) => { e.preventDefault(); openTranslate('deepl'); }}
135-
>
136-
<span className="font-medium">Traducir con DeepL</span>
137-
</DropdownMenuItem>
138128
</div>
139129
</DropdownMenuContent>
140130
</DropdownMenu>

src/pages/Clubs.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,6 @@ const Clubs: React.FC = () => {
407407
<FeaturedClubCard key={index} club={club} />
408408
))}
409409
</div>
410-
411-
{/* Special EcoFlow Product Showcase */}
412-
<div className="mt-8 bg-alien-space-dark/60 p-6 rounded-xl backdrop-blur-md border border-alien-gold/30">
413-
<h3 className="text-xl font-bold text-alien-gold mb-4 font-nasalization text-center">
414-
🌱 EcoFlow Product Showcase
415-
</h3>
416-
<EcoProductCarousel />
417-
</div>
418410
</div>
419411

420412
{/* All Clubs + Sidebar */}

0 commit comments

Comments
 (0)