feat(MED-168): improve styles
This commit is contained in:
@@ -54,46 +54,44 @@ export default async function AnalysisResultsPage({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const orderedAnalysisElements = analysisResponse.orderedAnalysisElements;
|
const orderedAnalysisElements = analysisResponse.orderedAnalysisElements;
|
||||||
|
const hasOrderedAnalysisElements = orderedAnalysisElements.length > 0;
|
||||||
|
const isPartialStatus = analysisResponse.order.status === 'PARTIAL_ANALYSIS_RESPONSE';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageHeader />
|
<PageHeader
|
||||||
<PageBody className="gap-4">
|
title={<Trans i18nKey="analysis-results:pageTitle" />}
|
||||||
<div className="mt-8 flex flex-col justify-between gap-4 sm:flex-row sm:items-center sm:gap-0">
|
description={hasOrderedAnalysisElements ? (
|
||||||
<div>
|
isPartialStatus
|
||||||
<h4>
|
? <Trans i18nKey="analysis-results:descriptionPartial" />
|
||||||
<Trans i18nKey="analysis-results:pageTitle" />
|
: <Trans i18nKey="analysis-results:description" />
|
||||||
</h4>
|
) : (
|
||||||
<p className="text-muted-foreground text-sm">
|
<Trans i18nKey="analysis-results:descriptionEmpty" />
|
||||||
{orderedAnalysisElements.length > 0 ? (
|
)}
|
||||||
<Trans i18nKey="analysis-results:description" />
|
>
|
||||||
) : (
|
<div>
|
||||||
<Trans i18nKey="analysis-results:descriptionEmpty" />
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href={pathsConfig.app.orderAnalysisPackage}>
|
<Link href={pathsConfig.app.orderAnalysisPackage}>
|
||||||
<Trans i18nKey="analysis-results:orderNewAnalysis" />
|
<Trans i18nKey="analysis-results:orderNewAnalysis" />
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</PageHeader>
|
||||||
|
<PageBody className="gap-4 pt-4">
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<h4>
|
<h5 className="break-all">
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey="analysis-results:orderTitle"
|
i18nKey="analysis-results:orderTitle"
|
||||||
values={{ orderNumber: analysisResponse.order.medusaOrderId }}
|
values={{ orderNumber: analysisResponse.order.medusaOrderId }}
|
||||||
/>
|
/>
|
||||||
</h4>
|
</h5>
|
||||||
<h5>
|
<h6>
|
||||||
<Trans
|
<Trans i18nKey={`orders:status.${analysisResponse.order.status}`} />
|
||||||
i18nKey={`orders:status.${analysisResponse.order.status}`}
|
|
||||||
/>
|
|
||||||
<ButtonTooltip
|
<ButtonTooltip
|
||||||
content={`${analysisResponse.order.createdAt ? new Date(analysisResponse?.order?.createdAt).toLocaleString() : ''}`}
|
content={`${analysisResponse.order.createdAt ? new Date(analysisResponse?.order?.createdAt).toLocaleString() : ''}`}
|
||||||
className="ml-6"
|
className="ml-6"
|
||||||
/>
|
/>
|
||||||
</h5>
|
</h6>
|
||||||
</div>
|
</div>
|
||||||
{analysisResponse?.summary?.value && (
|
{analysisResponse?.summary?.value && (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const Level = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{color === 'success' && typeof normRangeText === 'string' && (
|
{color === 'success' && typeof normRangeText === 'string' && (
|
||||||
<p className={cn("absolute bottom-[-18px] left-3/8 text-xs text-muted-foreground font-bold", {
|
<p className={cn("absolute bottom-[-18px] left-3/8 text-xs text-muted-foreground font-bold whitespace-nowrap", {
|
||||||
'opacity-60': isActive,
|
'opacity-60': isActive,
|
||||||
})}>
|
})}>
|
||||||
{normRangeText}
|
{normRangeText}
|
||||||
@@ -179,7 +179,13 @@ const AnalysisLevelBar = ({
|
|||||||
}, [isValueBelowLower, isValueAboveUpper, isValueInNormalRange, arrowLocation, normRangeText, isNormal, isWarning, isCritical]);
|
}, [isValueBelowLower, isValueAboveUpper, isValueInNormalRange, arrowLocation, normRangeText, isNormal, isWarning, isCritical]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mt-4 flex h-3 w-[60%] sm:w-[35%] max-w-[360px] gap-1 sm:mt-0">
|
<div className={cn(
|
||||||
|
"flex h-3 gap-1",
|
||||||
|
"mt-4 sm:mt-0",
|
||||||
|
"w-[60%] sm:w-[35%]",
|
||||||
|
"min-w-[50vw] sm:min-w-auto",
|
||||||
|
"max-w-[360px]",
|
||||||
|
)}>
|
||||||
<Level {...first} />
|
<Level {...first} />
|
||||||
<Level {...second} />
|
<Level {...second} />
|
||||||
<Level {...third} />
|
<Level {...third} />
|
||||||
|
|||||||
@@ -158,11 +158,11 @@ export function PageHeader({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex items-center justify-between py-5',
|
'flex py-5 flex-col sm:flex-row items-start sm:items-center sm:justify-between',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className={'flex flex-col gap-y-2'}>
|
<div className={'flex flex-col gap-y-4 sm:gap-y-2'}>
|
||||||
<If condition={title}>
|
<If condition={title}>
|
||||||
<PageTitle>{title}</PageTitle>
|
<PageTitle>{title}</PageTitle>
|
||||||
</If>
|
</If>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"pageTitle": "My analysis results",
|
"pageTitle": "My analysis results",
|
||||||
"description": "All analysis results will appear here within 1-3 business days after they have been done.",
|
"description": "",
|
||||||
|
"descriptionPartial": "All analysis results will appear here within 1-3 business days after they have been done.",
|
||||||
"descriptionEmpty": "If you've already done your analysis, your results will appear here soon.",
|
"descriptionEmpty": "If you've already done your analysis, your results will appear here soon.",
|
||||||
"orderNewAnalysis": "Order new analyses",
|
"orderNewAnalysis": "Order new analyses",
|
||||||
"waitingForResults": "Waiting for results",
|
"waitingForResults": "Waiting for results",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"pageTitle": "Minu analüüside vastused",
|
"pageTitle": "Minu analüüside vastused",
|
||||||
"description": "Kõikide analüüside tulemused ilmuvad 1-3 tööpäeva jooksul peale nende andmist.",
|
"description": "",
|
||||||
|
"descriptionPartial": "Kõikide analüüside tulemused ilmuvad 1-3 tööpäeva jooksul peale nende andmist.",
|
||||||
"descriptionEmpty": "Kui oled juba käinud analüüse andmas, siis varsti jõuavad siia sinu analüüside vastused.",
|
"descriptionEmpty": "Kui oled juba käinud analüüse andmas, siis varsti jõuavad siia sinu analüüside vastused.",
|
||||||
"orderNewAnalysis": "Telli uued analüüsid",
|
"orderNewAnalysis": "Telli uued analüüsid",
|
||||||
"waitingForResults": "Tulemuse ootel",
|
"waitingForResults": "Tulemuse ootel",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"pageTitle": "Мои результаты анализов",
|
"pageTitle": "Мои результаты анализов",
|
||||||
"description": "Все результаты анализов появляются в течение 1-3 рабочих дней после их сдачи.",
|
"description": "",
|
||||||
|
"descriptionPartial": "Все результаты анализов появляются в течение 1-3 рабочих дней после их сдачи.",
|
||||||
"descriptionEmpty": "Если вы уже сдали анализы, то вскоре здесь появятся ваши результаты.",
|
"descriptionEmpty": "Если вы уже сдали анализы, то вскоре здесь появятся ваши результаты.",
|
||||||
"orderNewAnalysis": "Заказать новые анализы",
|
"orderNewAnalysis": "Заказать новые анализы",
|
||||||
"waitingForResults": "Ожидание результатов",
|
"waitingForResults": "Ожидание результатов",
|
||||||
|
|||||||
@@ -75,11 +75,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
h5 {
|
h5 {
|
||||||
@apply text-base;
|
@apply text-lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
h6 {
|
h6 {
|
||||||
@apply text-lg;
|
@apply text-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lucide {
|
.lucide {
|
||||||
|
|||||||
Reference in New Issue
Block a user