Skip to content

Commit 3ad0cb1

Browse files
authored
Merge pull request danskernesdigitalebibliotek#111 from itk-dev/feature/modal-profile-notifications
Feature/modal profile notifications
2 parents bdb329a + 4a8af5d commit 3ad0cb1

File tree

4 files changed

+82
-1
lines changed

4 files changed

+82
-1
lines changed

src/stories/Library/Lists/list-dashboard/ListDashboard.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ export const ListDashboard: React.FC<ListDashboardProps> = ({
1717
return (
1818
<div className="list-dashboard">
1919
<Number label={number.label} status={number.status} />
20-
<span className="list-dashboard__title text-header-h4">{title}</span>
20+
<span
21+
className={
22+
label
23+
? "list-dashboard__title text-header-h4"
24+
: "list-dashboard__title text-body-medium-regular"
25+
}
26+
>
27+
{title}
28+
</span>
2129
{label && <StatusLabel label={label.label} status={label.status} />}
2230
{showDot && <div className="list-dashboard__dot" />}
2331
</div>

src/stories/Library/Modals/modal-profile/ModalProfile.stories.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ export default {
2424
control: { type: "text" },
2525
defaultValue: "Se din profil",
2626
},
27+
notifications: {
28+
control: { type: "object" },
29+
defaultValue: [
30+
{
31+
label: {
32+
label: "overskredet",
33+
status: "danger",
34+
},
35+
number: {
36+
label: 2,
37+
status: "danger",
38+
},
39+
title: "Afleveret for sent",
40+
showDot: true,
41+
},
42+
{
43+
number: {
44+
label: 2,
45+
status: "warning",
46+
},
47+
title: "Lån overskredet",
48+
showDot: true,
49+
},
50+
],
51+
},
2752
profileNavLinks: {
2853
control: { type: "object" },
2954
defaultValue: [

src/stories/Library/Modals/modal-profile/ModalProfile.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ import { ModalHeader } from "../modal-header/ModalHeader";
44
import { ModalCloseButton, ModalFallbackButton } from "../ModalShared";
55
import { Button } from "../../Buttons/button/Button";
66
import { LinkFilters, LinkFilter } from "../../link-filters/LinkFilters";
7+
import {
8+
ListDashboard,
9+
ListDashboardProps,
10+
} from "../../Lists/list-dashboard/ListDashboard";
711

812
export type ModalProfileProps = {
913
showModal: boolean;
1014
headerName: string;
1115
headerLinkHref: string;
1216
headerLinkText: string;
17+
notifications: ListDashboardProps[];
1318
profileNavLinks: LinkFilter[];
1419
};
1520

@@ -18,6 +23,7 @@ export const ModalProfile: React.FC<ModalProfileProps> = ({
1823
headerName,
1924
headerLinkHref,
2025
headerLinkText,
26+
notifications,
2127
profileNavLinks,
2228
}) => {
2329
const [shownModal, setShownModal] = useState(showModal);
@@ -55,6 +61,19 @@ export const ModalProfile: React.FC<ModalProfileProps> = ({
5561
headerLinkText={headerLinkText}
5662
/>
5763

64+
<div className="modal-profile__notifications">
65+
{notifications.map((item, index) => (
66+
<div key={index} className="modal-profile__notification-item">
67+
<ListDashboard
68+
title={item.title}
69+
number={item.number}
70+
label={item.label}
71+
showDot={item.showDot}
72+
/>
73+
</div>
74+
))}
75+
</div>
76+
5877
<div className="modal-profile__container">
5978
<div className="modal-profile__links">
6079
<LinkFilters filters={profileNavLinks} />

src/stories/Library/Modals/modal-profile/modal-profile.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
.modal-profile {
22
flex-direction: column;
33

4+
&__notifications {
5+
border-bottom: 1px solid $c-global-tertiary-1;
6+
7+
padding: 32px;
8+
9+
@include breakpoint-s {
10+
padding: {
11+
top: 40px;
12+
right: 80px;
13+
bottom: 40px;
14+
left: 80px;
15+
}
16+
}
17+
}
18+
19+
&__notification-item {
20+
margin-bottom: 8px;
21+
}
22+
23+
&__notification-item .list-dashboard {
24+
padding: 8px;
25+
}
26+
27+
&__notification-item .number {
28+
min-width: 40px;
29+
width: 40px;
30+
height: 40px;
31+
}
32+
433
&__container {
534
height: 100%;
635
display: flex;

0 commit comments

Comments
 (0)