diff --git a/messages/en.json b/messages/en.json index 1c54f5a..cbee258 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,14 +1,4 @@ { - "Header": { - "registration": "Registration", - "enter": "Enter", - "account": "My Account", - "menu": { - "bb-client": "Start grow with BB", - "bb-expert": "Become BB Expert", - "blog": "Blog&News" - } - }, "Main": { "title": "Bbuddy - Main", "description": "Bbuddy desc", @@ -29,15 +19,6 @@ "header-desc": "B Buddy is an application for active people interested in growth on all fronts — personal, professional and business. Right now they are looking for you." }, "Account": { - "menu": { - "sessions": "Upcoming Sessions", - "notifications": "Notification", - "support": "Help & Support", - "information": "Legal Information", - "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", diff --git a/package-lock.json b/package-lock.json index 168e126..cfa03e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@ant-design/cssinjs": "^1.18.1", "@ant-design/icons": "^5.2.6", + "@ant-design/nextjs-registry": "^1.0.0", "antd": "^5.12.1", "antd-img-crop": "^4.21.0", "axios": "^1.6.5", @@ -56,15 +57,15 @@ } }, "node_modules/@ant-design/cssinjs": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.18.1.tgz", - "integrity": "sha512-1JURAPrsjK1GwpqByTq3bJ7nF7lbMKDZpehqeR2n8/IR5O58/W1U4VcOeaw5ZyTHri3tEMcom7dyP2tvxpW54g==", + "version": "1.18.5", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.18.5.tgz", + "integrity": "sha512-Ub4n3d+MAX/qtE5S9PM8iOn5ocU7GUAIC4Adc2X8UCMXnsRRfpJBHsBdtQ1qoAuaQ7lU2M1BTCuJ+fkv4fOWiw==", "dependencies": { "@babel/runtime": "^7.11.1", "@emotion/hash": "^0.8.0", "@emotion/unitless": "^0.7.5", "classnames": "^2.3.1", - "csstype": "3.1.2", + "csstype": "^3.1.3", "rc-util": "^5.35.0", "stylis": "^4.0.13" }, @@ -97,6 +98,18 @@ "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.3.1.tgz", "integrity": "sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==" }, + "node_modules/@ant-design/nextjs-registry": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@ant-design/nextjs-registry/-/nextjs-registry-1.0.0.tgz", + "integrity": "sha512-kU1K1UOhwrF6DPv73MhuL5a6U4e6/TiFapeLUt/c/kch9h5qFwEaJPb4RSJKNw0PRBfqCAPS011wVm4wYcrqbQ==", + "peerDependencies": { + "@ant-design/cssinjs": "^1.18.2", + "antd": "^5.0.0", + "next": "^14.0.0", + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, "node_modules/@ant-design/react-slick": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@ant-design/react-slick/-/react-slick-1.0.2.tgz", @@ -1524,9 +1537,9 @@ } }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/damerau-levenshtein": { "version": "1.0.8", @@ -5355,15 +5368,15 @@ } }, "@ant-design/cssinjs": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.18.1.tgz", - "integrity": "sha512-1JURAPrsjK1GwpqByTq3bJ7nF7lbMKDZpehqeR2n8/IR5O58/W1U4VcOeaw5ZyTHri3tEMcom7dyP2tvxpW54g==", + "version": "1.18.5", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.18.5.tgz", + "integrity": "sha512-Ub4n3d+MAX/qtE5S9PM8iOn5ocU7GUAIC4Adc2X8UCMXnsRRfpJBHsBdtQ1qoAuaQ7lU2M1BTCuJ+fkv4fOWiw==", "requires": { "@babel/runtime": "^7.11.1", "@emotion/hash": "^0.8.0", "@emotion/unitless": "^0.7.5", "classnames": "^2.3.1", - "csstype": "3.1.2", + "csstype": "^3.1.3", "rc-util": "^5.35.0", "stylis": "^4.0.13" } @@ -5385,6 +5398,12 @@ "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.3.1.tgz", "integrity": "sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==" }, + "@ant-design/nextjs-registry": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@ant-design/nextjs-registry/-/nextjs-registry-1.0.0.tgz", + "integrity": "sha512-kU1K1UOhwrF6DPv73MhuL5a6U4e6/TiFapeLUt/c/kch9h5qFwEaJPb4RSJKNw0PRBfqCAPS011wVm4wYcrqbQ==", + "requires": {} + }, "@ant-design/react-slick": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@ant-design/react-slick/-/react-slick-1.0.2.tgz", @@ -6413,9 +6432,9 @@ } }, "csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "damerau-levenshtein": { "version": "1.0.8", diff --git a/package.json b/package.json index 25dc63f..35d2112 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@ant-design/cssinjs": "^1.18.1", "@ant-design/icons": "^5.2.6", + "@ant-design/nextjs-registry": "^1.0.0", "antd": "^5.12.1", "antd-img-crop": "^4.21.0", "axios": "^1.6.5", diff --git a/src/app/[locale]/(main)/@directions/page.tsx b/src/app/[locale]/(main)/@directions/page.tsx index 3aa0deb..339743a 100644 --- a/src/app/[locale]/(main)/@directions/page.tsx +++ b/src/app/[locale]/(main)/@directions/page.tsx @@ -9,13 +9,13 @@ export default function Directions() {
- +
Work Life Balance
- 23 experts | - 245 offers + 23 experts | + 245 offers
@@ -23,13 +23,13 @@ export default function Directions() {
- +
Strategic Session
- 23 experts | - 245 offers + 23 experts | + 245 offers
@@ -37,13 +37,13 @@ export default function Directions() {
- +
Personal Growth
@@ -51,13 +51,13 @@ export default function Directions() {
- +
Career Planning
@@ -65,13 +65,13 @@ export default function Directions() {
- +
Executive Coaching
@@ -79,13 +79,13 @@ export default function Directions() {
- +
Career Development
diff --git a/src/app/[locale]/account/(account)/information/page.tsx b/src/app/[locale]/account/(account)/information/page.tsx index 95d8933..42e1f74 100644 --- a/src/app/[locale]/account/(account)/information/page.tsx +++ b/src/app/[locale]/account/(account)/information/page.tsx @@ -1,19 +1,20 @@ import React from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Information', description: 'Bbuddy desc information' }; -export default function Information() { +export default function Information({ params: { locale } }: { params: { locale: string } }) { const t = useTranslations('Account.LegalInformation'); return ( <>
    -
  1. {t('title')}
  2. +
  3. {i18nText('accountMenu.information', locale)}
Welcome to the B BUDDY LTD’s privacy policy.
diff --git a/src/app/[locale]/account/(account)/layout.tsx b/src/app/[locale]/account/(account)/layout.tsx index b154c58..5c46a60 100644 --- a/src/app/[locale]/account/(account)/layout.tsx +++ b/src/app/[locale]/account/(account)/layout.tsx @@ -29,7 +29,7 @@ export default function AccountInnerLayout({ children, params: { locale } }: Acc
- +
diff --git a/src/app/[locale]/account/(account)/messages/[textId]/page.tsx b/src/app/[locale]/account/(account)/messages/[textId]/page.tsx index f79a221..669063c 100644 --- a/src/app/[locale]/account/(account)/messages/[textId]/page.tsx +++ b/src/app/[locale]/account/(account)/messages/[textId]/page.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { useTranslations } from 'next-intl'; import { Link } from '../../../../../../navigation'; +import { i18nText } from '../../../../../../i18nKeys'; export function generateStaticParams({ params: { locale }, @@ -15,7 +16,7 @@ export function generateStaticParams({ return result; } -export default function Message({ params }: { params: { textId: string } }) { +export default function Message({ params }: { params: { locale: string, textId: string } }) { const t = useTranslations('Account.Messages'); return ( @@ -23,7 +24,7 @@ export default function Message({ params }: { params: { textId: string } }) {
  1. - {t('title')} + {i18nText('accountMenu.messages', params.locale)}
  2. {`Person ${params.textId}`}
  3. diff --git a/src/app/[locale]/account/(account)/messages/page.tsx b/src/app/[locale]/account/(account)/messages/page.tsx index 98d8fa7..56b40d6 100644 --- a/src/app/[locale]/account/(account)/messages/page.tsx +++ b/src/app/[locale]/account/(account)/messages/page.tsx @@ -2,23 +2,24 @@ import React, { Suspense } from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; import { Link } from '../../../../../navigation'; -import { CustomInput } from '../../../../../components/view'; +import { CustomInput } from '../../../../../components/view/CustomInput'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Messages', description: 'Bbuddy desc messages' }; -export default function Messages() { +export default function Messages({ params: { locale } }: { params: { locale: string } }) { const t = useTranslations('Account.Messages'); return ( <>
      -
    1. {t('title')}
    2. +
    3. {i18nText('accountMenu.messages', locale)}
    - +
    -
    - David - 14 -
    -
    - Lorem ipsum dolor sit at, consecte... -
    -
    - 25 may +
    +
    + David + 14 +
    +
    + Lorem ipsum dolor sit at, consecte... +
    +
    + 25 may +
    @@ -52,12 +55,14 @@ export default function Messages() {
-
David
-
- Lorem ipsum dolor sit at, consecte... -
-
- 25 may +
+
David
+
+ Lorem ipsum dolor sit at, consecte... +
+
+ 25 may +
@@ -71,12 +76,14 @@ export default function Messages() {
-
David
-
- Lorem ipsum dolor sit at, consecte... -
-
- 25 may +
+
David
+
+ Lorem ipsum dolor sit at, consecte... +
+
+ 25 may +
diff --git a/src/app/[locale]/account/(account)/notifications/page.tsx b/src/app/[locale]/account/(account)/notifications/page.tsx index 3491dda..0806009 100644 --- a/src/app/[locale]/account/(account)/notifications/page.tsx +++ b/src/app/[locale]/account/(account)/notifications/page.tsx @@ -1,19 +1,26 @@ import React from 'react'; import type { Metadata } from 'next'; -import { useTranslations } from 'next-intl'; +import dayjs from 'dayjs'; +import 'dayjs/locale/ru'; +import 'dayjs/locale/en'; +import 'dayjs/locale/de'; +import 'dayjs/locale/it'; +import 'dayjs/locale/fr'; +import 'dayjs/locale/es'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Notifications', description: 'Bbuddy desc notifications' }; -export default function Notifications() { - const t = useTranslations('Account.Notifications'); +export default function Notifications({ params: { locale } }: { params: { locale: string } }) { + const date = dayjs('2022-05-22').locale(locale); return ( <>
    -
  1. {t('title')}
  2. +
  3. {i18nText('accountMenu.notifications', locale)}
@@ -21,9 +28,9 @@ export default function Notifications() {
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc auctor leo eu justo molestie
-
25 may 2022
+
{date.format('D MMMM YYYY')}
@@ -31,9 +38,9 @@ export default function Notifications() {
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc auctor leo eu justo molestie
-
25 may 2022
+
{date.format('D MMMM YYYY')}
@@ -41,9 +48,9 @@ export default function Notifications() {
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc auctor leo eu justo molestie
-
25 may 2022
+
{date.format('D MMMM YYYY')}
diff --git a/src/app/[locale]/account/(account)/sessions/page.tsx b/src/app/[locale]/account/(account)/sessions/page.tsx index 148dcbb..6262afe 100644 --- a/src/app/[locale]/account/(account)/sessions/page.tsx +++ b/src/app/[locale]/account/(account)/sessions/page.tsx @@ -15,13 +15,6 @@ export default function Sessions({ params: { locale } }: { params: { locale: str Loading...

}>
); diff --git a/src/app/[locale]/account/(account)/settings/change-password/page.tsx b/src/app/[locale]/account/(account)/settings/change-password/page.tsx index d794487..f0e03b0 100644 --- a/src/app/[locale]/account/(account)/settings/change-password/page.tsx +++ b/src/app/[locale]/account/(account)/settings/change-password/page.tsx @@ -1,31 +1,29 @@ import React from 'react'; -import { useTranslations } from 'next-intl'; import { Link } from '../../../../../../navigation'; +import { i18nText } from '../../../../../../i18nKeys/'; -export default function ChangePassword({ params }: { params: { userId: string } }) { - const t = useTranslations('Account.Settings'); - +export default function ChangePassword({ params: { locale } }: { params: { locale: string } }) { return ( <>
  1. - - {t('title')} + + {i18nText('accountMenu.settings', locale)}
  2. -
  3. {t('change-password')}
  4. +
  5. {i18nText('changePass', locale)}
- +
- +
- +
- +
); diff --git a/src/app/[locale]/account/(account)/settings/page.tsx b/src/app/[locale]/account/(account)/settings/page.tsx index ea3de58..691e68a 100644 --- a/src/app/[locale]/account/(account)/settings/page.tsx +++ b/src/app/[locale]/account/(account)/settings/page.tsx @@ -2,6 +2,7 @@ import React, { Suspense } from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; import { ProfileSettings } from '../../../../../components/Account'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Profile Settings', @@ -14,19 +15,10 @@ export default function Settings({ params: { locale } }: { params: { locale: str return ( <>
    -
  1. {t('title')}
  2. +
  3. {i18nText('accountMenu.settings', locale)}
- + ); diff --git a/src/app/[locale]/account/(account)/support/page.tsx b/src/app/[locale]/account/(account)/support/page.tsx index 8ed974b..2443916 100644 --- a/src/app/[locale]/account/(account)/support/page.tsx +++ b/src/app/[locale]/account/(account)/support/page.tsx @@ -1,19 +1,17 @@ import React from 'react'; import type { Metadata } from 'next'; -import { useTranslations } from 'next-intl'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Help & Support', description: 'Bbuddy desc help & support' }; -export default function Support() { - const t = useTranslations('Account.Support'); - +export default function Support({ params: { locale } }: { params: { locale: string } }) { return ( <>
    -
  1. {t('title')}
  2. +
  3. {i18nText('accountMenu.support', locale)}
some text 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 index f321464..04ec673 100644 --- 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 @@ -1,6 +1,6 @@ import React from 'react'; import { Link } from '../../../../../../../navigation'; -import { CustomSelect } from '../../../../../../../components/view'; +import { CustomSelect } from '../../../../../../../components/view/CustomSelect'; export default function AddOffer() { return ( diff --git a/src/app/[locale]/account/(account)/work-with-us/new-topic/page.tsx b/src/app/[locale]/account/(account)/work-with-us/new-topic/page.tsx index 249ba8a..a7b33ed 100644 --- a/src/app/[locale]/account/(account)/work-with-us/new-topic/page.tsx +++ b/src/app/[locale]/account/(account)/work-with-us/new-topic/page.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Link } from '../../../../../../navigation'; -import { CustomSelect } from '../../../../../../components/view'; +import { CustomSelect } from '../../../../../../components/view/CustomSelect'; export default function NewTopic() { return ( diff --git a/src/app/[locale]/account/(account)/work-with-us/page.tsx b/src/app/[locale]/account/(account)/work-with-us/page.tsx index 783130c..08c2b83 100644 --- a/src/app/[locale]/account/(account)/work-with-us/page.tsx +++ b/src/app/[locale]/account/(account)/work-with-us/page.tsx @@ -1,27 +1,28 @@ import React from 'react'; import type { Metadata } from 'next'; import { useTranslations } from 'next-intl'; +import { i18nText } from '../../../../../i18nKeys'; export const metadata: Metadata = { title: 'Bbuddy - Account - Work with us', description: 'Bbuddy desc work with us' }; -export default function WorkWithUs() { +export default function WorkWithUs({ params: { locale } }: { params: { locale: string } }) { const t = useTranslations('Account.WorkWithUs'); return ( <>
    -
  1. {t('title')}
  2. +
  3. {i18nText('accountMenu.work-with-us', locale)}
-
{t('insert-info')}
- -
{t('base-text')}
+
{i18nText('insertInfo', locale)}
+ +
{i18nText('changeUserData', locale)}
); diff --git a/src/app/[locale]/experts/[expertId]/page.tsx b/src/app/[locale]/experts/[expertId]/page.tsx index ba143d3..e71a855 100644 --- a/src/app/[locale]/experts/[expertId]/page.tsx +++ b/src/app/[locale]/experts/[expertId]/page.tsx @@ -9,7 +9,7 @@ import { ExpertPractice } from '../../../../components/Experts/ExpertDetails'; import { Details } from '../../../../types/experts'; -import { BackButton } from '../../../../components/view'; +import { BackButton } from '../../../../components/view/BackButton'; export const metadata: Metadata = { title: 'Bbuddy - Experts item', diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 68882b7..520e6ae 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -3,10 +3,9 @@ import { Metadata } from 'next'; import { unstable_setRequestLocale } from 'next-intl/server'; import { notFound } from 'next/navigation'; import { ConfigProvider } from 'antd'; +import { AntdRegistry } from '@ant-design/nextjs-registry'; import theme from '../../constants/theme'; import { ALLOWED_LOCALES } from '../../constants/locale'; -import StyledComponentsRegistry from '../../lib/AntdRegistry'; -import StyledRegistry from '../../lib/StyleRegistry'; import { Header, Footer } from '../../components/Page'; type LayoutProps = { @@ -28,18 +27,16 @@ export default function LocaleLayout({ children, params: { locale } }: LayoutPro unstable_setRequestLocale(locale); return ( - - - -
-
-
- {children} -
-
+ + +
+
+
+ {children}
- - - +
+
+
+
); }; diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx index 612defe..2a93895 100644 --- a/src/app/global-error.tsx +++ b/src/app/global-error.tsx @@ -3,9 +3,9 @@ import React from 'react'; import Link from 'next/link'; import { Button, ConfigProvider } from 'antd'; +import { AntdRegistry } from '@ant-design/nextjs-registry'; import { comfortaa, inter } from './fonts'; import StyledRegistry from '../lib/StyleRegistry'; -import StyledComponentsRegistry from '../lib/AntdRegistry'; import theme from '../constants/theme'; export default function GlobalError({ @@ -18,8 +18,8 @@ export default function GlobalError({ return ( - - + +
@@ -57,8 +57,8 @@ export default function GlobalError({
-
-
+ + ); diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 047d48a..ffbffa1 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,18 +1,18 @@ import React from 'react'; import { ConfigProvider } from 'antd'; +import { AntdRegistry } from '@ant-design/nextjs-registry'; import Link from 'next/link'; import { comfortaa, inter } from './fonts'; -import StyledComponentsRegistry from '../lib/AntdRegistry'; import StyledRegistry from '../lib/StyleRegistry'; import theme from '../constants/theme'; -import { BackButton } from '../components/view'; +import { BackButton } from '../components/view/BackButton'; export default function NotFound() { return ( - - + +
@@ -51,8 +51,8 @@ export default function NotFound() {
- - + + ); diff --git a/src/components/Account/AccountMenu.tsx b/src/components/Account/AccountMenu.tsx index e4d089d..8624fcb 100644 --- a/src/components/Account/AccountMenu.tsx +++ b/src/components/Account/AccountMenu.tsx @@ -7,6 +7,7 @@ import { useSelectedLayoutSegment, usePathname } from 'next/navigation'; import { Link } from '../../navigation'; import { AUTH_TOKEN_KEY, AUTH_USER } from '../../constants/common'; import { deleteStorageKey } from '../../hooks/useLocalStorage'; +import { i18nText } from '../../i18nKeys'; const Logout = styled(Button)` width: 100%; @@ -19,7 +20,7 @@ const Logout = styled(Button)` text-align: left !important; `; -export const AccountMenu = ({ menu }: { menu: { path: string, title: string, count?: number }[] }) => { +export const AccountMenu = ({ menu, locale }: { menu: { path: string, title: string, count?: number }[], locale: string }) => { const selectedLayoutSegment = useSelectedLayoutSegment(); const pathname = selectedLayoutSegment || ''; const paths = usePathname(); @@ -51,7 +52,7 @@ export const AccountMenu = ({ menu }: { menu: { path: string, title: string, cou type="link" onClick={onLogout} > - Log Out + {i18nText('logout', locale)}
  • @@ -59,7 +60,7 @@ export const AccountMenu = ({ menu }: { menu: { path: string, title: string, cou type="link" onClick={onDeleteAccount} > - Delete account + {i18nText('deleteAcc', locale)}
  • diff --git a/src/components/Account/ProfileSettings.tsx b/src/components/Account/ProfileSettings.tsx index fb5acb1..e40ee88 100644 --- a/src/components/Account/ProfileSettings.tsx +++ b/src/components/Account/ProfileSettings.tsx @@ -6,33 +6,18 @@ import type { UploadFile, UploadProps } from 'antd'; import ImgCrop from 'antd-img-crop'; import { CameraOutlined } from '@ant-design/icons'; import { Link } from '../../navigation'; -import { CustomInput } from '../view'; +import { CustomInput } from '../view/CustomInput'; import { Profile } from '../../types/profile'; import { useProfileSettings } from '../../actions/hooks/useProfileSettings'; +import { i18nText } from '../../i18nKeys'; type ProfileSettingsProps = { locale: string; - photoDesc?: string; - placeholderName?: string; - placeholderSurname?: string; - placeholderBirthday?: string; - placeholderEmail?: string; - changePasswordLink?: string; - saveButton?: string; }; // type FileType = Parameters>[0]; -export const ProfileSettings: FC = ({ - locale, - photoDesc, - placeholderName, - placeholderSurname, - placeholderBirthday, - placeholderEmail, - changePasswordLink, - saveButton -}) => { +export const ProfileSettings: FC = ({ locale }) => { const [form] = Form.useForm(); const { profileSettings } = useProfileSettings(locale); @@ -66,13 +51,13 @@ export const ProfileSettings: FC = ({ return (
    -
    +
    -
    {photoDesc}
    +
    {i18nText('photoDesc', locale)}
    - + {/* = ({ > - + */}
    - +
    - +
    {/*
    - +
    */}
    - +
    - {changePasswordLink} + {i18nText('changePass', locale)}
    - + ); }; diff --git a/src/components/Account/SessionsTabs.tsx b/src/components/Account/SessionsTabs.tsx index b314121..2132d27 100644 --- a/src/components/Account/SessionsTabs.tsx +++ b/src/components/Account/SessionsTabs.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useCallback, useEffect, useState } from 'react'; -import styled from 'styled-components'; +import { Empty, Space } from 'antd'; import dayjs from 'dayjs'; import 'dayjs/locale/ru'; import 'dayjs/locale/en'; @@ -9,15 +9,14 @@ import 'dayjs/locale/de'; import 'dayjs/locale/it'; import 'dayjs/locale/fr'; import 'dayjs/locale/es'; -import { CustomSelect, Loader } from '../view'; +import { Loader } from '../view/Loader'; import { useLocalStorage } from '../../hooks/useLocalStorage'; import { AUTH_TOKEN_KEY, AUTH_USER } from '../../constants/common'; import { getRecentSessions, getRequestedSessions, getUpcomingSessions } from '../../actions/profile'; import { Session, Sessions, SessionType } from '../../types/sessions'; +import { i18nText } from '../../i18nKeys'; -const Tab = styled.div``; - -export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record, locale: string }) => { +export const SessionsTabs = ({ locale }: { locale: string }) => { const [activeTab, setActiveTab] = useState(0); const [sort, setSort] = useState(); const [sessions, setSessions] = useState(); @@ -59,7 +58,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record ( <> -
    + {/*
    -
    +
    */}
    {list && list?.length > 0 ? list?.map(({ id, scheduledStartAtUtc, scheduledEndAtUtc, title, coach, clients }) => { const client = clients?.length ? clients[0] : null; @@ -94,7 +93,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record{title}
    {today - ? `Today ${startDate.format('HH:mm')} - ${endDate.format('HH:mm')}` + ? `${i18nText('today', locale)} ${startDate.format('HH:mm')} - ${endDate.format('HH:mm')}` : `${startDate.format('D MMMM')} ${startDate.format('HH:mm')} - ${endDate.format('HH:mm')}`}
    @@ -103,7 +102,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record ) }) : ( -
    not found
    + )}
    @@ -114,7 +113,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record - {intlConfig?.upcoming || 'Tab 1'} + {i18nText('session.upcoming', locale)} {sessions?.upcoming && sessions?.upcoming?.length > 0 ? ({sessions?.upcoming.length}) : null} ), @@ -124,7 +123,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record - {intlConfig?.requested || 'Tab 2'} + {i18nText('session.requested', locale)} {sessions?.requested && sessions?.requested?.length > 0 ? ({sessions?.requested.length}) : null} ), @@ -132,7 +131,7 @@ export const SessionsTabs = ({ intlConfig, locale }: { intlConfig: Record
    {tabs.map((tab, index) => ( - setActiveTab(index)} > {tab.label} - + ))}
    {tabs[activeTab].children} diff --git a/src/components/Account/index.ts b/src/components/Account/index.ts index 28b7629..435b58a 100644 --- a/src/components/Account/index.ts +++ b/src/components/Account/index.ts @@ -1,3 +1,5 @@ +'use client' + export { AccountMenu } from './AccountMenu'; export { SessionsTabs } from './SessionsTabs'; export { ProfileSettings } from './ProfileSettings'; diff --git a/src/components/Experts/AdditionalFilter.tsx b/src/components/Experts/AdditionalFilter.tsx index 1174064..08d6cf9 100644 --- a/src/components/Experts/AdditionalFilter.tsx +++ b/src/components/Experts/AdditionalFilter.tsx @@ -6,18 +6,18 @@ import debounce from 'lodash/debounce'; import { useRouter } from '../../navigation'; import { AdditionalFilter } from '../../types/experts'; import { getObjectByFilter, getObjectByAdditionalFilter } from '../../utils/filter'; -import { CustomInput, CustomSelect } from '../view'; +import { CustomInput } from '../view/CustomInput'; +import { CustomSelect } from '../view/CustomSelect'; +import { i18nText } from '../../i18nKeys'; type ExpertAdditionalFilterProps = { - searchPlaceholder: string; - sortLabel: string; basePath: string; + locale: string; }; export const ExpertsAdditionalFilter = ({ - searchPlaceholder, - sortLabel, basePath, + locale }: ExpertAdditionalFilterProps) => { const searchParams = useSearchParams(); const router = useRouter(); @@ -65,7 +65,7 @@ export const ExpertsAdditionalFilter = ({
    diff --git a/src/components/Experts/Experts.tsx b/src/components/Experts/Experts.tsx index 351752e..29df831 100644 --- a/src/components/Experts/Experts.tsx +++ b/src/components/Experts/Experts.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { getTranslations } from 'next-intl/server'; import { DEFAULT_PAGE_SIZE } from '../../constants/common'; import { getFilter } from '../../utils/filter'; import { getTagList, getLanguages } from '../../actions/tags'; @@ -7,6 +6,7 @@ import { getExpertsList } from '../../actions/experts'; import { ExpertsFilter } from './Filter'; import { ExpertsAdditionalFilter } from './AdditionalFilter'; import { ExpertsList } from './ExpertsList'; +import { i18nText } from '../../i18nKeys'; type ExpertsProps = { basePath?: string; @@ -15,11 +15,14 @@ type ExpertsProps = { }; export const Experts = async ({ basePath = '/', locale, pageSize = DEFAULT_PAGE_SIZE }: ExpertsProps) => { - const t = await getTranslations('Experts'); const searchData = await getTagList(locale); const languages = await getLanguages(locale); const filter = getFilter({ pageSize }); const experts = await getExpertsList(filter, locale); + const durFrom = `${searchData?.sessionCostMin || 0}${locale === 'ru' ? 'мин' : 'min'}`; + const durTo = `${searchData?.sessionDurationMax || 0}${locale === 'ru' ? 'мин' : 'min'}`; + const priceFrom = `${searchData?.sessionCostMin || 0}€`; + const priceTo = `${searchData?.sessionCostMax || 0}€`; return (
    @@ -28,15 +31,14 @@ export const Experts = async ({ basePath = '/', locale, pageSize = DEFAULT_PAGE_ searchData={searchData} languages={languages} basePath={basePath} - priceTitle={t('filter.price', { from: searchData?.sessionCostMin || 0, to: searchData?.sessionCostMax || 0 })} - durationTitle={t('filter.duration', { from: searchData?.sessionDurationMin || 0, to: searchData?.sessionDurationMax || 0 })} - buttonApply={t('filter.apply')} + locale={locale} + priceTitle={i18nText('fromTo', locale).replace('$', priceFrom).replace('$', priceTo)} + durationTitle={i18nText('fromTo', locale).replace('$', durFrom).replace('$', durTo)} />
    diff --git a/src/components/Experts/ExpertsList.tsx b/src/components/Experts/ExpertsList.tsx index 0ceb5eb..59df305 100644 --- a/src/components/Experts/ExpertsList.tsx +++ b/src/components/Experts/ExpertsList.tsx @@ -10,13 +10,12 @@ import { Link, useRouter } from '../../navigation'; import { ExpertsData, Filter, GeneralFilter } from '../../types/experts'; import { getObjectByFilter, getObjectByAdditionalFilter } from '../../utils/filter'; import { getExpertsList } from '../../actions/experts'; -import { CustomPagination, CustomSpin } from '../view'; +import { CustomPagination } from '../view/CustomPagination'; +import { CustomSpin } from '../view/CustomSpin'; +import { i18nText } from '../../i18nKeys'; type ExpertListProps = { data?: ExpertsData; - priceTitle: string; - durationTitle: string; - detailButton: string; locale: string; baseFilter: Filter; pageSize: number; @@ -25,9 +24,6 @@ type ExpertListProps = { export const ExpertsList = ({ data, - priceTitle, - durationTitle, - detailButton, locale, baseFilter, pageSize, @@ -35,7 +31,8 @@ export const ExpertsList = ({ }: ExpertListProps) => { const searchParams = useSearchParams(); const router = useRouter(); - const getTitle = (str: string, value?: any): string => (value ? str.replace('0', value) : str); + const getDuration = (value?: any): string => `${value || 0}${locale === 'ru' ? 'мин' : 'min'}`; + const getPrice = (value?: any): string => `${value || 0}€`; const [experts, setExperts] = useState(); const [loading, setLoading] = useState(true); @@ -105,7 +102,7 @@ export const ExpertsList = ({
    {`${item.name} ${item?.surname || ''}`}
    - {getTitle(priceTitle, item?.sessionCost)} / {getTitle(durationTitle, item?.sessionDuration)} + {getPrice(item?.sessionCost)} / {getDuration(item?.sessionDuration)}
    @@ -134,7 +131,7 @@ export const ExpertsList = ({
    {item?.description}
    - {detailButton} + {i18nText('details', locale)}
    diff --git a/src/components/Experts/Filter.tsx b/src/components/Experts/Filter.tsx index 4dc9cc5..8a623b7 100644 --- a/src/components/Experts/Filter.tsx +++ b/src/components/Experts/Filter.tsx @@ -8,7 +8,10 @@ import { useRouter } from '../../navigation'; import { Filter } from '../../types/experts'; import { Languages, SearchData, Tag } from '../../types/tags'; import { getObjectByFilter, getObjectByAdditionalFilter } from '../../utils/filter'; -import { CustomSwitch, CustomSlider, CustomInput } from '../view'; +import { CustomSwitch } from '../view/CustomSwitch'; +import { CustomSlider } from '../view/CustomSlider'; +import { CustomInput } from '../view/CustomInput'; +import { i18nText } from '../../i18nKeys'; type ExpertsFilterProps = { searchData?: SearchData; @@ -16,7 +19,7 @@ type ExpertsFilterProps = { basePath: string; priceTitle: string; durationTitle: string; - buttonApply: string; + locale: string; }; export const ExpertsFilter = ({ @@ -25,7 +28,7 @@ export const ExpertsFilter = ({ basePath, priceTitle, durationTitle, - buttonApply + locale }: ExpertsFilterProps) => { const searchParams = useSearchParams(); const router = useRouter(); @@ -161,7 +164,9 @@ export const ExpertsFilter = ({ const getLangList = () => { const reg = searchLang ? new RegExp(searchLang, 'ig') : ''; const langList = reg ? (languages || []).filter(({ code, nativeSpelling }) => reg.test(code) || reg.test(nativeSpelling)) : languages; - return langList?.length && getList('userLanguages', langList.map(({ code, nativeSpelling }) => ({ id: code, name: nativeSpelling }))) + return langList?.length + ? getList('userLanguages', langList.map(({ code, nativeSpelling }) => ({ id: code, name: nativeSpelling }))) + : null; }; const getTagsList = () => { @@ -185,7 +190,7 @@ export const ExpertsFilter = ({ key: 'userLanguages', label: ( <> -
    Session Language
    +
    {i18nText('sessionLang', locale)}
    {!openedTabs.includes('userLanguages') && filter?.userLanguages?.length > 0 && (
    {getSelectedLanguage()}
    )} @@ -194,7 +199,7 @@ export const ExpertsFilter = ({ children: ( <> setSearchLang(e.target?.value)} allowClear @@ -218,7 +223,7 @@ export const ExpertsFilter = ({ children: ( <> setSearchTags(e.target?.value)} allowClear @@ -246,7 +251,7 @@ export const ExpertsFilter = ({ onChange={onChangeTab} />
    -

    Price

    +

    {i18nText('price', locale)}

    {priceTitle}
    -

    Duration

    +

    {i18nText('duration', locale)}

    - {buttonApply} + {i18nText('apply', locale)}
    ); diff --git a/src/components/Modals/authModalContent/EnterContent.tsx b/src/components/Modals/authModalContent/EnterContent.tsx index e1cbeae..b286b61 100644 --- a/src/components/Modals/authModalContent/EnterContent.tsx +++ b/src/components/Modals/authModalContent/EnterContent.tsx @@ -4,7 +4,11 @@ import Image from 'next/image'; import { AUTH_USER } from '../../../constants/common'; import { getAuth } from '../../../actions/auth'; import { getPersonalData } from '../../../actions/profile'; -import { CustomInput, CustomInputPassword, FilledButton, OutlinedButton, LinkButton } from '../../view'; +import { CustomInput } from '../../view/CustomInput'; +import { CustomInputPassword } from '../../view/CustomInputPassword'; +import { FilledButton } from '../../view/FilledButton'; +import { OutlinedButton } from '../../view/OutlinedButton'; +import { LinkButton } from '../../view/LinkButton'; type EnterProps = { form: FormInstance; diff --git a/src/components/Modals/authModalContent/FinishContent.tsx b/src/components/Modals/authModalContent/FinishContent.tsx index 437b438..a1fd342 100644 --- a/src/components/Modals/authModalContent/FinishContent.tsx +++ b/src/components/Modals/authModalContent/FinishContent.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { FilledButton } from '../../view'; +import { FilledButton } from '../../view/FilledButton'; export const FinishContent = () => ( <> diff --git a/src/components/Modals/authModalContent/RegisterContent.tsx b/src/components/Modals/authModalContent/RegisterContent.tsx index 723ac2c..fafee2e 100644 --- a/src/components/Modals/authModalContent/RegisterContent.tsx +++ b/src/components/Modals/authModalContent/RegisterContent.tsx @@ -3,7 +3,10 @@ import { Form, FormInstance, notification } from 'antd'; import { AUTH_USER } from '../../../constants/common'; import { getRegister } from '../../../actions/auth'; import { setPersonData } from '../../../actions/profile'; -import { CustomInput, CustomInputPassword, FilledButton, OutlinedButton } from '../../view'; +import { CustomInput } from '../../view/CustomInput'; +import { CustomInputPassword } from '../../view/CustomInputPassword'; +import { FilledButton } from '../../view/FilledButton'; +import { OutlinedButton } from '../../view/OutlinedButton'; type RegisterProps = { form: FormInstance; diff --git a/src/components/Modals/authModalContent/ResetContent.tsx b/src/components/Modals/authModalContent/ResetContent.tsx index 4dfb0ae..1f55ddc 100644 --- a/src/components/Modals/authModalContent/ResetContent.tsx +++ b/src/components/Modals/authModalContent/ResetContent.tsx @@ -1,6 +1,8 @@ import React, { FC } from 'react'; import { Form, FormInstance } from 'antd'; -import { CustomInput, FilledButton, LinkButton } from '../../view'; +import { CustomInput } from '../../view/CustomInput'; +import { FilledButton } from '../../view/FilledButton'; +import { LinkButton } from '../../view/LinkButton'; type ResetProps = { form: FormInstance; diff --git a/src/components/Page/Footer/index.tsx b/src/components/Page/Footer/index.tsx index f1b53f0..cd1c99a 100644 --- a/src/components/Page/Footer/index.tsx +++ b/src/components/Page/Footer/index.tsx @@ -2,8 +2,9 @@ import React from 'react'; import Link from 'next/link'; import { useTranslations } from 'next-intl'; import { Link as IntlLink } from '../../../navigation'; +import { i18nText } from '../../../i18nKeys'; -export const Footer = () => { +export const Footer = ({ locale }: { locale: string }) => { const t = useTranslations('Footer'); return ( @@ -11,22 +12,22 @@ export const Footer = () => {
    - + - +
    @@ -35,19 +36,23 @@ export const Footer = () => {
    - {t('menu.faq')} - {t(`menu.privacy-policy`)} + + {i18nText('footer.faq', locale)} + + + {i18nText('footer.policy', locale)} +
    diff --git a/src/components/Page/Header/HeaderAuthLinks.tsx b/src/components/Page/Header/HeaderAuthLinks.tsx index 1118ef3..c272738 100644 --- a/src/components/Page/Header/HeaderAuthLinks.tsx +++ b/src/components/Page/Header/HeaderAuthLinks.tsx @@ -1,35 +1,21 @@ -'use client'; +'use client' import React, { FC, useState, useEffect } from 'react'; import { Button } from 'antd'; import { useSelectedLayoutSegment } from 'next/navigation'; -import { styled } from 'styled-components'; import { Link } from '../../../navigation'; import { AUTH_TOKEN_KEY } from '../../../constants/common'; import { useLocalStorage } from '../../../hooks/useLocalStorage'; import { AuthModal } from '../../Modals/AuthModal'; +import { i18nText } from '../../../i18nKeys'; type HeaderAuthLinksProps = { - enterTitle: string; - registerTitle: string; - accountTitle: string; + locale: string; separatorClass?: string; }; -const LinkButton = styled(Button)` - color: #66A5AD !important; - font-size: 16px !important; - height: auto !important; - padding: 0 !important; - font-style: normal !important; - font-weight: 600 !important; - line-height: normal !important; -`; - export const HeaderAuthLinks: FC = ({ - enterTitle, - registerTitle, - accountTitle, + locale, separatorClass = 'b-header__nav__list__line' }) => { const [isOpenModal, setIsOpenModal] = useState(false); @@ -52,29 +38,33 @@ export const HeaderAuthLinks: FC = ({ return token ? (
  • - {accountTitle} + + {i18nText('account', locale)} +
  • ) : ( <>
  • - onOpen('register')} > - {registerTitle} - + {i18nText('registration', locale)} +
  • |
  • - onOpen('enter')} > - {enterTitle} - + {i18nText('enter', locale)} +
  • { const selectedLayoutSegment = useSelectedLayoutSegment(); @@ -24,13 +20,13 @@ export const HeaderMenu = ({ return (
    diff --git a/src/components/Page/Header/HeaderMobileMenu.tsx b/src/components/Page/Header/HeaderMobileMenu.tsx index e69d060..cd888f9 100644 --- a/src/components/Page/Header/HeaderMobileMenu.tsx +++ b/src/components/Page/Header/HeaderMobileMenu.tsx @@ -6,17 +6,13 @@ import { HeaderAuthLinks } from './HeaderAuthLinks'; import { Link } from '../../../navigation'; type HeaderMenuMobileProps = { + locale: string; linkConfig: { path: string, title: string }[]; - enterTitle: string; - registerTitle: string; - accountTitle: string; }; export const HeaderMobileMenu: FC = ({ - linkConfig, - enterTitle, - registerTitle, - accountTitle + locale, + linkConfig }) => { const [showMobileMenu, setShowMobileMenu] = useState(false); const selectedLayoutSegment = useSelectedLayoutSegment(); @@ -41,9 +37,7 @@ export const HeaderMobileMenu: FC = ({
    diff --git a/src/components/Page/Header/index.tsx b/src/components/Page/Header/index.tsx index 80497ab..0985d7f 100644 --- a/src/components/Page/Header/index.tsx +++ b/src/components/Page/Header/index.tsx @@ -1,21 +1,19 @@ -import React, { FC } from 'react'; -import { useTranslations } from 'next-intl'; +import React, { FC, Suspense } from 'react'; import { HeaderMenu } from './HeaderMenu'; import { LanguageSwitcher } from './LanguageSwitcher'; import { HeaderMobileMenu } from './HeaderMobileMenu'; import { HEAD_ROUTES } from '../../../constants/routes'; import { Link } from '../../../navigation'; +import { i18nText } from '../../../i18nKeys'; type HeaderProps = { locale: string; }; export const Header: FC = ({ locale }) => { - const t = useTranslations('Header'); - const routes: { path: string, title: string }[] = HEAD_ROUTES.map((item) => ({ path: item, - title: t(`menu.${item}`) + title: i18nText(`menu.${item}`, locale) })); return ( @@ -29,21 +27,21 @@ export const Header: FC = ({ locale }) => { alt="" /> - - + + + +
    - + + + ); }; diff --git a/src/components/view/CustomInput.tsx b/src/components/view/CustomInput.tsx index c06a98a..c468940 100644 --- a/src/components/view/CustomInput.tsx +++ b/src/components/view/CustomInput.tsx @@ -1,34 +1,4 @@ import React from 'react'; -import styled from 'styled-components'; -import { Input as AntdInput } from 'antd'; +import { Input } from 'antd'; -const Input = styled(AntdInput)` - padding: 15px 16px !important; - background: #F8F8F7 !important; - border: 1px solid #F8F8F7 !important; - border-radius: 8px !important; - color: #000 !important; - align-items: center; - - input { - background-color: transparent !important; - } - - &:focus, &:hover, &:focus-within { - border-color: #66A5AD !important; - box-shadow: none !important; - } - - &::placeholder { - color: #000 !important; - opacity: .4 !important; - } - - &.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless) { - border-color: #ff4d4f !important; - } -`; - -export const CustomInput = (props: any) => ( - -); +export const CustomInput = (props: any) => ; diff --git a/src/components/view/CustomInputPassword.tsx b/src/components/view/CustomInputPassword.tsx index fca2637..203208e 100644 --- a/src/components/view/CustomInputPassword.tsx +++ b/src/components/view/CustomInputPassword.tsx @@ -1,37 +1,10 @@ import React from 'react'; -import styled from 'styled-components'; -import { Input as AntdInput } from 'antd'; +import { Input } from 'antd'; import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons'; -const Input = styled(AntdInput.Password)` - padding: 15px 16px !important; - background: #F8F8F7 !important; - border: 1px solid #F8F8F7 !important; - border-radius: 8px !important; - color: #000 !important; - box-shadow: none !important; - - input { - background: transparent !important; - } - - &:focus, &:hover, &.ant-input-affix-wrapper-focused { - border-color: #66A5AD !important; - box-shadow: none !important; - } - - input::placeholder { - color: #000 !important; - opacity: .4 !important; - } - - &.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless) { - border-color: #ff4d4f !important; - } -`; - export const CustomInputPassword = (props: any) => ( - (visible ? : diff --git a/src/components/view/CustomMultiSelect.tsx b/src/components/view/CustomMultiSelect.tsx index 501e1d0..1ea80ef 100644 --- a/src/components/view/CustomMultiSelect.tsx +++ b/src/components/view/CustomMultiSelect.tsx @@ -1,71 +1,11 @@ +'use client' + import React, {useEffect, useState} from 'react'; -import styled from 'styled-components'; -import { Select as AntdSelect, Tag } from 'antd'; +import { Select, Tag } from 'antd'; import type { SelectProps } from 'antd'; type TagRender = SelectProps['tagRender']; -const Select = styled(AntdSelect)` - width: 100% !important; - height: 54px !important; - - .ant-select-selector { - background-color: #F8F8F7 !important; - border-color: #F8F8F7 !important; - border-radius: 8px !important; - padding: 22px 16px 8px !important; - box-shadow: none !important; - - .ant-select-selection-item { - font-size: 15px !important; - font-weight: 400 !important; - line-height: 24px !important; - color: #313131 !important; - } - } - - .ant-select-selection-overflow-item { - margin-right: 4px; - } - - .ant-select-arrow { - color: #2c7873 !important; - } - - &.ant-select-focused, &:hover { - .ant-select-selector { - border-color: #2c7873 !important; - box-shadow: none !important; - } - } -`; - -const SelectWrap = styled.div` - position: relative; - width: 100%; -`; - -const SelectLabel = styled.div` - font-size: 15px; - font-style: normal; - font-weight: 400; - line-height: 24px; - color: #000; - opacity: .3; - position: absolute; - left: 16px; - top: 15px; - z-index: 1; - transition: all .1s ease; - - .b-multiselect__active & { - font-size: 12px; - font-weight: 300; - line-height: 14px; - top: 8px; - } -`; - const tagRender: TagRender = (props) => { const { label } = props; @@ -89,9 +29,10 @@ export const CustomMultiSelect = (props: any) => { }, [value]); return ( - - {label} +
    +
    {label}
    setIsActiveLabel(true) : undefined} onBlur={() => setIsActiveLabel(!!value)} {...other} /> - +
    ); }; diff --git a/src/components/view/CustomSlider.tsx b/src/components/view/CustomSlider.tsx index 2326fc5..54120cd 100644 --- a/src/components/view/CustomSlider.tsx +++ b/src/components/view/CustomSlider.tsx @@ -1,49 +1,4 @@ -'use client'; - import React from 'react'; -import styled from 'styled-components'; -import { Slider as AntdSlider } from 'antd'; +import { Slider } from 'antd'; -const Slider = styled(AntdSlider)` - padding-block: 7px !important; - height: 16px !important; - - .ant-slider-rail { - background-color: #E5E5E5 !important; - } - - .ant-slider-track { - background-color: #66A5AD !important; - } - - .ant-slider-handle { - width: 16px !important; - height: 16px !important; - - &::before { - width: 16px !important; - height: 16px !important; - inset-inline-start: 0 !important; - inset-block-start: 0 !important; - } - - &::after { - width: 16px !important; - height: 16px !important; - background-color: #66A5AD !important; - inset-inline-start: 0 !important; - inset-block-start: 0 !important; - box-shadow: none !important; - } - - &:focus, &:hover { - &::after { - box-shadow: 0 0 0 12px rgba(102, 165, 173, .2) !important; - } - } - } -`; - -export const CustomSlider = (props: any) => ( - -); +export const CustomSlider = (props: any) => ; diff --git a/src/components/view/CustomSpin.tsx b/src/components/view/CustomSpin.tsx index 844c7c6..7de87ba 100644 --- a/src/components/view/CustomSpin.tsx +++ b/src/components/view/CustomSpin.tsx @@ -1,12 +1,4 @@ import React from 'react'; -import { Spin as AntdSpin } from 'antd'; -import { styled } from 'styled-components'; +import { Spin } from 'antd'; -const Spin = styled(AntdSpin)` - width: 100%; - margin: 24px 0; -`; - -export const CustomSpin = (props: any) => ( - -); +export const CustomSpin = (props: any) => ; diff --git a/src/components/view/CustomSwitch.tsx b/src/components/view/CustomSwitch.tsx index ad15b9a..fb44f32 100644 --- a/src/components/view/CustomSwitch.tsx +++ b/src/components/view/CustomSwitch.tsx @@ -1,34 +1,4 @@ -'use client'; - import React from 'react'; -import styled from 'styled-components'; -import { Switch as AntdSwitch } from 'antd'; +import { Switch } from 'antd'; -const Switch = styled(AntdSwitch)` - height: 24px !important; - background: #F8F8F7 !important; - - .ant-switch-handle { - height: 24px !important; - width: 24px !important; - top: 0 !important; - - &::before { - box-shadow: none !important; - background: #C4DFE6 !important; - border-radius: 50% !important; - } - } - - &.ant-switch-checked { - background: #F8F8F7 !important; - - .ant-switch-handle::before { - background: #66A5AD !important; - } - } -`; - -export const CustomSwitch = (props: any) => ( - -); +export const CustomSwitch = (props: any) => ; diff --git a/src/components/view/FilledButton.tsx b/src/components/view/FilledButton.tsx index 02488de..f289d20 100644 --- a/src/components/view/FilledButton.tsx +++ b/src/components/view/FilledButton.tsx @@ -1,17 +1,8 @@ import React from 'react'; -import { styled } from 'styled-components'; -import { Button as AntdButton } from 'antd'; - -const Button = styled(AntdButton)` - background: #66A5AD !important; - font-size: 15px !important; - border-radius: 8px !important; - height: 54px !important; - box-shadow: 0px 2px 4px 0px rgba(102, 165, 173, 0.32) !important; -`; +import { Button } from 'antd'; export const FilledButton = (props: any) => ( - ); diff --git a/src/components/view/LinkButton.tsx b/src/components/view/LinkButton.tsx index 221663f..6e06b0a 100644 --- a/src/components/view/LinkButton.tsx +++ b/src/components/view/LinkButton.tsx @@ -1,16 +1,8 @@ import React from 'react'; -import { styled } from 'styled-components'; -import { Button as AntdButton } from 'antd'; - -const Button = styled(AntdButton)` - color: #66A5AD !important; - font-size: 15px !important; - height: auto !important; - padding: 0 !important; -`; +import { Button } from 'antd'; export const LinkButton = (props: any) => ( - ); diff --git a/src/components/view/OutlinedButton.tsx b/src/components/view/OutlinedButton.tsx index 5dd81d2..04bb269 100644 --- a/src/components/view/OutlinedButton.tsx +++ b/src/components/view/OutlinedButton.tsx @@ -1,26 +1,8 @@ import React from 'react'; -import { styled } from 'styled-components'; -import { Button as AntdButton } from 'antd'; - -const Button = styled(AntdButton)` - display: inline-flex !important; - justify-content: center; - align-items: center; - gap: 16px; - border-color: #66A5AD !important; - color: #66A5AD !important; - font-size: 15px !important; - border-radius: 8px !important; - height: 54px !important; - - span { - margin-inline-end: 0 !important; - line-height: 15px !important; - } -`; +import { Button } from 'antd'; export const OutlinedButton = (props: any) => ( - ); diff --git a/src/components/view/index.ts b/src/components/view/index.ts deleted file mode 100644 index 2600fb6..0000000 --- a/src/components/view/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -'use client'; - -export * from './CustomSwitch'; -export * from './CustomSlider'; -export * from './CustomPagination'; -export * from './CustomRate'; -export * from './CustomInput'; -export * from './CustomInputPassword'; -export * from './CustomSelect'; -export * from './CustomMultiSelect'; -export * from './CustomSpin'; -export * from './FilledButton'; -export * from './OutlinedButton'; -export * from './LinkButton'; -export * from './BackButton'; -export * from './WithError'; -export * from './Loader'; diff --git a/src/i18nKeys/de.ts b/src/i18nKeys/de.ts new file mode 100644 index 0000000..dc112d6 --- /dev/null +++ b/src/i18nKeys/de.ts @@ -0,0 +1,58 @@ +export default { + accountMenu: { + sessions: 'Kommende & letzte Sitzungen', + notifications: 'Benachrichtigung', + support: 'Hilfe & Support', + information: 'Rechtliche Informationen', + settings: 'Profileinstellungen', + messages: 'Nachrichten', + 'work-with-us': 'Arbeite mit uns' + }, + menu: { + 'bb-client': 'Mit BB wachsen', + 'bb-expert': 'Werde BB-Experte', + blog: 'Blog&News' + }, + registration: 'Registrieren', + enter: 'Anmelden', + account: 'Mein Konto', + logout: 'Abmelden', + deleteAcc: 'Konto löschen', + footer: { + faq: 'FAQ', + policy: 'Datenschutzrichtlinie' + }, + session: { + upcoming: 'Kommende Sitzungen', + requested: 'Angefragte Sitzungen', + recent: 'Letzte Sitzungen' + }, + photoDesc: 'Füge ein echtes Foto hinzu, mit Gesicht wirkt es immer glaubwürdiger.', + dayStart: 'Tagesbeginn', + topic: 'Thema', + name: 'Name', + surname: 'Nachname', + birthday: 'Geburtsdatum', + oldPass: 'Altes Passwort', + newPass: 'Neues Passwort', + confirmPass: 'Passwort bestätigen', + becomeExpert: '', + insertInfo: 'Füge deine persönlichen Informationen ein, um deine Reise als BBuddy-Experte zu beginnen', + changeUserData: 'Du kannst deine Angaben jederzeit ergänzen oder ändern\n', + price: 'Preis', + duration: 'Dauer', + search: 'Suche', + searchExpert: 'Nach einem Experten suchen', + sort: 'Sortieren', + sortPriceAsc: 'Nach Preis aufsteigend', + sortPriceDesc: 'Nach Preis absteigend', + details: 'Details', + sessionLang: 'Sitzungssprache', + fromTo: 'von $ bis $', + apply: 'Anwenden', + save: 'Speichern', + changePass: 'Passwort ändern', + getStarted: 'Loslegen', + delete: 'Löschen', + today: 'Heute' +} diff --git a/src/i18nKeys/en.ts b/src/i18nKeys/en.ts index 5a7b01c..f988207 100644 --- a/src/i18nKeys/en.ts +++ b/src/i18nKeys/en.ts @@ -7,5 +7,52 @@ export default { settings: 'Profile Settings', messages: 'Messages', 'work-with-us': 'Work With Us' - } + }, + menu: { + 'bb-client': 'Start grow with BB', + 'bb-expert': 'Become BB Expert', + blog: 'Blog&News' + }, + registration: 'Registration', + enter: 'Enter', + account: 'My Account', + logout: 'Log out', + deleteAcc: 'Delete account', + footer: { + faq: 'FAQ', + policy: 'Privacy Policy' + }, + session: { + upcoming: 'Upcoming Sessions', + requested: 'Sessions Requested', + recent: 'Recent Sessions' + }, + photoDesc: 'Add a real photo, as a person\'s face is always more credible.', + dayStart: 'Day start', + topic: 'Topic', + name: 'Name', + surname: 'Surname', + birthday: 'Date of Birth', + oldPass: 'Old Password', + newPass: 'New Password', + confirmPass: 'Confirm Password', + becomeExpert: '', + insertInfo: 'Insert your personal information to start your journey as a BBuddy Expert', + changeUserData: 'Your info can either be added or amended at anytime', + price: 'Price', + duration: 'Duration', + search: 'Search', + searchExpert: 'Search for an Expert', + sort: 'Sort', + sortPriceAsc: 'By price ascending', + sortPriceDesc: 'By price descending', + details: 'Details', + sessionLang: 'Session Language', + fromTo: 'from $ to $', + apply: 'Apply', + save: 'Save', + changePass: 'Change password', + getStarted: 'Get started', + delete: 'Delete', + today: 'Today' } diff --git a/src/i18nKeys/es.ts b/src/i18nKeys/es.ts new file mode 100644 index 0000000..61ba423 --- /dev/null +++ b/src/i18nKeys/es.ts @@ -0,0 +1,58 @@ +export default { + accountMenu: { + sessions: 'Próximas y recientes sesiones', + notifications: 'Notificación', + support: 'Ayuda y asistencia', + information: 'Información jurídica', + settings: 'Ajustes del perfil', + messages: 'Mensajes', + 'work-with-us': 'Trabaja con nosotros' + }, + menu: { + 'bb-client': 'Empieza a crecer con BB', + 'bb-expert': 'Conviértete en un experto en BB', + blog: 'Blog y noticias' + }, + registration: 'Registro', + enter: 'Entrar', + account: 'Mi cuenta', + logout: 'Cerrar sesión', + deleteAcc: 'Eliminar cuenta', + footer: { + faq: 'Preguntas frecuentes', + policy: 'Política de privacidad' + }, + session: { + upcoming: 'Próximas sesiones', + requested: 'Sesiones solicitadas', + recent: 'Sesiones recientes' + }, + photoDesc: 'Añade una foto real, ya que la cara de una persona siempre es más creíble.', + dayStart: 'Inicio del día', + topic: 'Tema', + name: 'Nombre', + surname: 'Apellido', + birthday: 'Fecha de nacimiento', + oldPass: 'Contraseña antigua', + newPass: 'Nueva contraseña', + confirmPass: 'Confirmar contraseña', + becomeExpert: '', + insertInfo: 'Introduce tu información personal para comenzar tu viaje como experto en BBuddy', + changeUserData: 'Tus datos pueden añadirse o modificarse en cualquier momento', + price: 'Precio', + duration: 'Duración', + search: 'Buscar', + searchExpert: 'Buscar un experto', + sort: 'Ordenar', + sortPriceAsc: 'Por precio ascendente', + sortPriceDesc: 'Por precio descendiente', + details: 'Detalles', + sessionLang: 'Idioma de la sesión', + fromTo: 'de $ a $', + apply: 'Solicitar', + save: 'Guardar', + changePass: 'Cambiar contraseña', + getStarted: 'Empieza', + delete: 'Eliminar', + today: 'Hoy día' +} diff --git a/src/i18nKeys/fr.ts b/src/i18nKeys/fr.ts new file mode 100644 index 0000000..dc776cb --- /dev/null +++ b/src/i18nKeys/fr.ts @@ -0,0 +1,58 @@ +export default { + accountMenu: { + sessions: 'Sessions futures et récentes', + notifications: 'Notification', + support: 'Aide et support', + information: 'Informations légales', + settings: 'Paramètres du profil', + messages: 'Messages', + 'work-with-us': 'Travaillez avec nous' + }, + menu: { + 'bb-client': 'Commencez à vous développer avec BB', + 'bb-expert': 'Devenez Expert BB', + blog: 'Blog et actus' + }, + registration: 'Inscription', + enter: 'Saisir', + account: 'Mon compte', + logout: 'Déconnexion', + deleteAcc: 'Supprimer le compte', + footer: { + faq: 'FAQ', + policy: 'Politique de confidentialité' + }, + session: { + upcoming: 'Prochaines sessions', + requested: 'Sessions demandées', + recent: 'Sessions récentes' + }, + photoDesc: 'Ajoutez une photo réelle, le visage d\'une personne est toujours plus crédible.', + dayStart: 'Début de la journée', + topic: 'Sujet', + name: 'Prénom', + surname: 'Nom de famille', + birthday: 'Date de naissance', + oldPass: 'Ancien mot de passe', + newPass: 'Nouveau mot de passe', + confirmPass: 'Confirmer le mot de passe', + becomeExpert: '', + insertInfo: 'Insérez vos informations personnelles pour commencer votre voyage en tant qu\'expert BBuddy', + changeUserData: 'Vos informations peuvent être ajoutées ou modifiées à tout moment', + price: 'Prix', + duration: 'Durée', + search: 'Recherche', + searchExpert: 'Rechercher un expert', + sort: 'Trier', + sortPriceAsc: 'Par prix croissant', + sortPriceDesc: 'Par prix décroissant', + details: 'Détails', + sessionLang: 'Langue de la session', + fromTo: 'de $ à $', + apply: 'Appliquer', + save: 'Sauvegarder', + changePass: 'Modifier le mot de passe', + getStarted: 'Commencer', + delete: 'Supprimer', + today: 'Ce jour' +} diff --git a/src/i18nKeys/index.ts b/src/i18nKeys/index.ts index fe23003..6411d84 100644 --- a/src/i18nKeys/index.ts +++ b/src/i18nKeys/index.ts @@ -1,14 +1,18 @@ import { Locale } from '../types/locale'; import en from './en'; import ru from './ru'; +import fr from './fr'; +import de from './de'; +import it from './it'; +import es from './es'; const MESSAGES = { [Locale.en]: en, [Locale.ru]: ru, - [Locale.de]: en, - [Locale.fr]: en, - [Locale.it]: en, - [Locale.es]: en + [Locale.de]: de, + [Locale.fr]: fr, + [Locale.it]: it, + [Locale.es]: es }; const getValue = (keys: string[], dictionary: any) => { diff --git a/src/i18nKeys/it.ts b/src/i18nKeys/it.ts new file mode 100644 index 0000000..78241a2 --- /dev/null +++ b/src/i18nKeys/it.ts @@ -0,0 +1,58 @@ +export default { + accountMenu: { + sessions: 'Prossime e recenti sessioni', + notifications: 'Notifica', + support: 'Assistenza e supporto', + information: 'Informazioni legali', + settings: 'Impostazioni profilo', + messages: 'Messaggi', + 'work-with-us': 'Lavora con noi' + }, + menu: { + 'bb-client': 'Inizia a crescere con BB', + 'bb-expert': 'Diventa esperto BB', + blog: 'Blog&Notizie' + }, + registration: 'Registrazione', + enter: 'Inserisci', + account: 'Il mio account', + logout: 'Disconnetti', + deleteAcc: 'Elimina account', + footer: { + faq: 'Domande frequenti', + policy: 'Informativa sulla privacy' + }, + session: { + upcoming: 'Prossime sessioni', + requested: 'Sessioni richieste', + recent: 'Sessioni recenti' + }, + photoDesc: 'Aggiungi una foto vera: il volto di una persona è sempre più credibile.', + dayStart: 'Inizio del giorno', + topic: 'Argomento', + name: 'Nome', + surname: 'Cognome', + birthday: 'Data di nascita', + oldPass: 'Vecchia password', + newPass: 'Nuova password', + confirmPass: 'Conferma password', + becomeExpert: '', + insertInfo: 'Inserisci i tuoi dati personali per iniziare il tuo viaggio come esperto BBuddy', + changeUserData: 'I tuoi dati possono essere aggiunti o modificati in qualsiasi momento', + price: 'Prezzo', + duration: 'Durata', + search: 'Ricerca', + searchExpert: 'Cerca un Esperto', + sort: 'Ordina', + sortPriceAsc: 'Per prezzo crescente', + sortPriceDesc: 'Per prezzo decrescente', + details: 'Dettagli', + sessionLang: 'Lingua sessione', + fromTo: 'da $ a $', + apply: 'Applica', + save: 'Salva', + changePass: 'Cambia password', + getStarted: 'Inizia', + delete: 'Elimina', + today: 'Oggi' +} diff --git a/src/i18nKeys/ru.ts b/src/i18nKeys/ru.ts index 5a7b01c..f56d72c 100644 --- a/src/i18nKeys/ru.ts +++ b/src/i18nKeys/ru.ts @@ -1,11 +1,58 @@ export default { accountMenu: { - sessions: 'Upcoming & Recent Sessions', - notifications: 'Notification', - support: 'Help & Support', - information: 'Legal Information', - settings: 'Profile Settings', - messages: 'Messages', - 'work-with-us': 'Work With Us' - } + sessions: 'Предстоящие и недавние сессии', + notifications: 'Уведомления', + support: 'Служба поддержки', + information: 'Юридическая информация', + settings: 'Настройки профиля', + messages: 'Сообщения', + 'work-with-us': 'Сотрудничество' + }, + menu: { + 'bb-client': 'Начните свой рост с BB', + 'bb-expert': 'Станьте экспертом BB', + blog: 'Блог и новости' + }, + registration: 'Регистрация', + enter: 'Войти', + account: 'Учетная запись', + logout: 'Выйти', + deleteAcc: 'Удалить учетную запись', + footer: { + faq: 'Частые вопросы', + policy: 'Политика конфиденциальности' + }, + session: { + upcoming: 'Предстоящие сессии', + requested: 'Запрошенные сессии', + recent: 'Недавние сессии' + }, + photoDesc: 'Добавьте реальную фотографию, ведь лицо человека всегда вызывает больше доверия.', + dayStart: 'День начала', + topic: 'Тема', + name: 'Имя', + surname: 'Фамилия', + birthday: 'Дата рождения', + oldPass: 'Старый пароль', + newPass: 'Новый пароль', + confirmPass: 'Подтвердите пароль', + becomeExpert: '', + insertInfo: 'Введите личные данные и начните свой путь эксперта BBuddy', + changeUserData: 'Добавить и изменить информацию о себе можно в любое время', + price: 'Цена', + duration: 'Длительность', + search: 'Поиск', + searchExpert: 'Поиск эксперта', + sort: 'Сортировать', + sortPriceAsc: 'Цена по возрастанию', + sortPriceDesc: 'Цена по убыванию', + details: 'Информация', + sessionLang: 'Язык сессии', + fromTo: 'от $ до $', + apply: 'Применить', + save: 'Сохранить', + changePass: 'Изменить пароль', + getStarted: 'Начать работу', + delete: 'Удалить', + today: 'Сегодня' } diff --git a/src/lib/AntdRegistry.tsx b/src/lib/AntdRegistry.tsx deleted file mode 100644 index 43c5004..0000000 --- a/src/lib/AntdRegistry.tsx +++ /dev/null @@ -1,22 +0,0 @@ -'use client'; - -import React from 'react'; -import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs'; -import type Entity from '@ant-design/cssinjs/es/Cache'; -import { useServerInsertedHTML } from 'next/navigation'; - -const StyledComponentsRegistry = ({ children }: React.PropsWithChildren) => { - const cache = React.useMemo(() => createCache(), []); - const isServerInserted = React.useRef(false); - useServerInsertedHTML(() => { - // avoid duplicate css insert - if (isServerInserted.current) { - return; - } - isServerInserted.current = true; - return