Skip to content

Commit 5600ebe

Browse files
jack-nhsJuttonS
andauthored
[PMRP-1351] Remove inline CSS (#549)
* begins to move in line css style to classes in App.scss * starts to remove inline css * Moves inline css to App.scss for LG input stage * Removes the rest of the inline css * Removes unused variable * Removes duplicated code in App.scss * Adds units to new css classes * Adds unit to all margins --------- Co-authored-by: Jack Sutton <[email protected]>
1 parent 9a29171 commit 5600ebe

File tree

23 files changed

+197
-81
lines changed

23 files changed

+197
-81
lines changed

app/.storybook/preview.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ const preview: Preview = {
1919
(Story) => (
2020
<PatientDetailsProvider patientDetails={{ ...buildPatientDetails() }}>
2121
<MemoryRouter initialEntries={['/']}>
22-
<div
23-
className="nhsuk-width-container"
24-
style={{
25-
margin: `0 auto`,
26-
maxWidth: 960,
27-
padding: `0 1.0875rem 1.45rem`,
28-
minHeight: '75vh',
29-
}}
30-
>
22+
<div className="nhsuk-width-container preview">
3123
<main
3224
className="nhsuk-main-wrapper app-homepage"
3325
id="maincontent"

app/src/components/blocks/_arf/completeStage/CompleteStage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function CompleteStage({ documents }: Props) {
1313
return (
1414
<>
1515
<UploadSummary documents={documents} />
16-
<p style={{ fontWeight: '600' }}>
16+
<p className="complete-stage-paragraph">
1717
If you want to upload another patient&apos;s health record
1818
</p>
1919
<Button

app/src/components/blocks/_arf/documentSearchResults/DocumentSearchResults.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const DocumentSearchResults = (props: Props) => {
1111
new Date(a.created) < new Date(b.created) ? 1 : -1;
1212

1313
const orderedResults = [...props.searchResults].sort(sortMethod);
14-
const tableCaption = <h2 style={{ fontSize: 32 }}>List of documents available</h2>;
14+
const tableCaption = (
15+
<h2 className="document-search-table-caption">List of documents available</h2>
16+
);
1517
return (
1618
<Table id="available-files-table-title" caption={tableCaption}>
1719
<Table.Head>

app/src/components/blocks/_arf/documentSearchResultsOptions/DocumentSearchResultsOptions.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const DocumentSearchResultsOptions = (props: Props) => {
7474
Only permanently delete all documents for this patient if you have a valid reason
7575
to. For example, if the retention period of these documents has been reached.
7676
</p>
77-
<div style={{ display: 'flex' }}>
77+
<div className="search-result-spinner-div">
7878
{props.downloadState === SUBMISSION_STATE.PENDING ? (
7979
<SpinnerButton
8080
id="download-spinner"
@@ -96,9 +96,8 @@ const DocumentSearchResultsOptions = (props: Props) => {
9696
Download Manifest URL
9797
</a>
9898
<Button
99-
className="nhsuk-button nhsuk-button--secondary"
99+
className="nhsuk-button nhsuk-button--secondary left-margin"
100100
data-testid="delete-all-documents-btn"
101-
style={{ marginLeft: 72 }}
102101
onClick={deleteAllDocuments}
103102
>
104103
Delete All Documents

app/src/components/blocks/_arf/uploadSummary/UploadSummary.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const UploadSummary = ({ documents }: Props) => {
2424
);
2525
});
2626

27-
const tableMargin = { marginBottom: 50 };
2827
const tableCaption = (
2928
<>
3029
<h2 className="nhsuk-heading-m">
@@ -54,13 +53,8 @@ const UploadSummary = ({ documents }: Props) => {
5453
)}
5554
<h1 id="upload-summary-header">{pageHeader}</h1>
5655
{failedUploads.length > 0 && (
57-
<div className={'nhsuk-form-group--error'}>
58-
<Table
59-
responsive
60-
caption={tableCaption}
61-
style={tableMargin}
62-
id="failed-uploads"
63-
>
56+
<div className={'nhsuk-form-group--error margin'}>
57+
<Table responsive caption={tableCaption} id="failed-uploads">
6458
<Table.Body>
6559
{failedUploads.map((document) => {
6660
return (
@@ -82,7 +76,7 @@ const UploadSummary = ({ documents }: Props) => {
8276
</h2>
8377
)}
8478
{successfulUploads.length > 0 && (
85-
<Details style={tableMargin}>
79+
<Details className="details-margin">
8680
<Details.Summary
8781
id="successful-uploads-dropdown"
8882
aria-label="View successfully uploaded documents"
@@ -122,7 +116,7 @@ const UploadSummary = ({ documents }: Props) => {
122116
)}
123117
<PatientSummary />
124118

125-
<WarningCallout style={{ marginTop: 75 }} id="close-page-warning">
119+
<WarningCallout className="upload-callout-warning" id="close-page-warning">
126120
<WarningCallout.Label>Before you close this page</WarningCallout.Label>
127121
<ul>
128122
<li>

app/src/components/blocks/_arf/uploadingStage/UploadingStage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ function UploadingStage({ documents }: Props) {
4343
return (
4444
<Table.Row key={document.id}>
4545
<Table.Cell>{document.file.name}</Table.Cell>
46-
<Table.Cell style={{ width: '140px' }}>
46+
<Table.Cell className="table-cell-uploading-cell-thin">
4747
{formatFileSize(document.file.size)}
4848
</Table.Cell>
49-
<Table.Cell style={{ width: '200px' }}>
49+
<Table.Cell className="table-cell-uploading-cell-wide">
5050
<progress
5151
aria-label={`Uploading ${document.file.name}`}
5252
max="100"

app/src/components/blocks/_delete/deleteResultStage/DeleteResultStage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function DeleteResultStage({ numberOfFiles, setDownloadStage }: Props) {
7575
provides a framework for consistent and effective records management, based on
7676
established standards.
7777
</p>
78-
<p style={{ marginTop: 40 }}>
78+
<p className="paragraph-top-margin">
7979
{isGP ? (
8080
<ButtonLink onClick={handleClick} data-testid="lg-return-btn" href="#">
8181
Return to patient's Lloyd George record page

app/src/components/blocks/_lloydGeorge/lloydGeorgeFileInputStage/LloydGeorgeFileInputStage.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ function LloydGeorgeFileInputStage({ documents, setDocuments, submitDocuments }:
145145
<li>The patient details must match the record you are uploading</li>
146146
<li>The patient record must be in a PDF file or multiple PDFs</li>
147147
<li>Your PDF file(s) should be named in this format:</li>
148-
<p style={{ fontWeight: 600, margin: 20, marginRight: 0 }}>
148+
<p className="lg-input-format-paragraph">
149149
[PDFnumber]_Lloyd_George_Record_[Patient Name]_[NHS Number]_[D.O.B].PDF
150150
</p>
151151
</ul>
152-
<InsetText style={{ maxWidth: 'unset' }}>
152+
<InsetText className="input-stage-inset-text">
153153
<p>For example:</p>
154154
<p>1of2_Lloyd_George_Record_[Joe Bloggs]_[1234567890]_[25-12-2019].PDF</p>
155155
<p>2of2_Lloyd_George_Record_[Joe Bloggs]_[1234567890]_[25-12-2019].PDF</p>
@@ -174,10 +174,10 @@ function LloydGeorgeFileInputStage({ documents, setDocuments, submitDocuments }:
174174
onDrop={onFileDrop}
175175
className={'lloydgeorge_drag-and-drop'}
176176
>
177-
<strong style={{ fontSize: '1.2rem' }}>
177+
<strong className="lg-input-bold">
178178
Drag and drop a file or multiple files here
179179
</strong>
180-
<div style={{ margin: '0 2rem' }}>
180+
<div className="lg-input-svg-display">
181181
<FileSVG />
182182
</div>
183183
<div>
@@ -198,8 +198,7 @@ function LloydGeorgeFileInputStage({ documents, setDocuments, submitDocuments }:
198198
<Button
199199
data-testid={`upload-button-input`}
200200
type={'button'}
201-
className={'nhsuk-button nhsuk-button--secondary'}
202-
style={{ marginBottom: 0 }}
201+
className={'nhsuk-button nhsuk-button--secondary bottom-margin'}
203202
onClick={() => {
204203
fileInputRef.current?.click();
205204
}}
@@ -213,8 +212,8 @@ function LloydGeorgeFileInputStage({ documents, setDocuments, submitDocuments }:
213212
<Table caption="Chosen file(s)" id="selected-documents-table">
214213
<Table.Head>
215214
<Table.Row>
216-
<Table.Cell style={{ border: 'unset' }}>
217-
<div style={{ padding: '6px 0 12px 0', color: '#425563' }}>
215+
<Table.Cell table-cell-lg-input-cell-border>
216+
<div className="div-lg-input-cell">
218217
<strong>
219218
{`${documents.length}`} file
220219
{`${documents.length === 1 ? '' : 's'}`} chosen

app/src/components/blocks/_lloydGeorge/lloydGeorgeRetryUploadStage/LloydGeorgeRetryUploadStage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ function LloydGeorgeRetryUploadStage() {
3838
Try upload again
3939
</Button>
4040
<ButtonLink
41-
className="nhsuk-button nhsuk-button--secondary"
41+
className="nhsuk-button nhsuk-button--secondary small-left-margin"
4242
data-testid="search-patient-btn"
43-
style={{ marginLeft: 18 }}
4443
role="button"
4544
href="#"
4645
onClick={(e) => {

app/src/components/blocks/_lloydGeorge/lloydGeorgeUploadCompleteStage/LloydGeorgeUploadCompleteStage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function LloydGeorgeUploadCompleteStage({ documents }: Props) {
7474
You can upload more files to their record if needed, but you cannot upload
7575
duplicate files with the same name as previous uploads.
7676
</p>
77-
<p style={{ marginBottom: 50 }}>
77+
<p className="lg-upload-paragraph">
7878
If you need to replace a file, you will need to remove it and re-upload it
7979
again.
8080
</p>
@@ -93,9 +93,8 @@ function LloydGeorgeUploadCompleteStage({ documents }: Props) {
9393
</ButtonLink>
9494

9595
<ButtonLink
96-
className="nhsuk-button nhsuk-button--secondary"
96+
className="nhsuk-button nhsuk-button--secondary small-left-margin"
9797
data-testid="search-patient-btn"
98-
style={{ marginLeft: 18 }}
9998
role="button"
10099
href="#"
101100
onClick={(e) => {

0 commit comments

Comments
 (0)