fix:banner
This commit is contained in:
parent
2f3b6cb027
commit
3d9975cbcb
|
|
@ -70,7 +70,7 @@ export default function HeaderNews() {
|
|||
search: "",
|
||||
limit: "10",
|
||||
sort: "desc",
|
||||
category: "1906",
|
||||
categoryByIds: "791802",
|
||||
isPublish: true,
|
||||
};
|
||||
const response = await getListArticle(req);
|
||||
|
|
@ -81,7 +81,7 @@ export default function HeaderNews() {
|
|||
<div className="w-full">
|
||||
<div className="flex flex-col lg:flex-row gap-3 lg:gap-8 bg-white dark:bg-black p-1 lg:p-8 lg:h-[540px] w-full lg:w-[75%] lg:mx-auto">
|
||||
<div className="lg:hidden w-[90%] h-[300px] md:h-[500px] mx-auto">
|
||||
{banner ? (
|
||||
{hotNews ? (
|
||||
<Swiper
|
||||
centeredSlides={true}
|
||||
autoplay={{
|
||||
|
|
@ -108,7 +108,7 @@ export default function HeaderNews() {
|
|||
);
|
||||
}}
|
||||
>
|
||||
{banner?.map((newsItem: any, index: number) => (
|
||||
{hotNews?.map((newsItem: any, index: number) => (
|
||||
<SwiperSlide key={newsItem?.id}>
|
||||
<Card
|
||||
radius="lg"
|
||||
|
|
@ -213,7 +213,7 @@ export default function HeaderNews() {
|
|||
</div>
|
||||
|
||||
<div className="hidden lg:flex w-full lg:w-[50%] h-[500px]">
|
||||
{banner ? (
|
||||
{hotNews ? (
|
||||
<Swiper
|
||||
centeredSlides={true}
|
||||
autoplay={{
|
||||
|
|
@ -263,7 +263,7 @@ export default function HeaderNews() {
|
|||
href={`news/detail/${newsItem.id}-${newsItem?.slug}`}
|
||||
>
|
||||
<p className="text-left font-semibold text-lg lg:text-2xl">
|
||||
{newsItem.title}
|
||||
{textEllipsis(newsItem.title, 40)}
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex flex-row gap-1">
|
||||
|
|
@ -316,7 +316,10 @@ export default function HeaderNews() {
|
|||
className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md"
|
||||
>
|
||||
<Link href={`news/detail/${list?.id}`}>
|
||||
<p className="text-left font-semibold">{list?.title}</p>
|
||||
<p className="text-left font-semibold">
|
||||
{" "}
|
||||
{textEllipsis(list.title, 120)}
|
||||
</p>
|
||||
</Link>
|
||||
<div className="flex flex-row gap-1">
|
||||
<p className="py-[2px] text-left text-xs">
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export default function NewsTicker() {
|
|||
className="hidden lg:block"
|
||||
>
|
||||
<p className="text-sm lg:text-base">
|
||||
{article[currentNewsIndex]?.title}
|
||||
{textEllipsis(article[currentNewsIndex]?.title, 120)}
|
||||
</p>
|
||||
</Link>
|
||||
<Link
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
import { PaginationRequest } from "@/types/globals";
|
||||
import {
|
||||
httpDeleteInterceptor,
|
||||
httpGet,
|
||||
httpPost,
|
||||
httpPut,
|
||||
} from "./http-config/axios-base-service";
|
||||
import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service";
|
||||
import Cookies from "js-cookie";
|
||||
import { stat } from "fs";
|
||||
import axiosInterceptorInstanceHumas from "./http-config/konten-humas-base-service";
|
||||
import { httpGetInterceptor } from "./http-config/http-interceptor-services";
|
||||
import {
|
||||
httpDeleteInterceptor,
|
||||
httpGetInterceptor,
|
||||
} from "./http-config/http-interceptor-services";
|
||||
|
||||
const token = Cookies.get("access_token");
|
||||
export async function getListArticle(props: PaginationRequest) {
|
||||
|
|
@ -121,8 +119,9 @@ export async function getArticleById(id: any) {
|
|||
export async function deleteArticle(id: string) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpDeleteInterceptor(`articles/${id}`, headers);
|
||||
return await httpDeleteInterceptor(`articles/${id}`);
|
||||
}
|
||||
|
||||
export async function getArticleByCategory() {
|
||||
|
|
@ -160,7 +159,7 @@ export async function deleteArticleFiles(id: number) {
|
|||
const headers = {
|
||||
"content-type": "multipart/form-data",
|
||||
};
|
||||
return await httpDeleteInterceptor(`article-files/${id}`, headers);
|
||||
return await httpDeleteInterceptor(`article-files/${id}`);
|
||||
}
|
||||
|
||||
export async function getUserLevelDataStat(startDate: string, endDate: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue