refactor(tender-details): update ShowcaseSection styling for improved layout consistency
- Replaced TIMELINE_SHOWCASE with SHOWCASE_CENTERED_BODY for better vertical alignment of content in ShowcaseSection components. - Ensured consistent styling across various sections including Tender ID, Buyer organization, and timeline details.
This commit is contained in:
@@ -49,10 +49,11 @@ function ExternalLinkIcon({ className }: { className?: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Grid row stretch: center value vertically under the title */
|
/** Body area only: center content in the card; ShowcaseSection `title` is unchanged */
|
||||||
const TIMELINE_SHOWCASE = {
|
const SHOWCASE_CENTERED_BODY = {
|
||||||
rootClassName: "flex h-full min-h-0 flex-col",
|
rootClassName: "flex h-full min-h-0 flex-col",
|
||||||
className: "flex min-h-0 flex-1 flex-col justify-center",
|
className:
|
||||||
|
"flex min-h-0 flex-1 flex-col items-center justify-center text-center",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const TenderDetails = ({ params }: IProps) => {
|
const TenderDetails = ({ params }: IProps) => {
|
||||||
@@ -134,23 +135,30 @@ const TenderDetails = ({ params }: IProps) => {
|
|||||||
<div>
|
<div>
|
||||||
<SectionHeading>Procurement</SectionHeading>
|
<SectionHeading>Procurement</SectionHeading>
|
||||||
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5">
|
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-5">
|
||||||
<ShowcaseSection title="Tender ID">
|
<ShowcaseSection title="Tender ID" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<span className="font-medium text-dark dark:text-white">{tender.tender_id}</span>
|
<span className="font-medium text-dark dark:text-white">{tender.tender_id}</span>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Buyer organization" className="sm:col-span-2 xl:col-span-1 2xl:col-span-2">
|
<ShowcaseSection
|
||||||
|
title="Buyer organization"
|
||||||
|
rootClassName={SHOWCASE_CENTERED_BODY.rootClassName}
|
||||||
|
className={cn(
|
||||||
|
"sm:col-span-2 xl:col-span-1 2xl:col-span-2",
|
||||||
|
SHOWCASE_CENTERED_BODY.className,
|
||||||
|
)}
|
||||||
|
>
|
||||||
<span className="font-medium text-dark dark:text-white">
|
<span className="font-medium text-dark dark:text-white">
|
||||||
{tender.buyer_organization.name}
|
{tender.buyer_organization.name}
|
||||||
</span>
|
</span>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Notice publication ID">
|
<ShowcaseSection title="Notice publication ID" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<span className="font-medium text-dark dark:text-white">
|
<span className="font-medium text-dark dark:text-white">
|
||||||
{tender.notice_publication_id}
|
{tender.notice_publication_id}
|
||||||
</span>
|
</span>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Procedure code">
|
<ShowcaseSection title="Procedure code" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<span className="font-medium text-dark dark:text-white">{tender.procedure_code}</span>
|
<span className="font-medium text-dark dark:text-white">{tender.procedure_code}</span>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Procurement type">
|
<ShowcaseSection title="Procurement type" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<span className="font-medium text-dark dark:text-white">
|
<span className="font-medium text-dark dark:text-white">
|
||||||
{tender.procurement_type_code}
|
{tender.procurement_type_code}
|
||||||
</span>
|
</span>
|
||||||
@@ -161,28 +169,28 @@ const TenderDetails = ({ params }: IProps) => {
|
|||||||
<div>
|
<div>
|
||||||
<SectionHeading>Timeline</SectionHeading>
|
<SectionHeading>Timeline</SectionHeading>
|
||||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5">
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5">
|
||||||
<ShowcaseSection title="Application deadline" {...TIMELINE_SHOWCASE}>
|
<ShowcaseSection title="Application deadline" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<time className="font-medium tabular-nums text-dark dark:text-white">
|
<time className="font-medium tabular-nums text-dark dark:text-white">
|
||||||
{msToDate(tender.application_deadline ?? 0)}
|
{msToDate(tender.application_deadline ?? 0)}
|
||||||
</time>
|
</time>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Publication date" {...TIMELINE_SHOWCASE}>
|
<ShowcaseSection title="Publication date" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<time className="font-medium tabular-nums text-dark dark:text-white">
|
<time className="font-medium tabular-nums text-dark dark:text-white">
|
||||||
{msToDate(tender.publication_date ?? 0)}
|
{msToDate(tender.publication_date ?? 0)}
|
||||||
</time>
|
</time>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Submission deadline" {...TIMELINE_SHOWCASE}>
|
<ShowcaseSection title="Submission deadline" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<time className="font-medium tabular-nums text-dark dark:text-white">
|
<time className="font-medium tabular-nums text-dark dark:text-white">
|
||||||
{msToDate(tender.submission_deadline ?? 0)}
|
{msToDate(tender.submission_deadline ?? 0)}
|
||||||
</time>
|
</time>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
<ShowcaseSection title="Tender deadline" {...TIMELINE_SHOWCASE}>
|
<ShowcaseSection title="Tender deadline" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<time className="font-medium tabular-nums text-dark dark:text-white">
|
<time className="font-medium tabular-nums text-dark dark:text-white">
|
||||||
{msToDate(tender.tender_deadline ?? 0)}
|
{msToDate(tender.tender_deadline ?? 0)}
|
||||||
</time>
|
</time>
|
||||||
</ShowcaseSection>
|
</ShowcaseSection>
|
||||||
{submissionUrl && (
|
{submissionUrl && (
|
||||||
<ShowcaseSection title="Submission URL" {...TIMELINE_SHOWCASE}>
|
<ShowcaseSection title="Submission URL" {...SHOWCASE_CENTERED_BODY}>
|
||||||
<Link
|
<Link
|
||||||
href={submissionUrl}
|
href={submissionUrl}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
Reference in New Issue
Block a user