Skip to content

Commit 282a6e6

Browse files
committedMar 13, 2025
Add close button to VersionSelector and update styles for SlidePanel
1 parent 6375072 commit 282a6e6

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed
 

‎xp-archive/client/versionSelector/SlidePanel/SlidePanel.module.css

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
}
1818

1919
.panel {
20+
display: flex;
21+
flex-direction: column;
2022
position: relative;
2123
z-index: 1;
2224
width: 400px;

‎xp-archive/client/versionSelector/VersionSelector.module.css

+11
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,14 @@
4040
font-weight: var(--a-font-weight-bold);
4141
}
4242
}
43+
44+
.closeButton {
45+
position: sticky;
46+
bottom: 1rem;
47+
margin-top: 1.75rem;
48+
49+
width: fit-content;
50+
border-radius: 99px;
51+
background-color: var(--a-surface-inverted);
52+
align-self: center;
53+
}

‎xp-archive/client/versionSelector/VersionSelector.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useAppState } from 'client/context/appState/useAppState';
66
import { SlidePanel } from './SlidePanel/SlidePanel';
77
import { classNames } from '@common/client/utils/classNames';
88
import style from './VersionSelector.module.css';
9-
import { CheckmarkIcon } from '@navikt/aksel-icons';
9+
import { CheckmarkIcon, XMarkIcon } from '@navikt/aksel-icons';
1010

1111
type Props = {
1212
versions: VersionReference[];
@@ -45,7 +45,6 @@ export const VersionSelector = ({ versions, isOpen, onClose }: Props) => {
4545
const nodeId = versions.find((v) => v.versionId === versionId)?.nodeId;
4646
if (nodeId) setSelectedContentId(nodeId);
4747
setSelectedVersion(versionId);
48-
handleClose();
4948
};
5049

5150
const filteredVersions = versions.filter((version) =>
@@ -78,6 +77,14 @@ export const VersionSelector = ({ versions, isOpen, onClose }: Props) => {
7877
</VersionButton>
7978
))}
8079
</div>
80+
<Button
81+
className={style.closeButton}
82+
variant="primary-neutral"
83+
icon={<XMarkIcon />}
84+
onClick={handleClose}
85+
>
86+
Lukk versjonsvelger
87+
</Button>
8188
</SlidePanel>
8289
);
8390
};

0 commit comments

Comments
 (0)
Please sign in to comment.