diff --git a/app/layouts/admin/navbar.tsx b/app/layouts/admin/navbar.tsx index 72ab2b3..2b38350 100644 --- a/app/layouts/admin/navbar.tsx +++ b/app/layouts/admin/navbar.tsx @@ -25,16 +25,16 @@ export const Navbar = () => {
- -
- {staffData?.profile_picture === '' ? ( - - ) : ( + +
+ {staffData?.profile_picture ? ( {staffData?.name} + ) : ( + )} {staffData?.name} diff --git a/app/pages/news-detail/index.tsx b/app/pages/news-detail/index.tsx index 6542ff8..632796e 100644 --- a/app/pages/news-detail/index.tsx +++ b/app/pages/news-detail/index.tsx @@ -2,6 +2,7 @@ import htmlParse from 'html-react-parser' import { useRouteLoaderData } from 'react-router' import type { TTagResponse } from '~/apis/common/get-tags' +import { ProfileIcon } from '~/components/icons/profile' import { Card } from '~/components/ui/card' import { CarouselSection } from '~/components/ui/carousel-section' import { IconsSocial } from '~/components/ui/social-share' @@ -14,10 +15,9 @@ export const NewsDetailPage = () => { 'routes/_news.detail.$slug', ) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const { newsDetailData }: any = loaderData + const { newsDetailData } = loaderData || {} const { title, content, featured_image, slug, author, live_at, tags } = - newsDetailData + newsDetailData || {} return (
@@ -27,22 +27,31 @@ export const NewsDetailPage = () => { {title} - {/* next planing create component for this section */} + {/* START TODO: create component for this section */}
- {title} + {author?.profile_picture ? ( + {author?.name} + ) : ( + + )} +
-

{author.name}

-

{formatDate(live_at)} . 5 min read

+

{author?.name}

+

+ {live_at && `${formatDate(live_at)}`} + ยท + 5 min read +

- {/* end next planing create component for this section */} + {/* END TODO: create component for this section */}
{
- {htmlParse(content)} + {content && htmlParse(content)}