feat: fix next-intl bugs
This commit is contained in:
parent
035286823e
commit
456e2a7cdf
|
@ -1,3 +1,8 @@
|
|||
node_modules/
|
||||
.next
|
||||
.idea
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
npm-debug.log
|
||||
README.md
|
||||
.git
|
|
@ -1,13 +1,13 @@
|
|||
FROM node:20.10.0 as dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --verbose
|
||||
|
||||
FROM node:20.10.0 as builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
COPY --from=dependencies /app/node_modules ./node_modules
|
||||
RUN yarn build
|
||||
RUN npm run build --debug --verbose
|
||||
|
||||
FROM node:20.10.0 as runner
|
||||
WORKDIR /app
|
||||
|
@ -20,4 +20,4 @@ COPY --from=builder /app/.next ./.next
|
|||
COPY --from=dependencies /app/node_modules ./node_modules
|
||||
|
||||
EXPOSE 4200
|
||||
CMD ["yarn", "start"]
|
||||
CMD ["npm", "start"]
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
FROM node:18-alpine AS base
|
||||
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV production
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
RUN mkdir .next
|
||||
RUN chown nextjs:nodejs .next
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 4200
|
||||
|
||||
ENV PORT 4200
|
||||
|
||||
CMD HOSTNAME="0.0.0.0" node server.js
|
|
@ -28,6 +28,7 @@ const nextConfig = {
|
|||
taint: true,
|
||||
// typedRoutes: true
|
||||
},
|
||||
// output: 'standalone',
|
||||
poweredByHeader: false,
|
||||
productionBrowserSourceMaps: true,
|
||||
trailingSlash: true
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,9 @@
|
|||
import React from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
|
||||
export default function Directions({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
|
||||
export default function Directions() {
|
||||
return (
|
||||
<div className="main-popular">
|
||||
<div className="b-inner">
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Experts } from '../../../../components/Experts/Experts';
|
||||
|
||||
export default function ExpertsPage({ params }: { params: { locale: string } }) {
|
||||
export default function ExpertsPage({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('Experts');
|
||||
|
||||
return (
|
||||
|
@ -14,7 +16,7 @@ export default function ExpertsPage({ params }: { params: { locale: string } })
|
|||
<img src="/images/options-outline.svg" className="" alt=""/>
|
||||
</div>
|
||||
</div>
|
||||
<Experts locale={params.locale} />
|
||||
<Experts locale={locale} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { i18nText } from '../../../../../i18nKeys';
|
||||
|
||||
|
@ -9,6 +10,7 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default function Information({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('Account.LegalInformation');
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { Link } from '../../../../../../navigation';
|
||||
import { i18nText } from '../../../../../../i18nKeys';
|
||||
|
||||
|
@ -17,7 +17,7 @@ export function generateStaticParams({
|
|||
}
|
||||
|
||||
export default function Message({ params }: { params: { locale: string, textId: string } }) {
|
||||
const t = useTranslations('Account.Messages');
|
||||
unstable_setRequestLocale(params.locale);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
'use client'
|
||||
|
||||
import React, { Suspense } from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { Link } from '../../../../../navigation';
|
||||
import { CustomInput } from '../../../../../components/view/CustomInput';
|
||||
import { i18nText } from '../../../../../i18nKeys';
|
||||
|
||||
export default function Messages({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ol className="breadcrumb">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import dayjs from 'dayjs';
|
||||
import 'dayjs/locale/ru';
|
||||
import 'dayjs/locale/en';
|
||||
|
@ -15,6 +16,7 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default function Notifications({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const date = dayjs('2022-05-22').locale(locale);
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import React from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { Link } from '../../../../../../navigation';
|
||||
import { i18nText } from '../../../../../../i18nKeys/';
|
||||
|
||||
export default function ChangePassword({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ol className="breadcrumb">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React, { Suspense } from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { ProfileSettings } from '../../../../../components/Account';
|
||||
import { i18nText } from '../../../../../i18nKeys';
|
||||
|
@ -10,6 +11,7 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default function Settings({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('Account.Settings');
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import type { Metadata } from 'next';
|
||||
import { i18nText } from '../../../../../i18nKeys';
|
||||
|
||||
|
@ -8,6 +9,8 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default function Support({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ol className="breadcrumb">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { i18nText } from '../../../../../i18nKeys';
|
||||
|
||||
|
@ -9,6 +10,7 @@ export const metadata: Metadata = {
|
|||
};
|
||||
|
||||
export default function WorkWithUs({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('Account.WorkWithUs');
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { Suspense } from 'react';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { AccountMenu, SessionDetails, SessionsTabs } from '../../../../../../components/Account';
|
||||
import { SessionType } from '../../../../../../types/sessions';
|
||||
|
@ -12,6 +13,7 @@ export async function generateStaticParams({
|
|||
}
|
||||
|
||||
export default function SessionDetailItem({ params: { locale, slug } }: { params: { locale: string, slug?: string[] } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const sessionType: string = slug?.length > 0 && slug[0] || '';
|
||||
const sessionId: number | null = slug?.length > 1 && Number(slug[1]) || null;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { GeneralTopSection } from '../../../components/Page';
|
||||
|
||||
|
@ -8,7 +9,8 @@ export const metadata: Metadata = {
|
|||
description: 'Bbuddy desc Take the lead with BB'
|
||||
};
|
||||
|
||||
export default function BbClientPage() {
|
||||
export default function BbClientPage({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('BbClient');
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { GeneralTopSection } from '../../../components/Page';
|
||||
import { ScreenCarousel } from '../../../components/Page/ScreenCarousel/index';
|
||||
|
@ -9,7 +10,8 @@ export const metadata: Metadata = {
|
|||
description: 'Bbuddy desc Become a BB expert'
|
||||
};
|
||||
|
||||
export default function BbExpertPage() {
|
||||
export default function BbExpertPage({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('BbExpert');
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React, { Suspense } from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { getExpertById, getExpertsList } from '../../../../actions/experts';
|
||||
import {
|
||||
|
@ -19,6 +20,7 @@ export const metadata: Metadata = {
|
|||
export async function generateStaticParams({
|
||||
params: { locale },
|
||||
}: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const result: { locale: string, expertId: string }[] = [];
|
||||
const experts = await getExpertsList(locale, { themesTagIds: [] });
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import type { Metadata } from 'next';
|
||||
import { unstable_setRequestLocale } from 'next-intl/server';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Experts } from '../../../components/Experts/Experts';
|
||||
|
||||
|
@ -8,7 +9,8 @@ export const metadata: Metadata = {
|
|||
description: 'Bbuddy desc experts'
|
||||
};
|
||||
|
||||
export default function ExpertsPage({ params }: { params: { locale: string } }) {
|
||||
export default function ExpertsPage({ params: { locale } }: { params: { locale: string } }) {
|
||||
unstable_setRequestLocale(locale);
|
||||
const t = useTranslations('Experts');
|
||||
|
||||
return (
|
||||
|
@ -22,7 +24,7 @@ export default function ExpertsPage({ params }: { params: { locale: string } })
|
|||
</div>
|
||||
</div>
|
||||
<Experts
|
||||
locale={params.locale}
|
||||
locale={locale}
|
||||
basePath="/experts"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -178,7 +178,7 @@ export const SessionDetailsContent = ({ session, locale, activeType, startSessio
|
|||
className="card-detail__apply"
|
||||
onClick={onApproveSession}
|
||||
loading={approveLoading}
|
||||
disable={finishLoading}
|
||||
disabled={finishLoading}
|
||||
>
|
||||
{activeType === SessionType.UPCOMING
|
||||
? (session?.state === SessionState.STARTED ? 'Join Session' : 'Start Session')
|
||||
|
|
Loading…
Reference in New Issue