Skip to content

Commit a7365cb

Browse files
Revert to single language page
Reverted to a unified language system with a single landing page and dynamic language content via context. Removed per-language routes, restored language context setup, updated components (Header, Hero, Features, Screenshots, Benefits, CTA, Footer) to use translations from context, and simplified routing to a single page with internal language switching. Cleaned up PT/EN specific index pages and related files. X-Lovable-Edit-ID: edt-c96eddd9-9ef3-4353-9a67-9a04d8277c1d
2 parents 3647df8 + 1b0400a commit a7365cb

File tree

14 files changed

+266
-236
lines changed

14 files changed

+266
-236
lines changed

src/App.tsx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@ import { TooltipProvider } from "@/components/ui/tooltip";
44
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
55
import { BrowserRouter, Routes, Route } from "react-router-dom";
66
import { HelmetProvider } from "react-helmet-async";
7+
import { LanguageProvider } from "@/i18n/LanguageContext";
78
import Index from "./pages/Index";
8-
import IndexPT from "./pages/IndexPT";
9-
import IndexEN from "./pages/IndexEN";
109
import NotFound from "./pages/NotFound";
1110

1211
const queryClient = new QueryClient();
1312

1413
const App = () => (
1514
<HelmetProvider>
1615
<QueryClientProvider client={queryClient}>
17-
<TooltipProvider>
18-
<Toaster />
19-
<Sonner />
20-
<BrowserRouter>
21-
<Routes>
22-
<Route path="/" element={<Index />} />
23-
<Route path="/pt" element={<IndexPT />} />
24-
<Route path="/en" element={<IndexEN />} />
25-
<Route path="*" element={<NotFound />} />
26-
</Routes>
27-
</BrowserRouter>
28-
</TooltipProvider>
16+
<LanguageProvider>
17+
<TooltipProvider>
18+
<Toaster />
19+
<Sonner />
20+
<BrowserRouter>
21+
<Routes>
22+
<Route path="/" element={<Index />} />
23+
<Route path="*" element={<NotFound />} />
24+
</Routes>
25+
</BrowserRouter>
26+
</TooltipProvider>
27+
</LanguageProvider>
2928
</QueryClientProvider>
3029
</HelmetProvider>
3130
);

src/components/BenefitsSection.tsx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { Check } from "lucide-react";
2-
import { Translations } from "@/i18n/translations";
2+
import { useLanguage } from "@/i18n/LanguageContext";
33

4-
interface BenefitsSectionProps {
5-
t: Translations;
6-
}
4+
const BenefitsSection = () => {
5+
const { t } = useLanguage();
76

8-
const BenefitsSection = ({ t }: BenefitsSectionProps) => {
97
return (
108
<section id="beneficios" className="py-24">
119
<div className="container">
@@ -26,10 +24,7 @@ const BenefitsSection = ({ t }: BenefitsSectionProps) => {
2624

2725
<ul className="space-y-4">
2826
{t.benefits.list.map((benefit, index) => (
29-
<li
30-
key={index}
31-
className="flex items-center gap-4"
32-
>
27+
<li key={index} className="flex items-center gap-4">
3328
<div className="w-6 h-6 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0">
3429
<Check className="w-4 h-4 text-primary" />
3530
</div>
@@ -50,8 +45,12 @@ const BenefitsSection = ({ t }: BenefitsSectionProps) => {
5045
<span className="text-primary font-bold">A</span>
5146
</div>
5247
<div>
53-
<div className="font-semibold text-foreground">{t.benefits.mockup.workoutTitle}</div>
54-
<div className="text-sm text-muted-foreground">{t.benefits.mockup.today}, 18:30</div>
48+
<div className="font-semibold text-foreground">
49+
{t.benefits.mockup.workoutTitle}
50+
</div>
51+
<div className="text-sm text-muted-foreground">
52+
{t.benefits.mockup.today}, 18:30
53+
</div>
5554
</div>
5655
</div>
5756

@@ -61,7 +60,10 @@ const BenefitsSection = ({ t }: BenefitsSectionProps) => {
6160
{ name: "Supino Inclinado", sets: "3x12", weight: "60kg", pr: false },
6261
{ name: "Crucifixo", sets: "3x15", weight: "16kg", pr: false },
6362
].map((exercise, i) => (
64-
<div key={i} className="flex items-center justify-between py-3 border-b border-border/50 last:border-0">
63+
<div
64+
key={i}
65+
className="flex items-center justify-between py-3 border-b border-border/50 last:border-0"
66+
>
6567
<div>
6668
<div className="font-medium text-foreground flex items-center gap-2">
6769
{exercise.name}
@@ -71,7 +73,9 @@ const BenefitsSection = ({ t }: BenefitsSectionProps) => {
7173
</span>
7274
)}
7375
</div>
74-
<div className="text-sm text-muted-foreground">{exercise.sets}</div>
76+
<div className="text-sm text-muted-foreground">
77+
{exercise.sets}
78+
</div>
7579
</div>
7680
<div className="text-right">
7781
<div className="font-bold text-primary">{exercise.weight}</div>
@@ -83,7 +87,9 @@ const BenefitsSection = ({ t }: BenefitsSectionProps) => {
8387
{/* Progress Bar */}
8488
<div className="mt-6">
8589
<div className="flex justify-between text-sm mb-2">
86-
<span className="text-muted-foreground">{t.benefits.mockup.weeklyVolume}</span>
90+
<span className="text-muted-foreground">
91+
{t.benefits.mockup.weeklyVolume}
92+
</span>
8793
<span className="text-foreground font-medium">12.450 kg</span>
8894
</div>
8995
<div className="h-2 bg-secondary rounded-full overflow-hidden">

src/components/CTASection.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Button } from "@/components/ui/button";
22
import { Play, Star } from "lucide-react";
3-
import { Translations } from "@/i18n/translations";
3+
import { useLanguage } from "@/i18n/LanguageContext";
44
import logo from "@/assets/logo.png";
5-
interface CTASectionProps {
6-
t: Translations;
7-
}
8-
const CTASection = ({ t }: CTASectionProps) => {
5+
6+
const CTASection = () => {
7+
const { t } = useLanguage();
8+
99
return (
1010
<section className="py-24 relative overflow-hidden">
1111
{/* Background */}
@@ -69,4 +69,5 @@ const CTASection = ({ t }: CTASectionProps) => {
6969
</section>
7070
);
7171
};
72+
7273
export default CTASection;

src/components/FeaturesSection.tsx

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
import { Dumbbell, FileText, Calculator, TrendingUp, BarChart3, Cloud, Plus } from "lucide-react";
2-
import { Translations } from "@/i18n/translations";
3-
interface FeaturesSectionProps {
4-
t: Translations;
5-
}
6-
const FeaturesSection = ({
7-
t
8-
}: FeaturesSectionProps) => {
9-
const features = [{
10-
icon: Dumbbell,
11-
title: t.features.workoutLog.title,
12-
description: t.features.workoutLog.description
13-
}, {
14-
icon: FileText,
15-
title: t.features.workoutSheets.title,
16-
description: t.features.workoutSheets.description
17-
}, {
18-
icon: Calculator,
19-
title: t.features.calculators.title,
20-
description: t.features.calculators.description
21-
}, {
22-
icon: TrendingUp,
23-
title: t.features.bodyTracking.title,
24-
description: t.features.bodyTracking.description
25-
}, {
26-
icon: BarChart3,
27-
title: t.features.progressAnalysis.title,
28-
description: t.features.progressAnalysis.description
29-
}, {
30-
icon: Cloud,
31-
title: t.features.cloudSync.title,
32-
description: t.features.cloudSync.description
33-
}];
34-
return <section id="funcionalidades" className="py-24 bg-secondary/30">
2+
import { useLanguage } from "@/i18n/LanguageContext";
3+
4+
const FeaturesSection = () => {
5+
const { t } = useLanguage();
6+
7+
const features = [
8+
{
9+
icon: Dumbbell,
10+
title: t.features.workoutLog.title,
11+
description: t.features.workoutLog.description,
12+
},
13+
{
14+
icon: FileText,
15+
title: t.features.workoutSheets.title,
16+
description: t.features.workoutSheets.description,
17+
},
18+
{
19+
icon: Calculator,
20+
title: t.features.calculators.title,
21+
description: t.features.calculators.description,
22+
},
23+
{
24+
icon: TrendingUp,
25+
title: t.features.bodyTracking.title,
26+
description: t.features.bodyTracking.description,
27+
},
28+
{
29+
icon: BarChart3,
30+
title: t.features.progressAnalysis.title,
31+
description: t.features.progressAnalysis.description,
32+
},
33+
{
34+
icon: Cloud,
35+
title: t.features.cloudSync.title,
36+
description: t.features.cloudSync.description,
37+
},
38+
];
39+
40+
return (
41+
<section id="funcionalidades" className="py-24 bg-secondary/30">
3542
<div className="container">
3643
{/* Section Header */}
3744
<div className="text-center max-w-2xl mx-auto mb-16">
@@ -42,16 +49,17 @@ const FeaturesSection = ({
4249
{t.features.title1}
4350
<span className="text-gradient">{t.features.title2}</span>
4451
</h2>
45-
<p className="text-muted-foreground text-lg">
46-
{t.features.subtitle}
47-
</p>
52+
<p className="text-muted-foreground text-lg">{t.features.subtitle}</p>
4853
</div>
4954

5055
{/* Features Grid */}
5156
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
52-
{features.map((feature, index) => <div key={feature.title} className="group p-8 rounded-2xl bg-gradient-card border border-border hover:border-primary/50 transition-all duration-300 hover:-translate-y-1 shadow-card" style={{
53-
animationDelay: `${index * 100}ms`
54-
}}>
57+
{features.map((feature, index) => (
58+
<div
59+
key={feature.title}
60+
className="group p-8 rounded-2xl bg-gradient-card border border-border hover:border-primary/50 transition-all duration-300 hover:-translate-y-1 shadow-card"
61+
style={{ animationDelay: `${index * 100}ms` }}
62+
>
5563
<div className="w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center mb-6 group-hover:bg-primary/20 transition-colors">
5664
<feature.icon className="w-7 h-7 text-primary" />
5765
</div>
@@ -61,7 +69,8 @@ const FeaturesSection = ({
6169
<p className="text-muted-foreground leading-relaxed">
6270
{feature.description}
6371
</p>
64-
</div>)}
72+
</div>
73+
))}
6574
</div>
6675

6776
{/* Extra Feature */}
@@ -70,13 +79,17 @@ const FeaturesSection = ({
7079
<Plus className="w-6 h-6 text-primary" />
7180
</div>
7281
<div>
73-
<h3 className="font-bold text-foreground">{t.features.customExercises.title}</h3>
82+
<h3 className="font-bold text-foreground">
83+
{t.features.customExercises.title}
84+
</h3>
7485
<p className="text-muted-foreground text-sm">
7586
{t.features.customExercises.description}
7687
</p>
7788
</div>
7889
</div>
7990
</div>
80-
</section>;
91+
</section>
92+
);
8193
};
82-
export default FeaturesSection;
94+
95+
export default FeaturesSection;

src/components/Footer.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import { Link } from "react-router-dom";
2-
import { Translations } from "@/i18n/translations";
2+
import { useLanguage } from "@/i18n/LanguageContext";
33
import logo from "@/assets/logo.png";
44

5-
interface FooterProps {
6-
lang: "pt" | "en";
7-
t: Translations;
8-
}
9-
10-
const Footer = ({ lang, t }: FooterProps) => {
5+
const Footer = () => {
6+
const { t } = useLanguage();
117
const currentYear = new Date().getFullYear();
128

139
return (
1410
<footer className="py-12 border-t border-border">
1511
<div className="container">
1612
<div className="flex flex-col md:flex-row items-center justify-between gap-6">
1713
{/* Logo */}
18-
<Link to={`/${lang}`} className="flex items-center gap-3">
14+
<Link to="/" className="flex items-center gap-3">
1915
<img
2016
src={logo}
2117
alt="WorkoutLogs"

src/components/Header.tsx

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { Button } from "@/components/ui/button";
22
import { Link } from "react-router-dom";
3-
import { Translations } from "@/i18n/translations";
3+
import { useLanguage } from "@/i18n/LanguageContext";
4+
import LanguageSwitcher from "./LanguageSwitcher";
45
import logo from "@/assets/logo.png";
5-
interface HeaderProps {
6-
lang: "pt" | "en";
7-
t: Translations;
8-
}
9-
const Header = ({ lang, t }: HeaderProps) => {
10-
const otherLang = lang === "pt" ? "en" : "pt";
11-
const otherLangLabel = lang === "pt" ? "EN" : "PT";
6+
7+
const Header = () => {
8+
const { t } = useLanguage();
9+
1210
return (
1311
<header className="fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-lg border-b border-border">
1412
<div className="container flex items-center justify-between h-16">
15-
<Link to={`/${lang}`} className="flex items-center gap-3 group">
13+
<Link to="/" className="flex items-center gap-3 group">
1614
<img
1715
src={logo}
1816
alt="WorkoutLogs"
@@ -39,29 +37,7 @@ const Header = ({ lang, t }: HeaderProps) => {
3937
</nav>
4038

4139
<div className="flex items-center gap-4">
42-
{/* Language Switcher */}
43-
<div className="flex items-center gap-1 bg-secondary rounded-full p-1">
44-
<Link
45-
to="/pt"
46-
className={`px-3 py-1.5 rounded-full text-sm font-medium transition-all ${
47-
lang === "pt"
48-
? "bg-primary text-primary-foreground"
49-
: "text-muted-foreground hover:text-foreground"
50-
}`}
51-
>
52-
PT
53-
</Link>
54-
<Link
55-
to="/en"
56-
className={`px-3 py-1.5 rounded-full text-sm font-medium transition-all ${
57-
lang === "en"
58-
? "bg-primary text-primary-foreground"
59-
: "text-muted-foreground hover:text-foreground"
60-
}`}
61-
>
62-
EN
63-
</Link>
64-
</div>
40+
<LanguageSwitcher />
6541

6642
<Button variant="cta" size="sm" asChild className="hidden sm:flex">
6743
<a
@@ -77,4 +53,5 @@ const Header = ({ lang, t }: HeaderProps) => {
7753
</header>
7854
);
7955
};
56+
8057
export default Header;

src/components/HeroSection.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Button } from "@/components/ui/button";
22
import { Play, ChevronDown } from "lucide-react";
3-
import { Translations } from "@/i18n/translations";
3+
import { useLanguage } from "@/i18n/LanguageContext";
44
import logo from "@/assets/logo.png";
5-
interface HeroSectionProps {
6-
t: Translations;
7-
}
8-
const HeroSection = ({ t }: HeroSectionProps) => {
5+
6+
const HeroSection = () => {
7+
const { t } = useLanguage();
8+
99
return (
1010
<section className="relative min-h-screen flex items-center justify-center overflow-hidden bg-gradient-hero pt-16 pb-24">
1111
{/* Background Effects */}
@@ -99,4 +99,5 @@ const HeroSection = ({ t }: HeroSectionProps) => {
9999
</section>
100100
);
101101
};
102+
102103
export default HeroSection;

0 commit comments

Comments
 (0)