Commit ee2ee642 authored by Vũ Đình Nguyên's avatar Vũ Đình Nguyên

Merge branch 'fix/home_page' into 'develop'

fix/home_page-and-fix-footer

See merge request !12
parents 75098072 4b74d1b8
import { NewsAdminItem } from '@/api/types/news' import { NewsAdminItem } from "@/api/types/news";
import BASE_URL from '@/links' import BASE_URL from "@/links";
import dayjs from 'dayjs'; import dayjs from "dayjs";
import AppEditorContent from '@/components/shared/editor-content'; import AppEditorContent from "@/components/shared/editor-content";
function CardNews({ news }: { news: NewsAdminItem }) { function CardNews({ news }: { news: NewsAdminItem }) {
return ( return (
<a <a
href={`${news.id}`} href={`${news.id}`}
className='flex flex-row gap-2 mb-2 sm:gap-3 sm:mb-3 p-2 sm:p-3 border border-gray-200 bg-white rounded-md' className="flex flex-row gap-2 mb-2 sm:gap-3 sm:mb-3"
> >
<img <img
src={`${BASE_URL.imageEndpoint}${news.thumbnail}`} src={`${BASE_URL.imageEndpoint}${news.thumbnail}`}
...@@ -18,13 +18,12 @@ function CardNews({ news }: { news: NewsAdminItem }) { ...@@ -18,13 +18,12 @@ function CardNews({ news }: { news: NewsAdminItem }) {
e.currentTarget.src = "/fallback.png" e.currentTarget.src = "/fallback.png"
}} }}
/> />
<div className="flex-1">
<div className='flex-1'> <p className="text-[#363636] font-bold text-sm line-clamp-2">
<p className='text-[#0056b3] font-bold text-sm line-clamp-2'>
{news.title} {news.title}
</p> </p>
<p className='text-gray-500 text-sm my-1'> <p className="text-gray-500 text-sm my-1">
{dayjs(news.release_at).format('DD/MM/YYYY')} {dayjs(news.release_at).format("DD/MM/YYYY")}
</p> </p>
{/* <AppEditorContent className='line-clamp-2' value={news.description} /> */} {/* <AppEditorContent className='line-clamp-2' value={news.description} /> */}
</div> </div>
...@@ -32,4 +31,4 @@ function CardNews({ news }: { news: NewsAdminItem }) { ...@@ -32,4 +31,4 @@ function CardNews({ news }: { news: NewsAdminItem }) {
); );
} }
export default CardNews; export default CardNews;
\ No newline at end of file
This diff is collapsed.
"use client";
import { useState, useEffect } from "react";
import { ChevronsUp } from "lucide-react";
export default function ScrollToTopButton() {
const [visible, setVisible] = useState(false);
useEffect(() => {
const toggleVisibility = () => {
setVisible(window.scrollY > 300);
};
window.addEventListener("scroll", toggleVisibility);
return () => window.removeEventListener("scroll", toggleVisibility);
}, []);
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};
return (
<button
onClick={scrollToTop}
className={`fixed bottom-25 right-6 bg-[#e8c518] hover:text-[#063e8e] text-white p-3 rounded-lg shadow-lg transition-all duration-500 cursor-pointer ${
visible
? "opacity-100 translate-y-0"
: "opacity-0 translate-y-3 pointer-events-none"
}`}
>
<ChevronsUp size={24} />
</button>
);
}
...@@ -170,7 +170,7 @@ function Footer() { ...@@ -170,7 +170,7 @@ function Footer() {
</div> </div>
</div> </div>
<div className="bg-[#032248] h-[80px] flex items-center justify-center"> <div className="bg-[#032248] h-[80px] flex items-center justify-center">
<div className="max-w-[1200px] w-full p-5"> <div className="container w-full p-5">
<p className="text-[14px] text-white"> <p className="text-[14px] text-white">
© Bản quyền VCCI-HCM | All rights reserved © Bản quyền VCCI-HCM | All rights reserved
</p> </p>
......
import Header from "@/app/(main)/_lib/layout/header" import Header from "@/app/(main)/_lib/layout/header";
import Footer from "@/app/(main)/_lib/layout/footer" import Footer from "@/app/(main)/_lib/layout/footer";
import React from "react"; import React from "react";
import ScrollToTopButton from "./_lib/layout/ScrollToTopButton";
export default function Layout({ export default function Layout({
children, children,
...@@ -10,10 +9,11 @@ export default function Layout({ ...@@ -10,10 +9,11 @@ export default function Layout({
children: React.ReactNode; children: React.ReactNode;
}>) { }>) {
return ( return (
<main className="bg-background"> <main className="flex flex-col min-h-screen bg-background">
<Header /> <Header />
{children} <div className="flex-1">{children}</div>
<Footer /> <ScrollToTopButton />
</main> <Footer />
</main>
); );
} }
...@@ -68,7 +68,7 @@ export default function PublicationDetail() { ...@@ -68,7 +68,7 @@ export default function PublicationDetail() {
return ( return (
<div className="bg-[#f6f6f6] min-h-screen"> <div className="bg-[#f6f6f6] min-h-screen">
<div className="max-w-[1200px] mx-auto flex flex-col gap-5 mb-[50px]"> <div className="container mx-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory categories={MEDIA_INFORMATION_CATEGORIES} /> <ListCategory categories={MEDIA_INFORMATION_CATEGORIES} />
</div> </div>
......
...@@ -7,7 +7,7 @@ import PublicationList from "./components/publicationList"; ...@@ -7,7 +7,7 @@ import PublicationList from "./components/publicationList";
export default function Page() { export default function Page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory categories={MEDIA_INFORMATION_CATEGORIES} /> <ListCategory categories={MEDIA_INFORMATION_CATEGORIES} />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar"; ...@@ -6,7 +6,7 @@ import EventCalendar from "@/components/base/event-calendar";
export default function page() { export default function page() {
return ( return (
<div className="bg-[#f6f6f6]"> <div className="bg-[#f6f6f6]">
<div className="max-w-[1200px] m-auto flex flex-col gap-5 mb-[50px]"> <div className="container m-auto flex flex-col gap-5 mb-[50px]">
<div className="border-[#e5e7f2] border-[1px]"> <div className="border-[#e5e7f2] border-[1px]">
<ListCategory /> <ListCategory />
</div> </div>
......
import { FC, JSX } from 'react'; import { FC, JSX } from "react";
import htmlParse, { DOMNode, Element, Text } from 'html-react-parser'; import htmlParse, { DOMNode, Element, Text } from "html-react-parser";
import { AppEditorContentProps } from './AppEditorContent.type'; import { AppEditorContentProps } from "./AppEditorContent.type";
import './AppEditorContent.css'; import "./AppEditorContent.css";
const AppEditorContent: FC<AppEditorContentProps> = ({ value = '', className = '' }) => { const AppEditorContent: FC<AppEditorContentProps> = ({ value = '', className = '' }) => {
const transform = (node: DOMNode): JSX.Element | string | undefined | null => { const transform = (node: DOMNode): JSX.Element | string | undefined | null => {
...@@ -49,7 +49,9 @@ const AppEditorContent: FC<AppEditorContentProps> = ({ value = '', className = ' ...@@ -49,7 +49,9 @@ const AppEditorContent: FC<AppEditorContentProps> = ({ value = '', className = '
return ( return (
<div className="jodit-container app-editor-container"> <div className="jodit-container app-editor-container">
<div className={`jodit-wysiwyg ${className}`}>{htmlParse(value, { replace: transform })}</div> <div className={`jodit-wysiwyg ${className}`}>
{htmlParse(value, { replace: transform })}
</div>
</div> </div>
); );
}; };
......
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