fix(SW-2754): Fixed issue where server rendered html included faulty links
Approved-by: Matilda Landström
This commit is contained in:
@@ -14,11 +14,11 @@ import type { AccessibilityAccordionItemProps } from "@/types/components/sidePee
|
||||
|
||||
export default function AccessibilityAccordionItem({
|
||||
elevatorPitch,
|
||||
accessibilityPageUrl,
|
||||
accessibilityPageHref,
|
||||
}: AccessibilityAccordionItemProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
if (!elevatorPitch && !accessibilityPageUrl) {
|
||||
if (!elevatorPitch && !accessibilityPageHref) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -36,18 +36,17 @@ export default function AccessibilityAccordionItem({
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>{elevatorPitch}</p>
|
||||
</Typography>
|
||||
{accessibilityPageUrl && (
|
||||
{accessibilityPageHref ? (
|
||||
<ButtonLink
|
||||
href={`/${accessibilityPageUrl}`}
|
||||
href={accessibilityPageHref}
|
||||
variant="Secondary"
|
||||
color="Primary"
|
||||
size="Medium"
|
||||
typography="Body/Paragraph/mdBold"
|
||||
appendToCurrentPath
|
||||
>
|
||||
{intl.formatMessage({ defaultMessage: "About accessibility" })}
|
||||
</ButtonLink>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
</AccordionItem>
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ import type { ParkingAccordionItemProps } from "@/types/components/sidePeeks/ame
|
||||
export default function ParkingAccordionItem({
|
||||
parking,
|
||||
elevatorPitch,
|
||||
parkingPageUrl,
|
||||
parkingPageHref,
|
||||
}: ParkingAccordionItemProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
@@ -39,20 +39,19 @@ export default function ParkingAccordionItem({
|
||||
{parking.map((data) => (
|
||||
<ParkingInformation key={data.type} parking={data} />
|
||||
))}
|
||||
{parkingPageUrl && (
|
||||
{parkingPageHref ? (
|
||||
<ButtonLink
|
||||
href={`/${parkingPageUrl}`}
|
||||
href={parkingPageHref}
|
||||
variant="Secondary"
|
||||
color="Primary"
|
||||
size="Medium"
|
||||
typography="Body/Paragraph/mdBold"
|
||||
appendToCurrentPath
|
||||
>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "About parking",
|
||||
})}
|
||||
</ButtonLink>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
</AccordionItem>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user