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
|
FROM base AS deps
|
||||||
COPY package.json pnpm-lock.yaml ./
|
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 npm i -g pnpm
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
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 npm install -g pnpm
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ARG PORT=5000
|
ARG PORT=3000
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV PORT=$PORT
|
ENV PORT=$PORT
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
PORT: ${PORT:-5000}
|
PORT: ${PORT:-3000}
|
||||||
image: pasargad-bricks:latest
|
image: pasargad-bricks:latest
|
||||||
container_name: pasargad-bricks
|
container_name: pasargad-bricks
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
+11
-10
@@ -10,19 +10,20 @@ const compat = new FlatCompat({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const eslintConfig = [
|
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: {
|
rules: {
|
||||||
// Example: Enforce using `const` for variables that are never reassigned
|
'prefer-const': 'warn',
|
||||||
'prefer-const': 'error',
|
|
||||||
// Example: Disallow unused variables (already often included in recommended configs, but shown for illustration)
|
|
||||||
'no-unused-vars': ['warn', { 'args': 'none' }],
|
'no-unused-vars': ['warn', { 'args': 'none' }],
|
||||||
// Example: Disable a rule if it conflicts with your style or Prettier (less common after plugin:prettier/recommended)
|
'@typescript-eslint/no-unused-vars': ['warn', { 'args': 'none' }],
|
||||||
// 'indent': 'off',
|
'@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/*'],
|
exclude: ['/api/*', '/_next/*'],
|
||||||
// If you want to include additional sitemaps (for subdirectories, etc.)
|
// If you want to include additional sitemaps (for subdirectories, etc.)
|
||||||
// additionalSitemaps: [
|
// 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) {
|
if (!postData) {
|
||||||
return {
|
return {
|
||||||
title: t('page_blog'),
|
title: t('page_blog_metadata_title'),
|
||||||
description: t('page_blog_metadata_description'),
|
description: t('page_blog_metadata_description'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import images from '@/assets/images/images';
|
import images from '@/assets/images/images';
|
||||||
import InnerPageBanner from '@/components/layout/innerPages/banner';
|
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 ContactForm from '@/components/pages/contact/ContactMeForm';
|
||||||
import TouchUs from '@/components/pages/contact/TouchUs';
|
import TouchUs from '@/components/pages/contact/TouchUs';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
import { getTranslations, setRequestLocale } from 'next-intl/server';
|
||||||
import { IPageParams } from '@/models/layout';
|
import { IPageParams } from '@/models/layout';
|
||||||
import Head from 'next/head';
|
|
||||||
|
|
||||||
export async function generateMetadata({ params }: { params: IPageParams }) {
|
export async function generateMetadata({ params }: { params: IPageParams }) {
|
||||||
const { locale } = await params;
|
const { locale } = await params;
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
|||||||
import { localizeContent, localizeText } from '@/lib/domain';
|
import { localizeContent, localizeText } from '@/lib/domain';
|
||||||
import { notFound, ok } from '@/lib/api-response';
|
import { notFound, ok } from '@/lib/api-response';
|
||||||
|
|
||||||
type RouteContext = {
|
export async function GET(
|
||||||
params: {
|
request: Request,
|
||||||
id: string;
|
{ params }: { params: Promise<{ id: string }> },
|
||||||
};
|
) {
|
||||||
};
|
const { id: postId } = await params;
|
||||||
|
|
||||||
export async function GET(request: Request, context: RouteContext) {
|
|
||||||
const postId = context.params.id;
|
|
||||||
|
|
||||||
const locale = await getLocaleFromCookies();
|
const locale = await getLocaleFromCookies();
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,12 @@ import { productCategoriesData } from '../../data';
|
|||||||
import { buildPagination, getPaginationParams } from '@/lib/pagination';
|
import { buildPagination, getPaginationParams } from '@/lib/pagination';
|
||||||
import { notFound, okPaginated } from '@/lib/api-response';
|
import { notFound, okPaginated } from '@/lib/api-response';
|
||||||
|
|
||||||
type RouteContext = {
|
export async function GET(
|
||||||
params: {
|
request: NextRequest,
|
||||||
id: string;
|
{ params }: { params: Promise<{ id: string }> },
|
||||||
};
|
) {
|
||||||
};
|
const { id } = await params;
|
||||||
|
const category = productCategoriesData.find((cat) => cat.id === id);
|
||||||
export async function GET(request: NextRequest, context: RouteContext) {
|
|
||||||
const params = context.params;
|
|
||||||
const category = productCategoriesData.find((cat) => cat.id === params.id);
|
|
||||||
|
|
||||||
if (!category) {
|
if (!category) {
|
||||||
return notFound();
|
return notFound();
|
||||||
|
|||||||
@@ -4,15 +4,12 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
|||||||
import { localizeText } from '@/lib/domain';
|
import { localizeText } from '@/lib/domain';
|
||||||
import { notFound, ok } from '@/lib/api-response';
|
import { notFound, ok } from '@/lib/api-response';
|
||||||
|
|
||||||
type RouteContext = {
|
export async function GET(
|
||||||
params: {
|
request: NextRequest,
|
||||||
id: string;
|
{ params }: { params: Promise<{ id: string }> },
|
||||||
};
|
) {
|
||||||
};
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest, context: RouteContext) {
|
|
||||||
const locale = await getLocaleFromCookies();
|
const locale = await getLocaleFromCookies();
|
||||||
const { id } = context.params;
|
const { id } = await params;
|
||||||
|
|
||||||
let category = productCategoriesData.find((cat) => cat.id === id);
|
let category = productCategoriesData.find((cat) => cat.id === id);
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ import { getLocaleFromCookies } from '@/lib/locale';
|
|||||||
import { localizeContent, localizeText } from '@/lib/domain';
|
import { localizeContent, localizeText } from '@/lib/domain';
|
||||||
import { notFound, ok } from '@/lib/api-response';
|
import { notFound, ok } from '@/lib/api-response';
|
||||||
|
|
||||||
type RouteContext = {
|
export async function GET(
|
||||||
params: {
|
request: Request,
|
||||||
id: string;
|
{ params }: { params: Promise<{ id: string }> },
|
||||||
};
|
) {
|
||||||
};
|
const { id: projectId } = await params;
|
||||||
|
|
||||||
export async function GET(request: Request, context: RouteContext) {
|
|
||||||
const projectId = context.params.id;
|
|
||||||
|
|
||||||
const locale = await getLocaleFromCookies();
|
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 cookieLocale = request.cookies.get('locale')?.value;
|
||||||
const preferredLocale = locales.includes(cookieLocale || '')
|
const preferredLocale = locales.includes(cookieLocale || '')
|
||||||
? cookieLocale
|
? cookieLocale!
|
||||||
: defaultLocale;
|
: defaultLocale;
|
||||||
const locale = matchedLocale || preferredLocale;
|
const locale = matchedLocale || preferredLocale;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { IProjectResponseData } from '@/app/api/projects/data';
|
import {
|
||||||
|
IProjectResponseData,
|
||||||
|
IProjectThumbResponseData,
|
||||||
|
} from '@/app/api/projects/data';
|
||||||
import { serverGet } from '@/lib/server-api';
|
import { serverGet } from '@/lib/server-api';
|
||||||
|
import { IResponse } from '@/models/response';
|
||||||
|
|
||||||
export async function getProjects(page = 1 as number) {
|
export async function getProjects(page = 1 as number) {
|
||||||
return serverGet('/projects', {
|
return serverGet<IResponse<IProjectThumbResponseData[]>>('/projects', {
|
||||||
params: { page },
|
params: { page },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user