Compare commits
17 Commits
7bb7305bb4
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| fee3483f8f | |||
| 63a72d4d77 | |||
| 813d4a55b0 | |||
| 9f1ef506ac | |||
| 9ccbfd4764 | |||
| 4e1261f96b | |||
| 760fbba3b1 | |||
| 8033501068 | |||
| 5d0f766928 | |||
| b0d9ab8381 | |||
| 067af56189 | |||
| 1609f2be60 | |||
| 0b9f0a347e | |||
| bd515fc93a | |||
| ed01f69de7 | |||
| 6cda6a3b9d | |||
| 7f24cd4c1c |
+76
-14
@@ -1,25 +1,42 @@
|
||||
# --------------------
|
||||
# Base
|
||||
# --------------------
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
RUN apk add --no-cache tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && \
|
||||
echo "Asia/Tehran" > /etc/timezone
|
||||
# Change Alpine repo
|
||||
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
|
||||
|
||||
# Configure npm registry mirror (Liara)
|
||||
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
||||
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||
|
||||
|
||||
RUN npm install -g corepack
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
# --------------------
|
||||
# Dependencies
|
||||
# --------------------
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache libc6-compat git
|
||||
COPY package*.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --ignore-scripts
|
||||
|
||||
# RUN apk add --no-cache libc6-compat git
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --legacy-peer-deps --ignore-scripts --loglevel info
|
||||
|
||||
# --------------------
|
||||
# Build
|
||||
# --------------------
|
||||
FROM base AS builder
|
||||
WORKDIR /build
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN pnpm build && pnpm install --prod --frozen-lockfile --ignore-scripts
|
||||
|
||||
RUN npm run build && \
|
||||
npm ci --omit=dev --legacy-peer-deps --ignore-scripts --loglevel info
|
||||
|
||||
# --------------------
|
||||
# Runtime
|
||||
# --------------------
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
@@ -39,8 +56,53 @@ USER appuser
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME="0.0.0.0"
|
||||
ENV NEXT_PUBLIC_BASE_URL=https://api.danakcorp.com
|
||||
ENV NEXT_PUBLIC_TOKEN_NAME=dsc_refresh_token
|
||||
ENV NEXT_PUBLIC_TOKEN_NAME=dsc_token
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
|
||||
# FROM node:22-alpine AS base
|
||||
|
||||
# RUN apk add --no-cache tzdata && \
|
||||
# cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && \
|
||||
# echo "Asia/Tehran" > /etc/timezone
|
||||
|
||||
# RUN npm install -g corepack
|
||||
# RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
# WORKDIR /app
|
||||
|
||||
# FROM base AS deps
|
||||
# RUN apk add --no-cache libc6-compat git
|
||||
# COPY package*.json ./
|
||||
# COPY pnpm-lock.yaml ./
|
||||
# RUN pnpm install --frozen-lockfile --ignore-scripts
|
||||
|
||||
# FROM base AS builder
|
||||
# WORKDIR /build
|
||||
# COPY --from=deps /app/node_modules ./node_modules
|
||||
# COPY . .
|
||||
# RUN pnpm build && pnpm install --prod --frozen-lockfile --ignore-scripts
|
||||
|
||||
# FROM base AS runner
|
||||
# WORKDIR /app
|
||||
|
||||
# ENV NODE_ENV=production
|
||||
# ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
# RUN mkdir .next && chown appuser:appgroup .next
|
||||
|
||||
# COPY --from=builder --chown=appuser:appgroup /build/.next/standalone ./
|
||||
# COPY --from=builder --chown=appuser:appgroup /build/.next/static ./.next/static
|
||||
# COPY --from=builder --chown=appuser:appgroup /build/public ./public
|
||||
# COPY --from=builder --chown=appuser:appgroup /build/package.json ./package.json
|
||||
|
||||
# USER appuser
|
||||
|
||||
# EXPOSE 3000
|
||||
# ENV PORT=3000
|
||||
# ENV HOSTNAME="0.0.0.0"
|
||||
# ENV NEXT_PUBLIC_BASE_URL=https://api.danakcorp.com
|
||||
# ENV NEXT_PUBLIC_TOKEN_NAME=dsc_refresh_token
|
||||
# ENV NEXT_PUBLIC_TOKEN_NAME=dsc_token
|
||||
|
||||
# CMD ["node", "server.js"]
|
||||
|
||||
Generated
+6810
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -18,7 +18,7 @@
|
||||
"iconsax-react": "^0.0.8",
|
||||
"js-cookie": "^3.0.5",
|
||||
"moment-jalaali": "^0.10.4",
|
||||
"next": "15.2.3",
|
||||
"next": "^15.5.9",
|
||||
"rc-rate": "^2.13.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
@@ -39,9 +39,9 @@
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^9",
|
||||
"eslint-config-next": "15.2.3",
|
||||
"eslint-config-next": "15.2.6",
|
||||
"tailwindcss": "^4",
|
||||
"typescript": "^5"
|
||||
},
|
||||
"packageManager": "pnpm@9.15.9+sha512.68046141893c66fad01c079231128e9afb89ef87e2691d69e4d40eee228988295fd4682181bae55b58418c3a253bde65a505ec7c5f9403ece5cc3cd37dcf2531"
|
||||
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
|
||||
}
|
||||
|
||||
Generated
-4163
File diff suppressed because it is too large
Load Diff
@@ -106,12 +106,11 @@ const Conditions: NextPage = () => {
|
||||
</p>
|
||||
<div className="mt-6 font-bold">شرایط بازگشت وجه</div>
|
||||
<p className="mt-4 text-sm leading-7">
|
||||
بازگشت وجه از حساب کاربری فقط با احراز تمام شرایط زیر امکانپذیر خواهد بود:<br />
|
||||
کمترین مبلغی که امکان بازگشت وجه برای آن وجود دارد ۵۰۰ هزار تومان است.<br />
|
||||
بازگشت وجه از حساب کاربری فقط با احراز تمام شرایط زیر امکانپذیر خواهد بود:.<br />
|
||||
حداقل باید دو هفته از واریز مبلغ وجه گذشته باشد.<br />
|
||||
ارسال تصویر کارت ملی و ارایهی شماره حساب (شماره کارت) واریزکنندهی وجه، که همان مالک حساب کاربری یا یکی از ادمینهای آن حساب کاربری است، الزامی است.<br />
|
||||
نام و نامخانوادگی، شماره تماس و کد ملی فرم عودت وجه و حساب کاربری باید همخوانی داشته باشند.<br />
|
||||
فرم درخواست بازگشت وجه باید پس از تکمیل به تیکت مربوطه پیوست شود.<br />
|
||||
فرم درخواست بازگشت وجه باید پس از تکمیل به تیکت مربوطه پیوست شود و دلایل کنسلی مرتبط با عدم کارکرد صحیح محصولات داناک باشد. در غیر اینصورت بازگشت وجه به هیچ وجه مقدور نیست.<br />
|
||||
تمامی مبالغی که در پروموشنها و کمپینها واریز میشوند، غیرقابل بازگشت است.<br />
|
||||
توجه:<br />
|
||||
با احراز همهی شرایط بالا، برای هر حساب کاربری تنها یک بار امکان بازگشت وجه وجود دارد.<br />
|
||||
@@ -121,7 +120,7 @@ const Conditions: NextPage = () => {
|
||||
فرم درخواست بازگشت وجه برای حسابهای حقوقی، باید از طرف شرکت بهشکل رسمی مهر شود.<br />
|
||||
تمامی واریزیها باید از حساب مالک حساب کاربری باشد.<br />
|
||||
عودت وجه فقط به همان حسابی که پرداخت با آن انجام شده، قابل انجام است.<br />
|
||||
با احراز همهی شرایط از سمت کاربر، بازگشت وجه پس از حداقل ۷ روز کاری انجام خواهد شد.
|
||||
با احراز همهی شرایط از سمت کاربر، بازگشت وجه پس از حداقل ۱۴ روز کاری انجام خواهد شد.
|
||||
</p>
|
||||
<div className="mt-6 font-bold">دامنهی خدمات پشتیبانی فنی</div>
|
||||
<p className="mt-4 text-sm leading-7">
|
||||
|
||||
@@ -85,7 +85,15 @@ const ContactForm = () => {
|
||||
color='black'
|
||||
/>
|
||||
<div className='text-sm'>
|
||||
تهران - یوسف آباد - فتحی شقاقی - پلاک ۵ - واحد ۱۳
|
||||
دفتر مرکزی: تهران - یوسف آباد - فتحی شقاقی - پلاک ۵ - واحد ۱۳ </div>
|
||||
</div>
|
||||
<div className='flex gap-4 mt-4 items-center'>
|
||||
<Location
|
||||
size={24}
|
||||
color='black'
|
||||
/>
|
||||
<div className='text-sm'>
|
||||
دفتر اراک: بلوار قدوسی - برج دماوند - بلوک A - طبقه هفتم - واحد ۲
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,7 @@ const CreateReview: FC<Props> = ({ refetch, id }) => {
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
if (error.response && 'status' in error.response && error.response.status === 401) {
|
||||
window.location.href = LOGIN_URL + '?redirect=' + window.location.href
|
||||
window.location.href = LOGIN_URL
|
||||
} else {
|
||||
toast(error.response?.data?.error?.message?.[0] || 'An error occurred', 'error')
|
||||
}
|
||||
@@ -64,7 +64,7 @@ const CreateReview: FC<Props> = ({ refetch, id }) => {
|
||||
</div>
|
||||
|
||||
<div className='mt-6 flex justify-center'>
|
||||
<Link href={LOGIN_URL + '?redirect=' + window.location.href}>
|
||||
<Link href={LOGIN_URL}>
|
||||
<Button
|
||||
label={'ورود | ثبت نام'}
|
||||
className='w-fit px-7'
|
||||
|
||||
@@ -1,51 +1,39 @@
|
||||
import 'swiper/css/navigation';
|
||||
import Button from '@/components/Button'
|
||||
import Image from 'next/image'
|
||||
import { FC } from 'react'
|
||||
import { Navigation } from 'swiper/modules'
|
||||
import { Swiper, SwiperSlide } from 'swiper/react'
|
||||
import { useGetLanding } from './hooks/useHomeData';
|
||||
import Link from 'next/link';
|
||||
import Button from "@/components/Button";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { FC } from "react";
|
||||
import "swiper/css/navigation";
|
||||
import { Navigation } from "swiper/modules";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import { useGetLanding } from "./hooks/useHomeData";
|
||||
|
||||
const HeroSection: FC = () => {
|
||||
const { data } = useGetLanding();
|
||||
|
||||
const { data } = useGetLanding()
|
||||
return (
|
||||
<Swiper navigation={true} modules={[Navigation]} className="mySwiper">
|
||||
{data?.data?.sliders?.map((item) => {
|
||||
return (
|
||||
<SwiperSlide key={item.id}>
|
||||
<div className="relative">
|
||||
<Image src={item.imageUrl} alt="banner" width={1920} height={1080} quality={100} className="w-full rounded-4xl object-cover mt-4 min-h-[210px] max-h-[700px]" />
|
||||
|
||||
return (
|
||||
<Swiper navigation={true} modules={[Navigation]} className="mySwiper">
|
||||
{
|
||||
data?.data?.sliders?.map((item) => {
|
||||
return (
|
||||
<SwiperSlide key={item.id}>
|
||||
<div className='relative'>
|
||||
<Image
|
||||
src={item.imageUrl}
|
||||
alt='banner'
|
||||
width={1920}
|
||||
height={1080}
|
||||
className='w-full rounded-4xl object-cover xl:mt-14 mt-8 min-h-[210px] max-h-[500px]'
|
||||
/>
|
||||
<div className="absolute flex items-center z-1 top-0 left-0 w-full h-full bg-black/10 rounded-4xl">
|
||||
<div className="max-w-maxWidth flex flex-col mt-1 xl:mt-0 xl:items-start items-center w-full mx-auto px-10 xl:text-4xl text-lg text-white">
|
||||
<p className="xl:text-lg text-sm">{item.title}</p>
|
||||
<p className="xl:mt-5 mt-2 xl:text-2xl text-sm font-bold">{item.description}</p>
|
||||
|
||||
<div className='absolute flex items-center z-1 top-0 left-0 w-full h-full bg-black/10 rounded-4xl'>
|
||||
<div className='max-w-maxWidth flex flex-col mt-1 xl:mt-0 xl:items-start items-center w-full mx-auto px-10 xl:text-4xl text-lg text-white'>
|
||||
<p className='xl:text-lg text-sm'>{item.title}</p>
|
||||
<p className='xl:mt-5 mt-2 xl:text-2xl text-sm font-bold'>{item.description}</p>
|
||||
<Link href={item.link}>
|
||||
<Button className="xl:mt-5 mt-2 w-fit! xl:px-10 px-5 h-8 xl:h-10 bg-white !text-black" label="بیشتر بدانید" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
);
|
||||
})}
|
||||
</Swiper>
|
||||
);
|
||||
};
|
||||
|
||||
<Link href={item.link}>
|
||||
<Button
|
||||
className='xl:mt-5 mt-2 !w-fit xl:px-10 px-5 h-8 xl:h-10 bg-white !text-black'
|
||||
label='بیشتر بدانید'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Swiper>
|
||||
)
|
||||
}
|
||||
|
||||
export default HeroSection
|
||||
export default HeroSection;
|
||||
|
||||
+16
-18
@@ -1,29 +1,29 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
// import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "@/assets/fonts/irancell/style.css";
|
||||
import "rc-rate/assets/index.css";
|
||||
import "swiper/css";
|
||||
import "./globals.css";
|
||||
import 'rc-rate/assets/index.css';
|
||||
import "@/assets/fonts/irancell/style.css";
|
||||
// import { ToastContainer } from 'react-toastify';
|
||||
import Header from "@/shared/Header";
|
||||
import Footer from "@/shared/Footer";
|
||||
import Header from "@/shared/Header";
|
||||
import SideBar from "@/shared/SideBar";
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
|
||||
import QueryProvider from "@/config/QueryProvider";
|
||||
import ToastContainer from "@/components/Toast";
|
||||
import QueryProvider from "@/config/QueryProvider";
|
||||
// import SplashChatgpt from "@/components/SplashChatgpt";
|
||||
// import Splash from "@/components/Splash";
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
// const geistSans = Geist({
|
||||
// variable: "--font-geist-sans",
|
||||
// subsets: ["latin"],
|
||||
// });
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
// const geistMono = Geist_Mono({
|
||||
// variable: "--font-geist-mono",
|
||||
// subsets: ["latin"],
|
||||
// });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "danakcorp",
|
||||
@@ -51,12 +51,10 @@ export default function RootLayout({
|
||||
}}
|
||||
/>
|
||||
</head>
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
<body className="antialiased">
|
||||
<QueryProvider>
|
||||
{/* <Splash /> */}
|
||||
<div className="font-irancell xl:p-16 p-4">
|
||||
<div className="font-irancell xl:p-16 xl:pt-4 p-4">
|
||||
<SideBar />
|
||||
<Header />
|
||||
{children}
|
||||
|
||||
@@ -29,7 +29,7 @@ const ExpandableContent: FC<Props> = memo(({ html, collapsedHeightClass = 'max-h
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={clx(
|
||||
'relative text-[13px] text-description leading-6',
|
||||
'relative text-[13px] leading-6',
|
||||
!expanded && 'overflow-hidden',
|
||||
!expanded && collapsedHeightClass,
|
||||
)}
|
||||
|
||||
@@ -13,12 +13,12 @@ type Props = {
|
||||
|
||||
const RadioGroup: FC<Props> = (props: Props) => {
|
||||
return (
|
||||
<div className='flex gap-5 items-center text-xs'>
|
||||
<div className='flex flex-wrap gap-5 items-center text-xs'>
|
||||
{
|
||||
props.items.map((item, index) => (
|
||||
<div key={index} className='flex gap-2 items-center'>
|
||||
<div key={index} className='flex flex-wrap gap-2 items-center'>
|
||||
<Radio value={item.value} onChange={props.onChange} isActive={item.value === props.selected} />
|
||||
<div className='mt-0.5'>
|
||||
<div className='mt-0.5 whitespace-nowrap'>
|
||||
{item.label}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { IApiErrorRepsonse } from '@/types/error.types'
|
||||
import { QueryClient, QueryClientProvider, HydrationBoundary, QueryCache } from '@tanstack/react-query'
|
||||
import { QueryClient, QueryClientProvider, QueryCache } from '@tanstack/react-query'
|
||||
import { ReactNode, useState } from 'react'
|
||||
import { removeToken } from './func'
|
||||
import { useSharedStore } from '@/shared/store/sharedStore'
|
||||
@@ -27,9 +27,7 @@ export default function QueryProvider({ children }: { children: ReactNode }) {
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={client}>
|
||||
<HydrationBoundary state={{}}>
|
||||
{children}
|
||||
</HydrationBoundary>
|
||||
{children}
|
||||
</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
@@ -79,8 +79,8 @@ const Header: FC = () => {
|
||||
|
||||
{typeof window !== 'undefined' && (
|
||||
(() => {
|
||||
const currentUrl = window.location.href
|
||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}?redirect=${encodeURIComponent(currentUrl)}`
|
||||
// const currentUrl = window.location.href
|
||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}`
|
||||
return (
|
||||
<a href={profileLink} target='_blank' className='border-l-2 whitespace-nowrap border-[#D8DCE4] pl-4 flex gap-2'>
|
||||
<Profile
|
||||
@@ -129,8 +129,8 @@ const Header: FC = () => {
|
||||
|
||||
{typeof window !== 'undefined' && (
|
||||
(() => {
|
||||
const currentUrl = window.location.href
|
||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}?redirect=${encodeURIComponent(currentUrl)}`
|
||||
// const currentUrl = window.location.href
|
||||
const profileLink = isLogin ? `${CONSOLE_URL}/dashboard` : `${LOGIN_URL}`
|
||||
return (
|
||||
<a href={profileLink} target='_blank'>
|
||||
<Profile
|
||||
|
||||
+108
-120
@@ -1,136 +1,124 @@
|
||||
'use client'
|
||||
import { FC } from 'react'
|
||||
import { Building4, CodeCircle, DocumentText, Element3, Element4, Home2, UserSquare } from 'iconsax-react'
|
||||
import SideBarItem from './SideBarItem'
|
||||
import { useSharedStore } from './store/sharedStore'
|
||||
import { clx } from '../helpers/utils'
|
||||
import Image from 'next/image'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import Button from '@/components/Button'
|
||||
import Link from 'next/link'
|
||||
import { CONSOLE_URL, LOGIN_URL } from '@/config/const'
|
||||
"use client";
|
||||
import Button from "@/components/Button";
|
||||
import { CONSOLE_URL, LOGIN_URL } from "@/config/const";
|
||||
import { Building4, CodeCircle, DocumentText, Element3, Element4, Home2, UserSquare } from "iconsax-react";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { FC } from "react";
|
||||
import { clx } from "../helpers/utils";
|
||||
import SideBarItem from "./SideBarItem";
|
||||
import { useSharedStore } from "./store/sharedStore";
|
||||
|
||||
const SideBar: FC = () => {
|
||||
|
||||
const { openSidebar, setOpenSidebar, isLogin } = useSharedStore()
|
||||
const pathname = usePathname()
|
||||
const isActive = (name: string) => {
|
||||
if (pathname === '/' && name === 'home') {
|
||||
return true
|
||||
}
|
||||
return pathname.includes(name)
|
||||
const { openSidebar, setOpenSidebar, isLogin } = useSharedStore();
|
||||
const pathname = usePathname();
|
||||
const isActive = (name: string) => {
|
||||
if (pathname === "/" && name === "home") {
|
||||
return true;
|
||||
}
|
||||
return pathname.includes(name);
|
||||
};
|
||||
|
||||
const iconSizeSideBar = 20
|
||||
const iconSizeSideBar = 20;
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
openSidebar && <div className='fixed top-0 left-0 right-0 bottom-0 bg-black/50 z-10' onClick={() => setOpenSidebar(false)} />
|
||||
}
|
||||
<div
|
||||
className={clx(
|
||||
'fixed xl:flex translate-x-[400px] xl:translate-x-0 transition-all ease-in-out opacity-0 invisible xl:right-4 right-0 xl:top-4 top-0 xl:bottom-4 bottom-0 xl:rounded-[32px] w-[250px] bg-white flex-col py-12',
|
||||
openSidebar && 'opacity-100 visible -translate-x-[0px] block z-40'
|
||||
)}
|
||||
>
|
||||
<div className='flex justify-center'>
|
||||
<Image src={'/images/logo.svg'} width={140} height={40} alt='logo' className='w-[140px]' />
|
||||
</div>
|
||||
return (
|
||||
<>
|
||||
{openSidebar && <div className="fixed top-0 left-0 right-0 bottom-0 bg-black/50 z-10" onClick={() => setOpenSidebar(false)} />}
|
||||
<div
|
||||
className={clx(
|
||||
"fixed xl:flex translate-x-[400px] xl:translate-x-0 transition-all ease-in-out opacity-0 invisible xl:right-4 right-0 xl:top-4 top-0 xl:bottom-4 bottom-0 xl:rounded-[32px] w-[250px] bg-white flex-col py-12",
|
||||
openSidebar && "opacity-100 visible -translate-x-[0px] block z-40",
|
||||
)}
|
||||
>
|
||||
<div className="flex justify-center">
|
||||
<Image src={"/images/logo.svg"} width={140} height={40} alt="logo" className="w-[140px]" />
|
||||
</div>
|
||||
|
||||
<div className='flex-1 flex flex-col h-full overflow-y-auto no-scrollbar'>
|
||||
<div className='mt-10 px-12 text-header text-sm font-normal'>
|
||||
منو
|
||||
</div>
|
||||
<div className="flex-1 flex flex-col h-full overflow-y-auto no-scrollbar">
|
||||
<div className="mt-10 px-12 text-header text-sm font-normal">منو</div>
|
||||
|
||||
<div className='text-xs text-[#8C90A3]'>
|
||||
<SideBarItem
|
||||
icon={<Home2 variant={isActive('home') ? 'Bold' : 'Outline'} color={isActive('home') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title='صفحه اصلی'
|
||||
isActive={isActive('home')}
|
||||
link={'/'}
|
||||
/>
|
||||
<div className="text-xs text-[#8C90A3]">
|
||||
<SideBarItem
|
||||
icon={<Home2 variant={isActive("home") ? "Bold" : "Outline"} color={isActive("home") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title="صفحه اصلی"
|
||||
isActive={isActive("home")}
|
||||
link={"/"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<Element3 variant={isActive('products') ? 'Bold' : 'Outline'} color={isActive('products') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'محصولات'}
|
||||
isActive={isActive('products')}
|
||||
link={'/products'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<Element3 variant={isActive("products") ? "Bold" : "Outline"} color={isActive("products") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"محصولات"}
|
||||
isActive={isActive("products")}
|
||||
link={"/products"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<Element4 variant={isActive('danak-services') ? 'Bold' : 'Outline'} color={isActive('danak-services') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'خدمات دناک'}
|
||||
isActive={isActive('danak-services')}
|
||||
link={'/danak-services'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<Element4 variant={isActive("danak-services") ? "Bold" : "Outline"} color={isActive("danak-services") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"خدمات دناک"}
|
||||
isActive={isActive("danak-services")}
|
||||
link={"/danak-services"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<UserSquare variant={isActive('representatives') ? 'Bold' : 'Outline'} color={isActive('representatives') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'نمایندگان'}
|
||||
isActive={isActive('representatives')}
|
||||
link={'/representatives'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<UserSquare variant={isActive("representatives") ? "Bold" : "Outline"} color={isActive("representatives") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"نمایندگان"}
|
||||
isActive={isActive("representatives")}
|
||||
link={"/representatives"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<CodeCircle variant={isActive('developers') ? 'Bold' : 'Outline'} color={isActive('developers') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'توسعه دهندگان'}
|
||||
isActive={isActive('developers')}
|
||||
link={'/developers'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<CodeCircle variant={isActive("developers") ? "Bold" : "Outline"} color={isActive("developers") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"توسعه دهندگان"}
|
||||
isActive={isActive("developers")}
|
||||
link={"/developers"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<Building4 variant={isActive('about') ? 'Bold' : 'Outline'} color={isActive('about') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'درباره ما'}
|
||||
isActive={isActive('about')}
|
||||
link={'/about'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<Building4 variant={isActive("about") ? "Bold" : "Outline"} color={isActive("about") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"درباره ما"}
|
||||
isActive={isActive("about")}
|
||||
link={"/about"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<DocumentText variant={isActive('blogs') ? 'Bold' : 'Outline'} color={isActive('blogs') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'مجله دی مگ'}
|
||||
isActive={isActive('blogs')}
|
||||
link={'/dmag'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<DocumentText variant={isActive("blogs") ? "Bold" : "Outline"} color={isActive("blogs") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"مجله دی مگ"}
|
||||
isActive={isActive("blogs")}
|
||||
link={"/dmag"}
|
||||
/>
|
||||
|
||||
<SideBarItem
|
||||
icon={<DocumentText variant={isActive('contact') ? 'Bold' : 'Outline'} color={isActive('contact') ? 'black' : '#8C90A3'} size={iconSizeSideBar} />}
|
||||
title={'تماس با ما'}
|
||||
isActive={isActive('contact')}
|
||||
link={'/contact'}
|
||||
/>
|
||||
<SideBarItem
|
||||
icon={<DocumentText variant={isActive("contact") ? "Bold" : "Outline"} color={isActive("contact") ? "black" : "#8C90A3"} size={iconSizeSideBar} />}
|
||||
title={"تماس با ما"}
|
||||
isActive={isActive("contact")}
|
||||
link={"/contact"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{typeof window !== "undefined" &&
|
||||
(() => {
|
||||
if (!isLogin)
|
||||
return (
|
||||
<div className="flex-1 flex items-end justify-center px-12">
|
||||
<Link className="w-full" href={`${LOGIN_URL}`}>
|
||||
<Button label="ورود | ثبت نام" />
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
else
|
||||
return (
|
||||
<div className="flex-1 flex items-end justify-center px-12">
|
||||
<Link className="w-full" href={`${CONSOLE_URL}/dashboard`}>
|
||||
<Button label="ناحیه کاربری" />
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
{typeof window !== 'undefined' && (
|
||||
(() => {
|
||||
if (!isLogin)
|
||||
return (
|
||||
<div className='flex-1 flex items-end justify-center px-12'>
|
||||
<Link className='w-full' href={`${LOGIN_URL}?redirect=${encodeURIComponent(window.location.href)}`}>
|
||||
<Button
|
||||
label='ورود | ثبت نام'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
else
|
||||
return (
|
||||
<div className='flex-1 flex items-end justify-center px-12'>
|
||||
<Link className='w-full' href={`${CONSOLE_URL}/dashboard`}>
|
||||
<Button
|
||||
label='ناحیه کاربری'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
})()
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default SideBar
|
||||
export default SideBar;
|
||||
|
||||
Reference in New Issue
Block a user