diff --git a/.gitignore b/.gitignore index 2a4890b..22c6c12 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ /out/ # production -/build +/dist # ide /.idea diff --git a/messages/de.json b/messages/de.json index 0d993c5..4c3ff5b 100644 --- a/messages/de.json +++ b/messages/de.json @@ -21,6 +21,15 @@ "settings": "Profile Settings", "messages": "Messages", "work-with-us": "Work With Us" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Messages" } }, "Footer": { diff --git a/messages/en.json b/messages/en.json index 9455027..d49cd05 100644 --- a/messages/en.json +++ b/messages/en.json @@ -22,6 +22,15 @@ "settings": "Profile Settings", "messages": "Messages", "work-with-us": "Work With Us" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Messages" } }, "Footer": { diff --git a/messages/es.json b/messages/es.json index 0d993c5..4c3ff5b 100644 --- a/messages/es.json +++ b/messages/es.json @@ -21,6 +21,15 @@ "settings": "Profile Settings", "messages": "Messages", "work-with-us": "Work With Us" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Messages" } }, "Footer": { diff --git a/messages/fr.json b/messages/fr.json index 0d993c5..4c3ff5b 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -21,6 +21,15 @@ "settings": "Profile Settings", "messages": "Messages", "work-with-us": "Work With Us" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Messages" } }, "Footer": { diff --git a/messages/it.json b/messages/it.json index 0d993c5..4c3ff5b 100644 --- a/messages/it.json +++ b/messages/it.json @@ -21,6 +21,15 @@ "settings": "Profile Settings", "messages": "Messages", "work-with-us": "Work With Us" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Messages" } }, "Footer": { diff --git a/messages/ru.json b/messages/ru.json index f7cc538..6cde3f8 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -21,6 +21,15 @@ "settings": "Настройки профиля", "messages": "Сообщения", "work-with-us": "Работать с нами" + }, + "WorkWithUs": { + "title": "Become a BBuddy Expert", + "insert-info": "Insert your personal information to start your journey as a BBuddy Expert", + "start": "Get Started", + "base-text": "Your info can either be added or amended at anytime" + }, + "Messages": { + "title": "Сообщения" } }, "Footer": { diff --git a/next.config.js b/next.config.js index deff1b7..94984d6 100644 --- a/next.config.js +++ b/next.config.js @@ -13,7 +13,10 @@ const nextConfig = { }, sassOptions: { includePaths: [path.join(__dirname, 'styles')], - } + }, + output: 'export', + cleanDistDir: true, + distDir: 'dist' }; module.exports = withNextIntl(nextConfig); diff --git a/src/app/[locale]/(main)/layout.tsx b/src/app/[locale]/(main)/layout.tsx index 0f3f494..5d60658 100644 --- a/src/app/[locale]/(main)/layout.tsx +++ b/src/app/[locale]/(main)/layout.tsx @@ -1,6 +1,5 @@ import React, { ReactNode } from 'react'; import { getTranslations } from 'next-intl/server'; -import { Header, Footer } from '../../../components/Page'; export async function generateMetadata({ params: { locale } @@ -13,23 +12,18 @@ export async function generateMetadata({ }; } -export default function MainLayout({ children, news, directions, experts, params: { locale } }: { +export default function MainLayout({ children, news, directions, experts }: { children: ReactNode, news: ReactNode, directions: ReactNode, - experts: ReactNode, - params: { locale: string } + experts: ReactNode }) { return ( -
-
-
- {children} - {news} - {directions} - {experts} -
-
+ <> + {children} + {news} + {directions} + {experts} + ); }; diff --git a/src/app/[locale]/[userId]/layout.tsx b/src/app/[locale]/[userId]/layout.tsx index dbe0587..107c290 100644 --- a/src/app/[locale]/[userId]/layout.tsx +++ b/src/app/[locale]/[userId]/layout.tsx @@ -1,15 +1,64 @@ -import React from 'react'; +import React, { ReactNode } from 'react'; +import { Metadata } from 'next'; +import { notFound } from 'next/navigation'; +import { useTranslations } from 'next-intl'; import { AccountMenu } from '../../../components/Account'; -export default function Layout({ children }: { children: React.ReactNode }) { +type AccountLayoutProps = { + children: ReactNode; + params: Record; +}; + +export const metadata: Metadata = { + title: 'Bbuddy User Account' +}; + +export function generateStaticParams({ + params: { locale }, +}: { params: { locale: string } }) { + const result: { locale: string, userId: string }[] = []; + const users = [{ userId: '1' }, { userId: '2' }]; + + users.forEach(({ userId }) => { + result.push({ locale, userId }); + }); + + return result; +} + +const ROUTES = ['sessions', 'notifications', 'support', 'information', 'settings', 'messages', 'work-with-us']; +const COUNTS: Record = { + sessions: 12, + notifications: 5, + messages: 113 +}; + + +export default function AccountLayout({ children, params }: AccountLayoutProps) { + if (!params?.userId || isNaN(Number(params?.userId))) notFound(); + + const t = useTranslations('Account'); + + const getMenuConfig = () => ROUTES.map((path) => ({ + path, + title: t(`menu.${path}`), + count: COUNTS[path] || undefined + })); return ( -
- -
{children}
-
- ) -} +
+
+
+
+ +
+
+
+ {children} +
+
+
+
+
+ ); +}; diff --git a/src/app/[locale]/[userId]/messages/[textId]/page.tsx b/src/app/[locale]/[userId]/messages/[textId]/page.tsx new file mode 100644 index 0000000..3eee46f --- /dev/null +++ b/src/app/[locale]/[userId]/messages/[textId]/page.tsx @@ -0,0 +1,69 @@ +import React from 'react'; +import { useTranslations } from 'next-intl'; +import { Link } from '../../../../../navigation'; + +export function generateStaticParams({ + params: { locale, userId }, +}: { params: { locale: string, userId: string } }) { + const result: { locale: string, userId: string, textId: string }[] = []; + const chats = [{ textId: '1' }, { textId: '2' }, { textId: '3' }]; + + chats.forEach(({ textId }) => { + result.push({ locale, userId, textId }); + }); + + return result; +} + +export default function Message({ params }: { params: { userId: string, textId: string } }) { + const t = useTranslations('Account.Messages'); + + return ( + <> +
    +
  1. + + {t('title')} + +
  2. +
  3. {`Person ${params.textId}`}
  4. +
+ +
+
+
+
+
+ +
+
+ 🤩 It all for you! + + 07.09.2022 +
+
+
+
+
+
+ +
+
+ 🤩 It all for you! + 07.09.2022 +
+
+
+
+
+