Skip to content

Commit f21f616

Browse files
committed
forbedre styling i fregboks
1 parent c13d4f7 commit f21f616

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
.bredde {
2-
width: 100px;
2+
height: fit-content;
3+
width: fit-content;
4+
input {
5+
width: 100px;
6+
}
37
}

packages/fakta/fodsel/src/components/fakta/FaktaFødselFraFReg.tsx

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FormattedMessage, useIntl } from 'react-intl';
22

33
import { ExclamationmarkTriangleFillIcon } from '@navikt/aksel-icons';
4-
import { BodyShort, Box, HStack, VStack } from '@navikt/ds-react';
4+
import { BodyShort, HStack, VStack } from '@navikt/ds-react';
55
import { ReadOnlyField } from '@navikt/ft-form-hooks';
66
import { DateLabel } from '@navikt/ft-ui-komponenter';
77

@@ -47,41 +47,35 @@ export const FaktaFødselFraFReg = ({ register }: Props) => {
4747
{barn.length > 0 && !erAlleBarnLike && (
4848
<div>
4949
{barn.map(({ fødselsdato, dødsdato }, index) => (
50-
<HStack key={fødselsdato + dødsdato} gap="6" align="end" paddingBlock="2 0" wrap={false}>
51-
<Box width="30px">
52-
<ReadOnlyField
53-
size="medium"
54-
label={<FormattedMessage id="Label.Barn" />}
55-
value={index + 1}
56-
hideLabel={index > 0}
57-
/>
58-
</Box>
59-
<Box width="100px">
50+
<HStack key={fødselsdato + dødsdato} gap="6" wrap={false} className={styles.grid}>
51+
<ReadOnlyField
52+
size="medium"
53+
label={<FormattedMessage id="Label.Barn" />}
54+
value={index + 1}
55+
hideLabel={index > 0}
56+
/>
57+
<ReadOnlyField
58+
size="medium"
59+
label={<FormattedMessage id="Label.Fodselsdato" />}
60+
value={<DateLabel dateString={fødselsdato} />}
61+
hideLabel={index > 0}
62+
/>
63+
{harDødtBarn && (
6064
<ReadOnlyField
6165
size="medium"
62-
label={<FormattedMessage id="Label.Fodselsdato" />}
63-
value={<DateLabel dateString={fødselsdato} />}
66+
value={
67+
dødsdato ? (
68+
<>
69+
<DateLabel dateString={dødsdato} />
70+
<MarkeringDød />
71+
</>
72+
) : (
73+
'-'
74+
)
75+
}
76+
label={<FormattedMessage id="Label.Dodsdato" />}
6477
hideLabel={index > 0}
6578
/>
66-
</Box>
67-
{harDødtBarn && (
68-
<Box>
69-
<ReadOnlyField
70-
size="medium"
71-
value={
72-
dødsdato ? (
73-
<>
74-
<DateLabel dateString={dødsdato} />
75-
<MarkeringDød />
76-
</>
77-
) : (
78-
'-'
79-
)
80-
}
81-
label={<FormattedMessage id="Label.Dodsdato" />}
82-
hideLabel={index > 0}
83-
/>
84-
</Box>
8579
)}
8680
</HStack>
8781
))}

packages/fakta/fodsel/src/components/fakta/faktaFødselFraFReg.module.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
color: var(--a-icon-warning);
44
height: 24px;
55
margin-left: var(--a-spacing-2);
6+
position: absolute;
67
width: 24px;
7-
position:absolute;
8+
}
9+
10+
11+
.grid {
12+
div:first-child {
13+
width: 30px
14+
}
15+
16+
div:not(:first-child) {
17+
width: 100px;
18+
}
819
}

0 commit comments

Comments
 (0)