Commit 7d8183c0 authored by Văn Hoàng's avatar Văn Hoàng

Merge branch 'fix/dynamic_page' into 'develop'

fix/loading page and slider home

See merge request !45
parents 0fcf0838 5948684f
...@@ -17,7 +17,6 @@ const Page = () => { ...@@ -17,7 +17,6 @@ const Page = () => {
return ( return (
<div> <div>
<Banner /> <Banner />
{/* contents */} {/* contents */}
<div className="container mx-auto px-3 sm:px-6 lg:px-10 space-y-12"> <div className="container mx-auto px-3 sm:px-6 lg:px-10 space-y-12">
<FeaturedNews /> <FeaturedNews />
......
...@@ -42,6 +42,19 @@ export default function DynamicPage() { ...@@ -42,6 +42,19 @@ export default function DynamicPage() {
}, [slug, category, children, router]); }, [slug, category, children, router]);
//template //template
if (slug[0] === "hoat-dong" && slug[1] === "su-kien") {
if (slug.length === 2) return <EventPage />;
if (slug.length === 3) return <EventDetailPage />;
}
if (news?.responseData?.count == 0 && isLoading) {
return (
<div className="flex justify-center items-center w-full h-64">
<Spinner />
</div>
);
}
if (news && news?.responseData.rows.length !== 0) { if (news && news?.responseData.rows.length !== 0) {
return <ArticleDetailPage data={news} />; return <ArticleDetailPage data={news} />;
} }
......
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