diff --git a/app/[locale]/about/AboutPageClient.tsx b/app/[locale]/about/AboutPageClient.tsx new file mode 100644 index 00000000..71789014 --- /dev/null +++ b/app/[locale]/about/AboutPageClient.tsx @@ -0,0 +1,99 @@ +'use client' + +import React, { useState, useEffect } from 'react' +import { useTranslations } from 'next-intl' +import { useRouter, usePathname } from '~/i18n/navigation' +import { AboutTabs } from '~/utils/enums' + +import AboutPage from '~/components/about/AboutPage' +import UpdatesPage from '~/components/about/UpdatesPage' +import RoadmapPage from '~/components/about/RoadmapPage' +import SegmentedControl from '~/components/common/SegmentedControl' +import Segment from '~/components/common/Segment' + +export default function AboutPageClient() { + const t = useTranslations('common') + const router = useRouter() + const pathname = usePathname() + + const [currentTab, setCurrentTab] = useState(AboutTabs.About) + + useEffect(() => { + const parts = pathname.split('/') + const lastPart = parts[parts.length - 1] + + switch (lastPart) { + case 'about': + setCurrentTab(AboutTabs.About) + break + case 'updates': + setCurrentTab(AboutTabs.Updates) + break + case 'roadmap': + setCurrentTab(AboutTabs.Roadmap) + break + default: + setCurrentTab(AboutTabs.About) + } + }, [pathname]) + + function handleTabClicked(event: React.ChangeEvent) { + const value = event.target.value + router.push(`/${value}`) + + switch (value) { + case 'about': + setCurrentTab(AboutTabs.About) + break + case 'updates': + setCurrentTab(AboutTabs.Updates) + break + case 'roadmap': + setCurrentTab(AboutTabs.Roadmap) + break + } + } + + const currentSection = () => { + switch (currentTab) { + case AboutTabs.About: + return + case AboutTabs.Updates: + return + case AboutTabs.Roadmap: + return + } + } + + return ( +
+ + + {t('about.segmented_control.about')} + + + {t('about.segmented_control.updates')} + + + {t('about.segmented_control.roadmap')} + + + {currentSection()} +
+ ) +} \ No newline at end of file diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx new file mode 100644 index 00000000..a4b6c9e9 --- /dev/null +++ b/app/[locale]/about/page.tsx @@ -0,0 +1,28 @@ +import { Metadata } from 'next' +import { getTranslations } from 'next-intl/server' +import AboutPageClient from './AboutPageClient' + +export async function generateMetadata({ + params: { locale } +}: { + params: { locale: string } +}): Promise { + const t = await getTranslations({ locale, namespace: 'common' }) + + return { + title: t('page.titles.about'), + description: t('page.descriptions.about') + } +} + +export default async function AboutPage({ + params: { locale } +}: { + params: { locale: string } +}) { + return ( +
+ +
+ ) +} \ No newline at end of file diff --git a/app/[locale]/roadmap/RoadmapPageClient.tsx b/app/[locale]/roadmap/RoadmapPageClient.tsx new file mode 100644 index 00000000..50dd3f57 --- /dev/null +++ b/app/[locale]/roadmap/RoadmapPageClient.tsx @@ -0,0 +1,66 @@ +'use client' + +import React, { useState } from 'react' +import { useTranslations } from 'next-intl' +import { useRouter } from '~/i18n/navigation' +import { AboutTabs } from '~/utils/enums' + +import AboutPage from '~/components/about/AboutPage' +import UpdatesPage from '~/components/about/UpdatesPage' +import RoadmapPage from '~/components/about/RoadmapPage' +import SegmentedControl from '~/components/common/SegmentedControl' +import Segment from '~/components/common/Segment' + +export default function RoadmapPageClient() { + const t = useTranslations('common') + const router = useRouter() + const [currentTab] = useState(AboutTabs.Roadmap) + + function handleTabClicked(event: React.ChangeEvent) { + const value = event.target.value + router.push(`/${value}`) + } + + const currentSection = () => { + switch (currentTab) { + case AboutTabs.About: + return + case AboutTabs.Updates: + return + case AboutTabs.Roadmap: + return + } + } + + return ( +
+ + + {t('about.segmented_control.about')} + + + {t('about.segmented_control.updates')} + + + {t('about.segmented_control.roadmap')} + + + {currentSection()} +
+ ) +} \ No newline at end of file diff --git a/app/[locale]/roadmap/page.tsx b/app/[locale]/roadmap/page.tsx new file mode 100644 index 00000000..76fbb125 --- /dev/null +++ b/app/[locale]/roadmap/page.tsx @@ -0,0 +1,28 @@ +import { Metadata } from 'next' +import { getTranslations } from 'next-intl/server' +import RoadmapPageClient from './RoadmapPageClient' + +export async function generateMetadata({ + params: { locale } +}: { + params: { locale: string } +}): Promise { + const t = await getTranslations({ locale, namespace: 'common' }) + + return { + title: t('page.titles.roadmap'), + description: t('page.descriptions.roadmap') + } +} + +export default async function RoadmapPage({ + params: { locale } +}: { + params: { locale: string } +}) { + return ( +
+ +
+ ) +} \ No newline at end of file diff --git a/app/[locale]/updates/UpdatesPageClient.tsx b/app/[locale]/updates/UpdatesPageClient.tsx new file mode 100644 index 00000000..88faf9e9 --- /dev/null +++ b/app/[locale]/updates/UpdatesPageClient.tsx @@ -0,0 +1,66 @@ +'use client' + +import React, { useState } from 'react' +import { useTranslations } from 'next-intl' +import { useRouter } from '~/i18n/navigation' +import { AboutTabs } from '~/utils/enums' + +import AboutPage from '~/components/about/AboutPage' +import UpdatesPage from '~/components/about/UpdatesPage' +import RoadmapPage from '~/components/about/RoadmapPage' +import SegmentedControl from '~/components/common/SegmentedControl' +import Segment from '~/components/common/Segment' + +export default function UpdatesPageClient() { + const t = useTranslations('common') + const router = useRouter() + const [currentTab] = useState(AboutTabs.Updates) + + function handleTabClicked(event: React.ChangeEvent) { + const value = event.target.value + router.push(`/${value}`) + } + + const currentSection = () => { + switch (currentTab) { + case AboutTabs.About: + return + case AboutTabs.Updates: + return + case AboutTabs.Roadmap: + return + } + } + + return ( +
+ + + {t('about.segmented_control.about')} + + + {t('about.segmented_control.updates')} + + + {t('about.segmented_control.roadmap')} + + + {currentSection()} +
+ ) +} \ No newline at end of file diff --git a/app/[locale]/updates/page.tsx b/app/[locale]/updates/page.tsx new file mode 100644 index 00000000..787607ab --- /dev/null +++ b/app/[locale]/updates/page.tsx @@ -0,0 +1,28 @@ +import { Metadata } from 'next' +import { getTranslations } from 'next-intl/server' +import UpdatesPageClient from './UpdatesPageClient' + +export async function generateMetadata({ + params: { locale } +}: { + params: { locale: string } +}): Promise { + const t = await getTranslations({ locale, namespace: 'common' }) + + return { + title: t('page.titles.updates'), + description: t('page.descriptions.updates') + } +} + +export default async function UpdatesPage({ + params: { locale } +}: { + params: { locale: string } +}) { + return ( +
+ +
+ ) +} \ No newline at end of file