Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): Hotfix - Pension Calculator, Display icon to left of title for 2025 preview #17251 #17254

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ export const yearSelectContainer = style({
md: { width: '204px' },
}),
})

export const noWrap = style({
flexWrap: 'nowrap',
})
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
GET_ORGANIZATION_PAGE_QUERY,
GET_ORGANIZATION_QUERY,
} from '../../queries'
import { PensionCalculatorTitle } from './PensionCalculatorTitle'
import { PensionCalculatorWrapper } from './PensionCalculatorWrapper'
import { translationStrings } from './translationStrings'
import {
Expand Down Expand Up @@ -554,16 +555,12 @@ const PensionCalculator: CustomScreen<PensionCalculatorProps> = ({
>
<Box paddingY={5}>
<Stack space={3}>
{isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} <div>{titlePostfix}</div>
</Text>
)}
{!isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} {titlePostfix}
</Text>
)}
<PensionCalculatorTitle
isNewSystemActive={isNewSystemActive}
title={title}
titlePostfix={titlePostfix}
titleVariant={titleVariant}
/>
<Text>{formatMessage(translationStrings.isTurnedOff)}</Text>
</Stack>
</Box>
Expand All @@ -584,16 +581,12 @@ const PensionCalculator: CustomScreen<PensionCalculatorProps> = ({
<Stack space={3}>
<Stack space={3}>
<Box paddingTop={6}>
{isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} <div>{titlePostfix}</div>
</Text>
)}
{!isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} {titlePostfix}
</Text>
)}
<PensionCalculatorTitle
isNewSystemActive={isNewSystemActive}
title={title}
titlePostfix={titlePostfix}
titleVariant={titleVariant}
/>
</Box>
</Stack>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
GET_ORGANIZATION_QUERY,
} from '../../queries'
import { GET_PENSION_CALCULATION } from '../../queries/PensionCalculator'
import { PensionCalculatorTitle } from './PensionCalculatorTitle'
import { PensionCalculatorWrapper } from './PensionCalculatorWrapper'
import { translationStrings } from './translationStrings'
import {
Expand Down Expand Up @@ -361,16 +362,12 @@ const PensionCalculatorResults: CustomScreen<PensionCalculatorResultsProps> = ({
>
<Box paddingY={5}>
<Stack space={3}>
{isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} <div>{titlePostfix}</div>
</Text>
)}
{!isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} {titlePostfix}
</Text>
)}
<PensionCalculatorTitle
isNewSystemActive={isNewSystemActive}
title={title}
titlePostfix={titlePostfix}
titleVariant={titleVariant}
/>
<Text>
{formatMessage(translationStrings.isTurnedOff)}
</Text>
Expand All @@ -391,16 +388,12 @@ const PensionCalculatorResults: CustomScreen<PensionCalculatorResultsProps> = ({
<Box paddingY={6}>
<Stack space={5}>
<Stack space={2}>
{isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} <div>{titlePostfix}</div>
</Text>
)}
{!isNewSystemActive && (
<Text variant={titleVariant} as="h1">
{title} {titlePostfix}
</Text>
)}
<PensionCalculatorTitle
isNewSystemActive={isNewSystemActive}
title={title}
titlePostfix={titlePostfix}
titleVariant={titleVariant}
/>
<Box className={styles.textMaxWidth}>
<Text>
{formatMessage(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { useIntl } from 'react-intl'

import { GridColumn, GridRow, Text } from '@island.is/island-ui/core'

import { translationStrings } from './translationStrings'
import * as styles from './PensionCalculator.css'

interface PensionCalculatorTitleProps {
isNewSystemActive: boolean
title: string
titlePostfix: string
titleVariant: 'h1' | 'h2'
}

export const PensionCalculatorTitle = ({
isNewSystemActive,
title,
titlePostfix,
titleVariant,
}: PensionCalculatorTitleProps) => {
const { formatMessage } = useIntl()
if (isNewSystemActive)
return (
<GridRow rowGap={3} className={styles.noWrap}>
<GridColumn hiddenBelow="lg">
<img
width={84}
height={70}
src={formatMessage(translationStrings.after1stSeptember2025IconUrl)}
alt=""
/>
</GridColumn>
<GridColumn>
<Text variant={titleVariant} as="h1">
{title} <div>{titlePostfix}</div>
</Text>
</GridColumn>
</GridRow>
)
return (
<Text variant={titleVariant} as="h1">
{title} {titlePostfix}
</Text>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,13 @@ export const translationStrings = defineMessages({
defaultMessage: 'Eftir 1. september 2025',
description: 'Eftir 1. september 2025',
},
after1stSeptember2025IconUrl: {
id: 'web.pensionCalculator:after1stSeptember2025IconUrl',
defaultMessage:
'https://images.ctfassets.net/8k0h54kbe6bj/5RIwKVet87Nm4ycltkzjnX/9c594855a9b2f90dde63766ee87a09ca/58dd40fbf365769d984be22a9b64bc29.png',
description:
'Mynd vinstra megin við titil "Reiknivél örorku- og endurhæfingargreiðslna eftir 1. september 2025"',
},
after1stSeptember2025Calculate: {
id: 'web.pensionCalculator:after1stSeptember2025Calculate',
defaultMessage: 'Reikna',
Expand Down
Loading