Skip to content

Commit d72796a

Browse files
Use new Panel component (#233)
Now that the [Panel component](https://service-manual.nhs.uk/design-system/components/panel) has been added to NHS Frontend (thanks @davidhunter08!) we can switch to using that (and the Nunjucks macro) and remove our own css. The only addition needed was adding a modifier for reversed-out (white) links, as the new Panel component wasn’t designed to contain links...
1 parent 8a1b43c commit d72796a

File tree

7 files changed

+28
-80
lines changed

7 files changed

+28
-80
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Reversed link - displays using white text.
2+
// Used on panel components
3+
.app-link--reverse:link,
4+
.app-link--reverse:visited {
5+
color: $color_nhsuk-white;
6+
}

app/assets/sass/components/_panel.scss

Lines changed: 0 additions & 59 deletions
This file was deleted.

app/assets/sass/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
@import 'components/list-border';
66
@import 'components/related-nav';
77
@import 'components/indent-list';
8-
@import 'components/panel';
98

109
// Import GOVUK-frontend
1110
//
@@ -29,6 +28,7 @@ $govuk-brand-colour: $nhsuk-link-color;
2928
@import 'components/table';
3029
@import 'components/button';
3130
@import 'components/filters';
31+
@import 'components/link';
3232

3333

3434
@import '../../components/pagination/_pagination';

app/views/find-a-record/check.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
<div class="nhsuk-grid-column-two-thirds">
2121

2222
{% if data.changedField %}
23-
<div class="nhsuk-panel nhsuk-u-margin-bottom-8">
24-
<h1 class="nhsuk-panel__title">Changes saved</h1>
25-
<div class="nhsuk-panel__body">
26-
{{data.changedField}} has been updated.
27-
</div>
28-
</div>
23+
{{ panel({
24+
titleText: "Changes saved",
25+
text: (data.changedField + " has been updated."),
26+
classes: "nhsuk-u-margin-bottom-8"
27+
}) }}
2928
{% endif %}
3029

3130
<h1 class="nhsuk-heading-l">{{ vaccination.patient.name }}’s {{vaccination.vaccine}} vaccination record</h1>

app/views/find-a-record/patient-history.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
<div class="nhsuk-grid-column-two-thirds">
2323

2424
{% if recordDeleted %}
25-
<div class="nhsuk-panel nhsuk-u-margin-bottom-8">
26-
<h1 class="nhsuk-panel__title">Record deleted</h1>
27-
<div class="nhsuk-panel__body">
28-
Jodie Brown's {{ recordDeleted }} record has been deleted.
29-
</div>
30-
</div>
25+
{{ panel({
26+
titleText: "Record deleted",
27+
text: (data.patientName + "’s " + recordDeleted + " record has been deleted."),
28+
classes: "nhsuk-u-margin-bottom-8"
29+
}) }}
3130
{% endif %}
3231

3332
<h1 class="nhsuk-heading-l">{{ data.patientName }}’s vaccination records</h1>

app/views/vaccinate/done.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
}) }}
1515
{% endif %}
1616

17-
<div class="nhsuk-panel nhsuk-u-margin-bottom-8">
18-
<h1 class="nhsuk-panel__title">Vaccination saved</h1>
19-
<div class="nhsuk-panel__body">
20-
<a href="#">{{ data.patientName }}’s {{ data.vaccine }} record</a> will be sent to their GP.
21-
</div>
22-
</div>
17+
{% set panelHtml %}
18+
<a href="#" class="app-link--reverse">{{ data.patientName }}’s {{ data.vaccine }} record</a> will be sent to their GP.
19+
{% endset %}
20+
21+
{{ panel({
22+
titleText: "Vaccination saved",
23+
html: panelHtml
24+
}) }}
2325

2426
<form action="/vaccinate/what-next" method="post" novalidate>
2527

docs/views/template.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
{%- from 'radios/macro.njk' import radios %}
2929
{%- from 'select/macro.njk' import select %}
3030
{%- from 'summary-list/macro.njk' import summaryList %}
31-
{%- from 'tabs/macro.njk' import tabs %}
31+
{%- from 'tabs/macro.njk' import tabs %}
3232
{%- from 'tag/macro.njk' import tag %}
3333
{%- from 'textarea/macro.njk' import textarea %}
34+
{%- from 'panel/macro.njk' import panel %}
3435

3536
<!DOCTYPE html>
3637
<html lang="en">
@@ -71,7 +72,7 @@
7172
{% endblock %}
7273

7374
{% block head %}{% endblock %}
74-
75+
7576
</head>
7677

7778
<body class="{{ bodyClasses }}">

0 commit comments

Comments
 (0)