link
This commit is contained in:
@@ -12,11 +12,15 @@ interface BigBlogItemProps {
|
|||||||
const BigBlogItem: FC<BigBlogItemProps> = ({ item }) => {
|
const BigBlogItem: FC<BigBlogItemProps> = ({ item }) => {
|
||||||
return (
|
return (
|
||||||
<div className='w-full rounded-4xl bg-white p-7 flex xl:flex-row flex-col gap-6'>
|
<div className='w-full rounded-4xl bg-white p-7 flex xl:flex-row flex-col gap-6'>
|
||||||
<Image src={item.imageUrl} alt='blog' width={300} height={300} className='size-[150px] object-cover mx-auto xl:mx-0 rounded-4xl' />
|
<Link href={`/blogs/${item.id}`}>
|
||||||
|
<Image src={item.imageUrl} alt='blog' width={300} height={300} className='size-[150px] object-cover mx-auto xl:mx-0 rounded-4xl' />
|
||||||
|
</Link>
|
||||||
<div className='flex-1'>
|
<div className='flex-1'>
|
||||||
<h4 className='font-bold text-sm leading-6'>
|
<Link href={`/blogs/${item.id}`}>
|
||||||
{item.title}
|
<h4 className='font-bold text-sm leading-6 hover:opacity-70 transition-opacity'>
|
||||||
</h4>
|
{item.title}
|
||||||
|
</h4>
|
||||||
|
</Link>
|
||||||
|
|
||||||
<div className='mt-3 flex gap-3 text-xs'>
|
<div className='mt-3 flex gap-3 text-xs'>
|
||||||
<div className='flex text-[#7D818C] items-center gap-1'>
|
<div className='flex text-[#7D818C] items-center gap-1'>
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import BigBlogItem from './BigBlogItem'
|
|||||||
import MostVisited from './MostVisited'
|
import MostVisited from './MostVisited'
|
||||||
import ContactUs from './ContactUs'
|
import ContactUs from './ContactUs'
|
||||||
import { useGetBlogs } from '../hooks/useBlogsData'
|
import { useGetBlogs } from '../hooks/useBlogsData'
|
||||||
|
import { useBlogStore } from '../store/BlogStore'
|
||||||
const BlogList: FC = () => {
|
const BlogList: FC = () => {
|
||||||
|
|
||||||
const { data } = useGetBlogs()
|
const { selectedCategory } = useBlogStore()
|
||||||
|
const { data } = useGetBlogs(selectedCategory)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className=''>
|
<div className=''>
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import { useGetBlogCategories } from '../hooks/useBlogsData'
|
|||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { useBlogStore } from '../store/BlogStore'
|
import { useBlogStore } from '../store/BlogStore'
|
||||||
const Category: FC = () => {
|
const Category: FC = () => {
|
||||||
|
|
||||||
const { data } = useGetBlogCategories()
|
const { data } = useGetBlogCategories()
|
||||||
const { selectedCategory, setSelectedCategory } = useBlogStore()
|
const { selectedCategory, setSelectedCategory } = useBlogStore()
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full rounded-4xl bg-white p-4'>
|
<div className='w-full rounded-4xl bg-white p-4'>
|
||||||
<h4>
|
<h4>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const HeroSection: FC = () => {
|
|||||||
<div className='flex xl:flex-row flex-col gap-8 mt-10'>
|
<div className='flex xl:flex-row flex-col gap-8 mt-10'>
|
||||||
{
|
{
|
||||||
data?.data?.mostVisitedBlogs?.map((item, index: number) => {
|
data?.data?.mostVisitedBlogs?.map((item, index: number) => {
|
||||||
if (index !== 0) {
|
if (index !== 0 && index < 4) {
|
||||||
return (
|
return (
|
||||||
<BlogItem key={item.id} item={item} />
|
<BlogItem key={item.id} item={item} />
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
import { Blog } from '../types/BlogTypes'
|
import { Blog } from '../types/BlogTypes'
|
||||||
|
import Link from 'next/link'
|
||||||
const MiniBlogItem: FC<{ item: Blog }> = ({ item }) => {
|
const MiniBlogItem: FC<{ item: Blog }> = ({ item }) => {
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<Image
|
<Link href={`/blogs/${item.id}`}>
|
||||||
src={item.imageUrl}
|
<Image
|
||||||
alt={item.title}
|
src={item.imageUrl}
|
||||||
width={72}
|
alt={item.title}
|
||||||
height={72}
|
width={72}
|
||||||
className='rounded-xl size-[72px] min-w-[72px] object-cover'
|
height={72}
|
||||||
/>
|
className='rounded-xl size-[72px] min-w-[72px] object-cover'
|
||||||
<h6 className='text-xs leading-5 font-bold'>
|
/>
|
||||||
{item.title}
|
</Link>
|
||||||
</h6>
|
|
||||||
|
<Link href={`/blogs/${item.id}`}>
|
||||||
|
<h6 className='text-xs leading-5 font-bold hover:opacity-70 transition-opacity'>
|
||||||
|
{item.title}
|
||||||
|
</h6>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import { useQuery } from "@tanstack/react-query";
|
|||||||
import * as api from "../service/BlogService";
|
import * as api from "../service/BlogService";
|
||||||
|
|
||||||
// برای client
|
// برای client
|
||||||
export const useGetBlogs = () =>
|
export const useGetBlogs = (categoryId: string) =>
|
||||||
useQuery({
|
useQuery({
|
||||||
queryKey: ["blogs"],
|
queryKey: ["blogs", categoryId],
|
||||||
queryFn: api.getBlogs,
|
queryFn: () => api.getBlogs(categoryId),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useGetMostVisitedBlogs = () =>
|
export const useGetMostVisitedBlogs = () =>
|
||||||
@@ -40,8 +40,8 @@ export const useGetBlogSingle = (id: string) =>
|
|||||||
|
|
||||||
// برای server prefetch
|
// برای server prefetch
|
||||||
export const blogsQueryOptions = {
|
export const blogsQueryOptions = {
|
||||||
queryKey: ["blogs"],
|
queryKey: ["blogs", ""],
|
||||||
queryFn: api.getBlogs,
|
queryFn: () => api.getBlogs(""),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const blogSingleQueryOptions = (id: string) => ({
|
export const blogSingleQueryOptions = (id: string) => ({
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ import {
|
|||||||
BlogSingleResponse,
|
BlogSingleResponse,
|
||||||
} from "../types/BlogTypes";
|
} from "../types/BlogTypes";
|
||||||
|
|
||||||
export const getBlogs = async () => {
|
export const getBlogs = async (categoryId: string) => {
|
||||||
const { data } = await axios.get<BlogResponse>(`/blogs`);
|
let query = "";
|
||||||
|
if (categoryId) {
|
||||||
|
query = `?categoryId=${categoryId}`;
|
||||||
|
}
|
||||||
|
const { data } = await axios.get<BlogResponse>(`/blogs${query}`);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -103,3 +103,7 @@ tbody tr {
|
|||||||
.rc-rate-star {
|
.rc-rate-star {
|
||||||
margin-right: 3px !important; /* فاصله بین ستارهها */
|
margin-right: 3px !important; /* فاصله بین ستارهها */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#blog-preview-content * {
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,10 +14,11 @@ const Blog: FC = () => {
|
|||||||
|
|
||||||
<div className='flex xl:flex-row flex-col gap-8 xl:mt-16 mt-10 items-center'>
|
<div className='flex xl:flex-row flex-col gap-8 xl:mt-16 mt-10 items-center'>
|
||||||
{
|
{
|
||||||
data?.data?.pinnedBlogs?.map((item) => {
|
data?.data?.pinnedBlogs?.map((item, index: number) => {
|
||||||
return (
|
if (index < 3)
|
||||||
<BlogItem key={item.id} item={item} />
|
return (
|
||||||
)
|
<BlogItem key={item.id} item={item} />
|
||||||
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Blog } from '@/app/blogs/types/BlogTypes'
|
import { Blog } from '@/app/blogs/types/BlogTypes'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
import Link from 'next/link'
|
||||||
import { FC } from 'react'
|
import { FC } from 'react'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -8,7 +9,7 @@ interface Props {
|
|||||||
|
|
||||||
const BlogItem: FC<Props> = ({ item }) => {
|
const BlogItem: FC<Props> = ({ item }) => {
|
||||||
return (
|
return (
|
||||||
<div className='flex-1 w-full min-h-[390px] rounded-4xl overflow-hidden relative'>
|
<Link href={`/blogs/${item.id}`} className='flex-1 w-full min-h-[390px] rounded-4xl overflow-hidden relative'>
|
||||||
<Image
|
<Image
|
||||||
src={item.imageUrl}
|
src={item.imageUrl}
|
||||||
layout='fill'
|
layout='fill'
|
||||||
@@ -25,10 +26,10 @@ const BlogItem: FC<Props> = ({ item }) => {
|
|||||||
{item.title}
|
{item.title}
|
||||||
</h6>
|
</h6>
|
||||||
|
|
||||||
<p className='mt-4 text-sm' dangerouslySetInnerHTML={{ __html: item.previewContent }}>
|
<p id='blog-preview-content' className='mt-4 text-sm text-white' dangerouslySetInnerHTML={{ __html: item.previewContent }}>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ type Props = {
|
|||||||
|
|
||||||
const ServiceItem: FC<Props> = (props) => {
|
const ServiceItem: FC<Props> = (props) => {
|
||||||
return (
|
return (
|
||||||
<Link href={`/products/${props.item.id}`} className='flex-1 bg-white rounded-4xl xl:p-7 p-4'>
|
<Link href={`/products/${props.item.id}`} className='flex-1 bg-white rounded-4xl xl:p-7 p-4 flex flex-col'>
|
||||||
<div className='flex justify-between'>
|
<div className='flex justify-between'>
|
||||||
<div className='xl:size-[65px] size-[50px] rounded-2xl overflow-hidden'>
|
<div className='xl:size-[65px] size-[50px] rounded-2xl overflow-hidden'>
|
||||||
<Image src={props.item.icon} className='size-full object-cover' alt={props.item.name} width={65} height={65} />
|
<Image src={props.item.icon} className='size-full object-cover' alt={props.item.name} width={65} height={65} />
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import { getToken } from "./func";
|
|||||||
|
|
||||||
const axiosInstance = axios.create({
|
const axiosInstance = axios.create({
|
||||||
// baseURL: process.env.NEXT_PUBLIC_BASE_URL,
|
// baseURL: process.env.NEXT_PUBLIC_BASE_URL,
|
||||||
baseURL: "http://192.168.1.108:4000",
|
baseURL: "https://api.danakcorp.com",
|
||||||
});
|
});
|
||||||
|
|
||||||
axiosInstance.interceptors.response.use(
|
axiosInstance.interceptors.response.use(
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const Footer: FC = () => {
|
|||||||
|
|
||||||
<div className='flex xl:flex-row flex-col xl:gap-24 gap-7 w-full justify-between xl:px-10'>
|
<div className='flex xl:flex-row flex-col xl:gap-24 gap-7 w-full justify-between xl:px-10'>
|
||||||
|
|
||||||
<div className='xl:max-w-[203px] flex flex-col items-center text-center xl:items-start xl:text-right'>
|
<div className='xl:max-w-[203px] flex flex-col items-center text-right xl:items-start xl:text-right'>
|
||||||
<Image
|
<Image
|
||||||
src={'/images/logo.svg'}
|
src={'/images/logo.svg'}
|
||||||
width={140}
|
width={140}
|
||||||
@@ -19,7 +19,7 @@ const Footer: FC = () => {
|
|||||||
alt='لوگو داناک'
|
alt='لوگو داناک'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<p className='mt-6 text-sm xl:text-justify text-center'>
|
<p className='mt-6 text-sm xl:text-justify text-right'>
|
||||||
ما در داناک هم تولیدکننده نرمافزارهای پیشرفته هستیم و هم بستری برای فروش محصولات نرمافزاری دیگران فراهم کردهایم. با ما هوشمندانه بسازید و حرفهای بفروشید.
|
ما در داناک هم تولیدکننده نرمافزارهای پیشرفته هستیم و هم بستری برای فروش محصولات نرمافزاری دیگران فراهم کردهایم. با ما هوشمندانه بسازید و حرفهای بفروشید.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -29,7 +29,7 @@ const Footer: FC = () => {
|
|||||||
<h6 className='font-bold xl:text-base text-xs'>
|
<h6 className='font-bold xl:text-base text-xs'>
|
||||||
داناک
|
داناک
|
||||||
</h6>
|
</h6>
|
||||||
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-center'>
|
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-right'>
|
||||||
<li>
|
<li>
|
||||||
محصولات
|
محصولات
|
||||||
</li>
|
</li>
|
||||||
@@ -46,7 +46,7 @@ const Footer: FC = () => {
|
|||||||
<h6 className='font-bold xl:text-base text-xs whitespace-nowrap'>
|
<h6 className='font-bold xl:text-base text-xs whitespace-nowrap'>
|
||||||
سرویس ها محبوب
|
سرویس ها محبوب
|
||||||
</h6>
|
</h6>
|
||||||
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-center'>
|
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-right'>
|
||||||
<li>
|
<li>
|
||||||
دی منو
|
دی منو
|
||||||
</li>
|
</li>
|
||||||
@@ -63,7 +63,7 @@ const Footer: FC = () => {
|
|||||||
<h6 className='font-bold xl:text-base text-xs'>
|
<h6 className='font-bold xl:text-base text-xs'>
|
||||||
همکاری با داناک
|
همکاری با داناک
|
||||||
</h6>
|
</h6>
|
||||||
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-center'>
|
<ul className='xl:text-sm text-xs mt-4 flex flex-col gap-4 text-right'>
|
||||||
<li>
|
<li>
|
||||||
توسعه دهندگان
|
توسعه دهندگان
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const Header: FC = () => {
|
|||||||
</li>
|
</li>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link href='/services'>
|
<Link href='/danak-services'>
|
||||||
<li>
|
<li>
|
||||||
خدمات
|
خدمات
|
||||||
</li>
|
</li>
|
||||||
@@ -62,10 +62,12 @@ const Header: FC = () => {
|
|||||||
<div>ورود | ثبت نام</div>
|
<div>ورود | ثبت نام</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<Button
|
<Link href='/contact'>
|
||||||
label='تماس با ما'
|
<Button
|
||||||
className='w-fit px-8'
|
label='تماس با ما'
|
||||||
/>
|
className='w-fit px-8'
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user