Compare commits
7 Commits
730e2d8ca8
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| df34692325 | |||
| bfa7413dfd | |||
| aa5b883a1c | |||
| 0670f4462c | |||
| 27977b1018 | |||
| 9fd23b69e3 | |||
| 3486da6eeb |
+3
-3
@@ -4,20 +4,20 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
FROM base AS deps
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN npm config set registry https://hub.megan.ir/npm
|
||||
# RUN npm config set registry https://hub.megan.ir/npm
|
||||
RUN npm i -g pnpm
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm config set registry https://hub.megan.ir/npm
|
||||
# RUN npm config set registry https://hub.megan.ir/npm
|
||||
RUN npm install -g pnpm
|
||||
RUN pnpm build
|
||||
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
ARG PORT=5000
|
||||
ARG PORT=3000
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=$PORT
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
PORT: ${PORT:-5000}
|
||||
PORT: ${PORT:-3000}
|
||||
image: pasargad-bricks:latest
|
||||
container_name: pasargad-bricks
|
||||
restart: unless-stopped
|
||||
|
||||
+11
-10
@@ -10,19 +10,20 @@ const compat = new FlatCompat({
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
...compat.extends("next/core-web-vitals", "next/typescript", "plugin:prettier/recommended", "plugin:jsx-a11y/recommended"),
|
||||
{
|
||||
extends: [
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:jsx-a11y/recommended', // Add this line
|
||||
],
|
||||
rules: {
|
||||
// Example: Enforce using `const` for variables that are never reassigned
|
||||
'prefer-const': 'error',
|
||||
// Example: Disallow unused variables (already often included in recommended configs, but shown for illustration)
|
||||
'prefer-const': 'warn',
|
||||
'no-unused-vars': ['warn', { 'args': 'none' }],
|
||||
// Example: Disable a rule if it conflicts with your style or Prettier (less common after plugin:prettier/recommended)
|
||||
// 'indent': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { 'args': 'none' }],
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'@typescript-eslint/ban-ts-comment': 'warn',
|
||||
'@typescript-eslint/no-empty-object-type': 'warn',
|
||||
'prettier/prettier': 'warn',
|
||||
'jsx-a11y/click-events-have-key-events': 'warn',
|
||||
'jsx-a11y/no-static-element-interactions': 'warn',
|
||||
'jsx-a11y/alt-text': 'warn',
|
||||
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -13,6 +13,6 @@ module.exports = {
|
||||
exclude: ['/api/*', '/_next/*'],
|
||||
// If you want to include additional sitemaps (for subdirectories, etc.)
|
||||
// additionalSitemaps: [
|
||||
// `${process.env.SITE_URL || 'http://localhost:5000'}/custom-sitemap.xml`,
|
||||
// `${process.env.SITE_URL || 'http://localhost:3000'}/custom-sitemap.xml`,
|
||||
// ],
|
||||
};
|
||||
|
||||
Generated
-6459
File diff suppressed because it is too large
Load Diff
Generated
+1096
-1059
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ export async function generateMetadata({
|
||||
|
||||
if (!postData) {
|
||||
return {
|
||||
title: t('page_blog'),
|
||||
title: t('page_blog_metadata_title'),
|
||||
description: t('page_blog_metadata_description'),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import images from '@/assets/images/images';
|
||||
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
||||
import ContactMap from '@/components/layout/map';
|
||||
import ContactMap from '@/components/layout/map/MapWrapper';
|
||||
import ContactForm from '@/components/pages/contact/ContactMeForm';
|
||||
import TouchUs from '@/components/pages/contact/TouchUs';
|
||||
import Image from 'next/image';
|
||||
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
||||
import { IPageParams } from '@/models/layout';
|
||||
import Head from 'next/head';
|
||||
|
||||
export async function generateMetadata({ params }: { params: IPageParams }) {
|
||||
const { locale } = await params;
|
||||
|
||||
@@ -3,14 +3,11 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
||||
import { localizeContent, localizeText } from '@/lib/domain';
|
||||
import { notFound, ok } from '@/lib/api-response';
|
||||
|
||||
type RouteContext = {
|
||||
params: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
|
||||
export async function GET(request: Request, context: RouteContext) {
|
||||
const postId = context.params.id;
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const { id: postId } = await params;
|
||||
|
||||
const locale = await getLocaleFromCookies();
|
||||
|
||||
|
||||
@@ -4,15 +4,12 @@ import { productCategoriesData } from '../../data';
|
||||
import { buildPagination, getPaginationParams } from '@/lib/pagination';
|
||||
import { notFound, okPaginated } from '@/lib/api-response';
|
||||
|
||||
type RouteContext = {
|
||||
params: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
|
||||
export async function GET(request: NextRequest, context: RouteContext) {
|
||||
const params = context.params;
|
||||
const category = productCategoriesData.find((cat) => cat.id === params.id);
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const { id } = await params;
|
||||
const category = productCategoriesData.find((cat) => cat.id === id);
|
||||
|
||||
if (!category) {
|
||||
return notFound();
|
||||
|
||||
@@ -4,15 +4,12 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
||||
import { localizeText } from '@/lib/domain';
|
||||
import { notFound, ok } from '@/lib/api-response';
|
||||
|
||||
type RouteContext = {
|
||||
params: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
|
||||
export async function GET(request: NextRequest, context: RouteContext) {
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const locale = await getLocaleFromCookies();
|
||||
const { id } = context.params;
|
||||
const { id } = await params;
|
||||
|
||||
let category = productCategoriesData.find((cat) => cat.id === id);
|
||||
|
||||
|
||||
@@ -3,14 +3,11 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
||||
import { localizeContent, localizeText } from '@/lib/domain';
|
||||
import { notFound, ok } from '@/lib/api-response';
|
||||
|
||||
type RouteContext = {
|
||||
params: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
|
||||
export async function GET(request: Request, context: RouteContext) {
|
||||
const projectId = context.params.id;
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const { id: projectId } = await params;
|
||||
|
||||
const locale = await getLocaleFromCookies();
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
const ContactMap = dynamic(() => import('./index'), { ssr: false });
|
||||
|
||||
export default ContactMap;
|
||||
+1
-1
@@ -20,7 +20,7 @@ export function middleware(request: NextRequest) {
|
||||
|
||||
const cookieLocale = request.cookies.get('locale')?.value;
|
||||
const preferredLocale = locales.includes(cookieLocale || '')
|
||||
? cookieLocale
|
||||
? cookieLocale!
|
||||
: defaultLocale;
|
||||
const locale = matchedLocale || preferredLocale;
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
'use server';
|
||||
|
||||
import { IProjectResponseData } from '@/app/api/projects/data';
|
||||
import {
|
||||
IProjectResponseData,
|
||||
IProjectThumbResponseData,
|
||||
} from '@/app/api/projects/data';
|
||||
import { serverGet } from '@/lib/server-api';
|
||||
import { IResponse } from '@/models/response';
|
||||
|
||||
export async function getProjects(page = 1 as number) {
|
||||
return serverGet('/projects', {
|
||||
return serverGet<IResponse<IProjectThumbResponseData[]>>('/projects', {
|
||||
params: { page },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user