Commit f55cf677 authored by Phạm Quang Bảo's avatar Phạm Quang Bảo

[tag]staging

parents 3616b09b dff8066d
Pipeline #46558 passed with stages
in 10 minutes and 37 seconds
...@@ -123,8 +123,8 @@ importers: ...@@ -123,8 +123,8 @@ importers:
specifier: ^0.548.0 specifier: ^0.548.0
version: 0.548.0(react@19.2.0) version: 0.548.0(react@19.2.0)
next: next:
specifier: 16.0.1 specifier: 16.0.10
version: 16.0.1(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0) version: 16.0.10(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
next-nprogress-bar: next-nprogress-bar:
specifier: ^2.4.7 specifier: ^2.4.7
version: 2.4.7 version: 2.4.7
...@@ -731,56 +731,56 @@ packages: ...@@ -731,56 +731,56 @@ packages:
'@napi-rs/wasm-runtime@0.2.12': '@napi-rs/wasm-runtime@0.2.12':
resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==}
'@next/env@16.0.1': '@next/env@16.0.10':
resolution: {integrity: sha512-LFvlK0TG2L3fEOX77OC35KowL8D7DlFF45C0OvKMC4hy8c/md1RC4UMNDlUGJqfCoCS2VWrZ4dSE6OjaX5+8mw==} resolution: {integrity: sha512-8tuaQkyDVgeONQ1MeT9Mkk8pQmZapMKFh5B+OrFUlG3rVmYTXcXlBetBgTurKXGaIZvkoqRT9JL5K3phXcgang==}
'@next/eslint-plugin-next@16.0.1': '@next/eslint-plugin-next@16.0.1':
resolution: {integrity: sha512-g4Cqmv/gyFEXNeVB2HkqDlYKfy+YrlM2k8AVIO/YQVEPfhVruH1VA99uT1zELLnPLIeOnx8IZ6Ddso0asfTIdw==} resolution: {integrity: sha512-g4Cqmv/gyFEXNeVB2HkqDlYKfy+YrlM2k8AVIO/YQVEPfhVruH1VA99uT1zELLnPLIeOnx8IZ6Ddso0asfTIdw==}
'@next/swc-darwin-arm64@16.0.1': '@next/swc-darwin-arm64@16.0.10':
resolution: {integrity: sha512-R0YxRp6/4W7yG1nKbfu41bp3d96a0EalonQXiMe+1H9GTHfKxGNCGFNWUho18avRBPsO8T3RmdWuzmfurlQPbg==} resolution: {integrity: sha512-4XgdKtdVsaflErz+B5XeG0T5PeXKDdruDf3CRpnhN+8UebNa5N2H58+3GDgpn/9GBurrQ1uWW768FfscwYkJRg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@next/swc-darwin-x64@16.0.1': '@next/swc-darwin-x64@16.0.10':
resolution: {integrity: sha512-kETZBocRux3xITiZtOtVoVvXyQLB7VBxN7L6EPqgI5paZiUlnsgYv4q8diTNYeHmF9EiehydOBo20lTttCbHAg==} resolution: {integrity: sha512-spbEObMvRKkQ3CkYVOME+ocPDFo5UqHb8EMTS78/0mQ+O1nqE8toHJVioZo4TvebATxgA8XMTHHrScPrn68OGw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@next/swc-linux-arm64-gnu@16.0.1': '@next/swc-linux-arm64-gnu@16.0.10':
resolution: {integrity: sha512-hWg3BtsxQuSKhfe0LunJoqxjO4NEpBmKkE+P2Sroos7yB//OOX3jD5ISP2wv8QdUwtRehMdwYz6VB50mY6hqAg==} resolution: {integrity: sha512-uQtWE3X0iGB8apTIskOMi2w/MKONrPOUCi5yLO+v3O8Mb5c7K4Q5KD1jvTpTF5gJKa3VH/ijKjKUq9O9UhwOYw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@next/swc-linux-arm64-musl@16.0.1': '@next/swc-linux-arm64-musl@16.0.10':
resolution: {integrity: sha512-UPnOvYg+fjAhP3b1iQStcYPWeBFRLrugEyK/lDKGk7kLNua8t5/DvDbAEFotfV1YfcOY6bru76qN9qnjLoyHCQ==} resolution: {integrity: sha512-llA+hiDTrYvyWI21Z0L1GiXwjQaanPVQQwru5peOgtooeJ8qx3tlqRV2P7uH2pKQaUfHxI/WVarvI5oYgGxaTw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@next/swc-linux-x64-gnu@16.0.1': '@next/swc-linux-x64-gnu@16.0.10':
resolution: {integrity: sha512-Et81SdWkcRqAJziIgFtsFyJizHoWne4fzJkvjd6V4wEkWTB4MX6J0uByUb0peiJQ4WeAt6GGmMszE5KrXK6WKg==} resolution: {integrity: sha512-AK2q5H0+a9nsXbeZ3FZdMtbtu9jxW4R/NgzZ6+lrTm3d6Zb7jYrWcgjcpM1k8uuqlSy4xIyPR2YiuUr+wXsavA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@next/swc-linux-x64-musl@16.0.1': '@next/swc-linux-x64-musl@16.0.10':
resolution: {integrity: sha512-qBbgYEBRrC1egcG03FZaVfVxrJm8wBl7vr8UFKplnxNRprctdP26xEv9nJ07Ggq4y1adwa0nz2mz83CELY7N6Q==} resolution: {integrity: sha512-1TDG9PDKivNw5550S111gsO4RGennLVl9cipPhtkXIFVwo31YZ73nEbLjNC8qG3SgTz/QZyYyaFYMeY4BKZR/g==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@next/swc-win32-arm64-msvc@16.0.1': '@next/swc-win32-arm64-msvc@16.0.10':
resolution: {integrity: sha512-cPuBjYP6I699/RdbHJonb3BiRNEDm5CKEBuJ6SD8k3oLam2fDRMKAvmrli4QMDgT2ixyRJ0+DTkiODbIQhRkeQ==} resolution: {integrity: sha512-aEZIS4Hh32xdJQbHz121pyuVZniSNoqDVx1yIr2hy+ZwJGipeqnMZBJHyMxv2tiuAXGx6/xpTcQJ6btIiBjgmg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@next/swc-win32-x64-msvc@16.0.1': '@next/swc-win32-x64-msvc@16.0.10':
resolution: {integrity: sha512-XeEUJsE4JYtfrXe/LaJn3z1pD19fK0Q6Er8Qoufi+HqvdO4LEPyCxLUt4rxA+4RfYo6S9gMlmzCMU2F+AatFqQ==} resolution: {integrity: sha512-E+njfCoFLb01RAFEnGZn6ERoOqhK1Gl3Lfz1Kjnj0Ulfu7oJbuMyvBKNj/bw8XZnenHDASlygTjZICQW+rYW1Q==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
...@@ -3060,8 +3060,8 @@ packages: ...@@ -3060,8 +3060,8 @@ packages:
react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
next@16.0.1: next@16.0.10:
resolution: {integrity: sha512-e9RLSssZwd35p7/vOa+hoDFggUZIUbZhIUSLZuETCwrCVvxOs87NamoUzT+vbcNAL8Ld9GobBnWOA6SbV/arOw==} resolution: {integrity: sha512-RtWh5PUgI+vxlV3HdR+IfWA1UUHu0+Ram/JBO4vWB54cVPentCD0e+lxyAYEsDTqGGMg7qpjhKh6dc6aW7W/sA==}
engines: {node: '>=20.9.0'} engines: {node: '>=20.9.0'}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
...@@ -4352,34 +4352,34 @@ snapshots: ...@@ -4352,34 +4352,34 @@ snapshots:
'@tybys/wasm-util': 0.10.1 '@tybys/wasm-util': 0.10.1
optional: true optional: true
'@next/env@16.0.1': {} '@next/env@16.0.10': {}
'@next/eslint-plugin-next@16.0.1': '@next/eslint-plugin-next@16.0.1':
dependencies: dependencies:
fast-glob: 3.3.1 fast-glob: 3.3.1
'@next/swc-darwin-arm64@16.0.1': '@next/swc-darwin-arm64@16.0.10':
optional: true optional: true
'@next/swc-darwin-x64@16.0.1': '@next/swc-darwin-x64@16.0.10':
optional: true optional: true
'@next/swc-linux-arm64-gnu@16.0.1': '@next/swc-linux-arm64-gnu@16.0.10':
optional: true optional: true
'@next/swc-linux-arm64-musl@16.0.1': '@next/swc-linux-arm64-musl@16.0.10':
optional: true optional: true
'@next/swc-linux-x64-gnu@16.0.1': '@next/swc-linux-x64-gnu@16.0.10':
optional: true optional: true
'@next/swc-linux-x64-musl@16.0.1': '@next/swc-linux-x64-musl@16.0.10':
optional: true optional: true
'@next/swc-win32-arm64-msvc@16.0.1': '@next/swc-win32-arm64-msvc@16.0.10':
optional: true optional: true
'@next/swc-win32-x64-msvc@16.0.1': '@next/swc-win32-x64-msvc@16.0.10':
optional: true optional: true
'@nodelib/fs.scandir@2.1.5': '@nodelib/fs.scandir@2.1.5':
...@@ -6998,9 +6998,9 @@ snapshots: ...@@ -6998,9 +6998,9 @@ snapshots:
react: 19.2.0 react: 19.2.0
react-dom: 19.2.0(react@19.2.0) react-dom: 19.2.0(react@19.2.0)
next@16.0.1(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0): next@16.0.10(@babel/core@7.28.5)(react-dom@19.2.0(react@19.2.0))(react@19.2.0):
dependencies: dependencies:
'@next/env': 16.0.1 '@next/env': 16.0.10
'@swc/helpers': 0.5.15 '@swc/helpers': 0.5.15
caniuse-lite: 1.0.30001751 caniuse-lite: 1.0.30001751
postcss: 8.4.31 postcss: 8.4.31
...@@ -7008,14 +7008,14 @@ snapshots: ...@@ -7008,14 +7008,14 @@ snapshots:
react-dom: 19.2.0(react@19.2.0) react-dom: 19.2.0(react@19.2.0)
styled-jsx: 5.1.6(@babel/core@7.28.5)(react@19.2.0) styled-jsx: 5.1.6(@babel/core@7.28.5)(react@19.2.0)
optionalDependencies: optionalDependencies:
'@next/swc-darwin-arm64': 16.0.1 '@next/swc-darwin-arm64': 16.0.10
'@next/swc-darwin-x64': 16.0.1 '@next/swc-darwin-x64': 16.0.10
'@next/swc-linux-arm64-gnu': 16.0.1 '@next/swc-linux-arm64-gnu': 16.0.10
'@next/swc-linux-arm64-musl': 16.0.1 '@next/swc-linux-arm64-musl': 16.0.10
'@next/swc-linux-x64-gnu': 16.0.1 '@next/swc-linux-x64-gnu': 16.0.10
'@next/swc-linux-x64-musl': 16.0.1 '@next/swc-linux-x64-musl': 16.0.10
'@next/swc-win32-arm64-msvc': 16.0.1 '@next/swc-win32-arm64-msvc': 16.0.10
'@next/swc-win32-x64-msvc': 16.0.1 '@next/swc-win32-x64-msvc': 16.0.10
sharp: 0.34.4 sharp: 0.34.4
transitivePeerDependencies: transitivePeerDependencies:
- '@babel/core' - '@babel/core'
......
...@@ -26,7 +26,7 @@ function Events() { ...@@ -26,7 +26,7 @@ function Events() {
<div className="flex flex-col md:flex-row gap-5"> <div className="flex flex-col md:flex-row gap-5">
{isLoading ? ( {isLoading ? (
<div className="container w-full h-[80vh] flex justify-center items-center"> <div className="flex flex-col justify-center items-center w-full min-h-[180px] sm:min-h-[220px] p-3">
<Spinner /> <Spinner />
</div> </div>
) : ( ) : (
......
...@@ -7,9 +7,10 @@ import Link from "next/link"; ...@@ -7,9 +7,10 @@ import Link from "next/link";
import { Swiper, SwiperSlide } from "swiper/react"; import { Swiper, SwiperSlide } from "swiper/react";
import { Autoplay, Grid } from "swiper/modules"; import { Autoplay, Grid } from "swiper/modules";
import BASE_URL from "@/links/index"; import BASE_URL from "@/links/index";
import { Spinner } from "@/components/ui/spinner";
function FeaturedNews() { function FeaturedNews() {
const { data } = useGetNews<GetNewsResponseType>( const { data, isLoading } = useGetNews<GetNewsResponseType>(
{ {
pageSize: '10', pageSize: '10',
} }
...@@ -26,7 +27,11 @@ function FeaturedNews() { ...@@ -26,7 +27,11 @@ function FeaturedNews() {
<div className="flex-1 h-px bg-linear-to-l from-transparent via-gray-300 to-gray-400"></div> <div className="flex-1 h-px bg-linear-to-l from-transparent via-gray-300 to-gray-400"></div>
</div> </div>
</div> </div>
{isLoading ? (
<div className="flex justify-center items-center w-full h-64">
<Spinner />
</div>
) : (
<Swiper <Swiper
modules={[Autoplay]} modules={[Autoplay]}
autoplay={{ delay: 4000, disableOnInteraction: false }} autoplay={{ delay: 4000, disableOnInteraction: false }}
...@@ -61,6 +66,7 @@ function FeaturedNews() { ...@@ -61,6 +66,7 @@ function FeaturedNews() {
</SwiperSlide> </SwiperSlide>
))} ))}
</Swiper> </Swiper>
)}
</section> </section>
); );
} }
......
...@@ -7,12 +7,13 @@ import { ChevronsRight } from "lucide-react"; ...@@ -7,12 +7,13 @@ import { ChevronsRight } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import stripImagesAndHtml from "@/helpers/stripImageAndHtml"; import stripImagesAndHtml from "@/helpers/stripImageAndHtml";
import CardNews from "./components/card-news"; import CardNews from "./components/card-news";
import { Spinner } from "@/components/ui/spinner";
const News = () => { const News = () => {
const [tab, setTab] = useState("all"); const [tab, setTab] = useState("all");
const { data: newsSpecial } = useGetNews<GetNewsResponseType>({ pageSize: '1' }); const { data: newsSpecial, isLoading: isLoadingSpecial } = useGetNews<GetNewsResponseType>({ pageSize: '1' });
const { data: newsFilters } = useGetNews<GetNewsResponseType>( const { data: newsFilters, isLoading: isLoadingFilters } = useGetNews<GetNewsResponseType>(
{ {
pageSize: '5', pageSize: '5',
filters: tab === "all" ? `` : `page_config.code @=${tab}`, filters: tab === "all" ? `` : `page_config.code @=${tab}`,
...@@ -38,7 +39,12 @@ const News = () => { ...@@ -38,7 +39,12 @@ const News = () => {
<hr className="border-[#063e8e] mb-4" /> <hr className="border-[#063e8e] mb-4" />
<div className="flex flex-col md:flex-row gap-5"> <div className="flex flex-col md:flex-row gap-5">
{newsSpecial?.responseData.rows {isLoadingSpecial ? (
<div className="flex justify-center items-center flex-col w-full md:w-1/2 min-h-[180px] sm:min-h-[220px] gap-3 mb-3">
<Spinner />
</div>
) : (
newsSpecial?.responseData.rows
.slice(0, 1) .slice(0, 1)
.map((news: NewsItem) => ( .map((news: NewsItem) => (
<Link <Link
...@@ -64,8 +70,8 @@ const News = () => { ...@@ -64,8 +70,8 @@ const News = () => {
<p className="line-clamp-4 text-justify">{stripImagesAndHtml(news.description)}</p> <p className="line-clamp-4 text-justify">{stripImagesAndHtml(news.description)}</p>
</div> </div>
</Link> </Link>
))} ))
)}
<div className="w-full md:w-1/2"> <div className="w-full md:w-1/2">
<div className="flex flex-wrap gap-2 sm:gap-3 mb-5"> <div className="flex flex-wrap gap-2 sm:gap-3 mb-5">
<button <button
...@@ -105,9 +111,15 @@ const News = () => { ...@@ -105,9 +111,15 @@ const News = () => {
</button> </button>
</div> </div>
{newsFilters?.responseData?.rows.slice(0, 4).map((news) => ( {isLoadingFilters ? (
<div className="flex justify-center py-10">
<Spinner />
</div>
) : (
newsFilters?.responseData?.rows.slice(0, 4).map((news) => (
<CardNews key={news.id} news={news} /> <CardNews key={news.id} news={news} />
))} ))
)}
</div> </div>
</div> </div>
</div> </div>
......
import Image from "next/image"; import Image from "next/image";
import { useState } from "react"; import { useEffect, useState } from "react";
const ImageNext = ({ src, alt, width, height, className, onError }: any) => { const ImageNext = ({ src, alt, width, height, className, fallback = "/img-error.png" }: any) => {
const [imgSrc, setImgSrc] = useState(src); const [imgSrc, setImgSrc] = useState(src);
useEffect(() => {
setImgSrc(src);
}, [src]);
return ( return (
<Image <Image
src={imgSrc} src={imgSrc}
...@@ -11,7 +15,8 @@ const ImageNext = ({ src, alt, width, height, className, onError }: any) => { ...@@ -11,7 +15,8 @@ const ImageNext = ({ src, alt, width, height, className, onError }: any) => {
width={width} width={width}
height={height} height={height}
className={className} className={className}
onError={() => setImgSrc(onError || "/img-error.png")} onError={() => setImgSrc(fallback)}
unoptimized
/> />
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment