diff --git a/messages/en.json b/messages/en.json index 5ca66b1..58aafc1 100644 --- a/messages/en.json +++ b/messages/en.json @@ -68,7 +68,6 @@ }, "Notifications": { "title": "Notifications", - "read": "Read", "delete": "Delete" }, "Sessions": { diff --git a/src/actions/auth.ts b/src/actions/auth.ts index 19cb9ac..2da04c6 100644 --- a/src/actions/auth.ts +++ b/src/actions/auth.ts @@ -1,10 +1,22 @@ import { AxiosResponse } from 'axios'; import { apiClient } from '../lib/apiClient'; -export const getAuth = (login: string, password: string, locale: string ): Promise> => ( +export const getAuth = (locale: string, data: { login: string, password: string }): Promise> => ( apiClient.post( '/auth/login', - { login, password }, + data, + { + headers: { + 'X-User-Language': locale + } + } + ) +); + +export const getRegister = (locale: string): Promise> => ( + apiClient.post( + '/auth/register', + {}, { headers: { 'X-User-Language': locale diff --git a/src/actions/profile.ts b/src/actions/profile.ts new file mode 100644 index 0000000..8fcde21 --- /dev/null +++ b/src/actions/profile.ts @@ -0,0 +1,15 @@ +import { AxiosResponse } from 'axios'; +import { apiClient } from '../lib/apiClient'; + +export const setPersonData = (person: { login: string, password: string, role: string }, locale: string, jwt: string): Promise => ( + apiClient.post( + '/home/applyperson1', + { ...person }, + { + headers: { + 'X-User-Language': locale, + Authorization: `Bearer ${jwt}` + } + } + ) +); diff --git a/src/app/[locale]/account/information/page.tsx b/src/app/[locale]/account/(account)/information/page.tsx similarity index 98% rename from src/app/[locale]/account/information/page.tsx rename to src/app/[locale]/account/(account)/information/page.tsx index d21f33e..95d8933 100644 --- a/src/app/[locale]/account/information/page.tsx +++ b/src/app/[locale]/account/(account)/information/page.tsx @@ -34,7 +34,7 @@ export default function Information() { mentors and/or consultants of our application and/or website as well as other users of our services and suppliers. -

What Personal Date We Collect About You?

+

What Personal Data We Collect About You?

We may collect, use, store and transfer different kinds of personal data about you which we have grouped together as follows:
diff --git a/src/app/[locale]/account/(account)/layout.tsx b/src/app/[locale]/account/(account)/layout.tsx new file mode 100644 index 0000000..2c2d53d --- /dev/null +++ b/src/app/[locale]/account/(account)/layout.tsx @@ -0,0 +1,61 @@ +import React, { ReactNode } from 'react'; +import { Metadata } from 'next'; +import { useTranslations } from 'next-intl'; +import { AccountMenu } from '../../../../components/Account'; + +type AccountInnerLayoutProps = { + 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 AccountInnerLayout({ children }: AccountInnerLayoutProps) { + const t = useTranslations('Account'); + + const getMenuConfig = () => ROUTES.map((path) => ({ + path, + title: t(`menu.${path}`), + count: COUNTS[path] || undefined + })); + + return ( +
+
+
+
+ +
+
+
+ {children} +
+
+
+
+
+ ); +}; diff --git a/src/app/[locale]/account/messages/[textId]/page.tsx b/src/app/[locale]/account/(account)/messages/[textId]/page.tsx similarity index 85% rename from src/app/[locale]/account/messages/[textId]/page.tsx rename to src/app/[locale]/account/(account)/messages/[textId]/page.tsx index 3eee46f..f79a221 100644 --- a/src/app/[locale]/account/messages/[textId]/page.tsx +++ b/src/app/[locale]/account/(account)/messages/[textId]/page.tsx @@ -1,28 +1,28 @@ import React from 'react'; import { useTranslations } from 'next-intl'; -import { Link } from '../../../../../navigation'; +import { Link } from '../../../../../../navigation'; export function generateStaticParams({ - params: { locale, userId }, -}: { params: { locale: string, userId: string } }) { - const result: { locale: string, userId: string, textId: string }[] = []; + params: { locale }, +}: { params: { locale: string } }) { + const result: { locale: string, textId: string }[] = []; const chats = [{ textId: '1' }, { textId: '2' }, { textId: '3' }]; chats.forEach(({ textId }) => { - result.push({ locale, userId, textId }); + result.push({ locale, textId }); }); return result; } -export default function Message({ params }: { params: { userId: string, textId: string } }) { +export default function Message({ params }: { params: { textId: string } }) { const t = useTranslations('Account.Messages'); return ( <>
  1. - + {t('title')}
  2. diff --git a/src/app/[locale]/account/messages/page.tsx b/src/app/[locale]/account/(account)/messages/page.tsx similarity index 89% rename from src/app/[locale]/account/messages/page.tsx rename to src/app/[locale]/account/(account)/messages/page.tsx index 2222edb..98d8fa7 100644 --- a/src/app/[locale]/account/messages/page.tsx +++ b/src/app/[locale]/account/(account)/messages/page.tsx @@ -1,14 +1,15 @@ -import React from 'react'; +import React, { Suspense } from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; -import { Link } from '../../../../navigation'; +import { Link } from '../../../../../navigation'; +import { CustomInput } from '../../../../../components/view'; export const metadata: Metadata = { title: 'Bbuddy - Account - Messages', description: 'Bbuddy desc messages' }; -export default function Messages({ params }: { params: { userId: string } }) { +export default function Messages() { const t = useTranslations('Account.Messages'); return ( @@ -16,10 +17,13 @@ export default function Messages({ params }: { params: { userId: string } }) {
    1. {t('title')}
    + + +
    @@ -41,7 +45,7 @@ export default function Messages({ params }: { params: { userId: string } }) {
    @@ -60,7 +64,7 @@ export default function Messages({ params }: { params: { userId: string } }) {
    diff --git a/src/app/[locale]/account/notifications/page.tsx b/src/app/[locale]/account/(account)/notifications/page.tsx similarity index 90% rename from src/app/[locale]/account/notifications/page.tsx rename to src/app/[locale]/account/(account)/notifications/page.tsx index 006a9d8..3491dda 100644 --- a/src/app/[locale]/account/notifications/page.tsx +++ b/src/app/[locale]/account/(account)/notifications/page.tsx @@ -23,7 +23,6 @@ export default function Notifications() {
    25 may 2022
    @@ -34,7 +33,6 @@ export default function Notifications() {
    25 may 2022
    @@ -45,7 +43,6 @@ export default function Notifications() {
    25 may 2022
    diff --git a/src/app/[locale]/account/(account)/sessions/page.tsx b/src/app/[locale]/account/(account)/sessions/page.tsx new file mode 100644 index 0000000..7fc4acf --- /dev/null +++ b/src/app/[locale]/account/(account)/sessions/page.tsx @@ -0,0 +1,27 @@ +import React, { Suspense } from 'react'; +import type { Metadata } from 'next'; +import { useTranslations } from 'next-intl'; +import { SessionsTabs } from '../../../../../components/Account'; + +export const metadata: Metadata = { + title: 'Bbuddy - Account - Sessions', + description: 'Bbuddy desc sessions' +}; + +export default function Sessions() { + const t = useTranslations('Account.Sessions'); + + return ( + Loading...

    }> + +
    + ); +} diff --git a/src/app/[locale]/account/settings/change-password/page.tsx b/src/app/[locale]/account/(account)/settings/change-password/page.tsx similarity index 96% rename from src/app/[locale]/account/settings/change-password/page.tsx rename to src/app/[locale]/account/(account)/settings/change-password/page.tsx index e9c72a3..d794487 100644 --- a/src/app/[locale]/account/settings/change-password/page.tsx +++ b/src/app/[locale]/account/(account)/settings/change-password/page.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useTranslations } from 'next-intl'; -import { Link } from '../../../../../navigation'; +import { Link } from '../../../../../../navigation'; export default function ChangePassword({ params }: { params: { userId: string } }) { const t = useTranslations('Account.Settings'); diff --git a/src/app/[locale]/account/settings/page.tsx b/src/app/[locale]/account/(account)/settings/page.tsx similarity index 71% rename from src/app/[locale]/account/settings/page.tsx rename to src/app/[locale]/account/(account)/settings/page.tsx index 8f0c246..357ea03 100644 --- a/src/app/[locale]/account/settings/page.tsx +++ b/src/app/[locale]/account/(account)/settings/page.tsx @@ -1,7 +1,8 @@ -import React from 'react'; +import React, {Suspense} from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; -import {Link} from "../../../../navigation"; +import { Link } from '../../../../../navigation'; +import { CustomInput } from '../../../../../components/view'; export const metadata: Metadata = { title: 'Bbuddy - Account - Profile Settings', @@ -25,19 +26,19 @@ export default function Settings({ params }: { params: { userId: string } }) {
    {t('photo-desc')}
    - +
    - +
    - +
    - +
    - + {t('change-password')}
    diff --git a/src/app/[locale]/account/support/page.tsx b/src/app/[locale]/account/(account)/support/page.tsx similarity index 92% rename from src/app/[locale]/account/support/page.tsx rename to src/app/[locale]/account/(account)/support/page.tsx index 36ab43a..8ed974b 100644 --- a/src/app/[locale]/account/support/page.tsx +++ b/src/app/[locale]/account/(account)/support/page.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type { Metadata } from 'next'; -import {useTranslations} from "next-intl"; +import { useTranslations } from 'next-intl'; export const metadata: Metadata = { title: 'Bbuddy - Account - Help & Support', diff --git a/src/app/[locale]/account/(account)/work-with-us/coaching/add-offer/page.tsx b/src/app/[locale]/account/(account)/work-with-us/coaching/add-offer/page.tsx new file mode 100644 index 0000000..f321464 --- /dev/null +++ b/src/app/[locale]/account/(account)/work-with-us/coaching/add-offer/page.tsx @@ -0,0 +1,94 @@ +import React from 'react'; +import { Link } from '../../../../../../../navigation'; +import { CustomSelect } from '../../../../../../../components/view'; + +export default function AddOffer() { + return ( + <> +
      +
    1. + + Work With Us + +
    2. +
    3. + + Coaching + +
    4. +
    5. Add Offer
    6. +
    + +

    Select Topic

    +
    +
    + +
    +

    Life coaching

    +
    +
    +
    +
    Work-life Balance
    + +
    +
    +
    Strategic Session
    + +
    +
    +
    Personal Growth +
    + +
    +
    +
    Executive Coaching
    + +
    +
    +
    Career Planning
    + +
    +
    +
    +

    Business coaching

    +

    Offer Details

    +
    + +
    +
    + +
    +
    +