Skip to content

Commit 08c7481

Browse files
authored
APPT-2291 - Moving the change availability button to where it should be (#1631)
# Description Also changing the button type to `secondarySolid` for both as per the designs. Screenshots below of when both buttons are visible vs when only the print button is visible. <img width="912" height="895" alt="image" src="https://github.com/user-attachments/assets/1f2e5f18-c293-445f-baed-0eb1ba3ec709" /> <img width="909" height="878" alt="image" src="https://github.com/user-attachments/assets/ccb91a39-9c6d-4bff-ad50-a5d485c80366" /> Fixes # (issue) # Checklist: - [ ] My work is behind a feature toggle (if appropriate) - [ ] If my work is behind a feature toggle, I've added a full suite of tests for both the ON and OFF state - [x] The ticket number is in the Pull Request title, with format "APPT-XXX: My Title Here" - [ ] I have ran npm tsc / lint (in the future these will be ran automatically) - [ ] My code generates no new .NET warnings (in the future these will be treated as errors) - [ ] If I've added a new Function, it is disabled in all but one of the terraform groups (e.g. http_functions) - [ ] If I've added a new Function, it has both unit and integration tests. Any request body validators have unit tests also - [ ] If I've made UI changes, I've added appropriate Playwright and Jest tests - [ ] If I've added/updated an end-point, I've added the appropriate annotations and tested the Swagger documentation reflects the change
1 parent f0b9041 commit 08c7481

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

src/client/src/app/lib/components/print-page-button.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ const PrintPageButton = () => {
88
};
99

1010
return (
11-
<Button
12-
className="no-print nhsuk-button--small"
13-
secondary
14-
onClick={() => onClick()}
15-
>
11+
<Button className="no-print" small secondarySolid onClick={() => onClick()}>
1612
Print page
1713
</Button>
1814
);

src/client/src/app/site/[site]/view-availability/(nhs-layout)/daily-appointments/page.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
import { notFound } from 'next/navigation';
1616
import fromServer from '@server/fromServer';
1717
import PrintPageButton from '@components/print-page-button';
18-
import Link from 'next/link';
1918
import { Heading, Button } from 'nhsuk-react-components';
2019
import { DayView } from './day-view';
2120

@@ -71,27 +70,29 @@ const Page = async ({ params, searchParams }: PageProps) => {
7170

7271
return (
7372
<>
74-
<div className="nhsuk-button-group nhsuk-button-group--small">
73+
<ol className="nhsuk-list nhsuk-u-margin-0 nhsuk-button-group-flat flex-row">
74+
{canChangeAvailability && (
75+
<Button
76+
href={`/manage-your-appointments/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
77+
className="no-print"
78+
small
79+
secondarySolid
80+
style={{
81+
marginRight: '1rem',
82+
}}
83+
>
84+
Change availability
85+
</Button>
86+
)}
87+
&nbsp;
7588
<PrintPageButton />
76-
</div>
89+
</ol>
7790

7891
<Heading headingLevel="h2">
7992
<span className="nhsuk-caption-l">{site.name}</span>
8093
{fromDate.format('dddd D MMMM YYYY')}
8194
</Heading>
8295

83-
{canChangeAvailability && (
84-
<Link
85-
/* Inject the returnUrl into the href */
86-
href={`/site/${siteFromPath}/change-availability?returnUrl=${encodedReturnUrl}`}
87-
className="no-print nhsuk-u-margin-right-3"
88-
>
89-
<Button type="button" secondary>
90-
Change availability
91-
</Button>
92-
</Link>
93-
)}
94-
9596
<p className="print-out-data" aria-hidden="true">
9697
Generated: {GetCurrentDateTime()}
9798
</p>

0 commit comments

Comments
 (0)