Skip to content

Commit 6099ecb

Browse files
committed
Add more styling
1 parent cc521a0 commit 6099ecb

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.download-container {
2+
display: flex;
3+
justify-content: center;
4+
}
5+
6+
.error {
7+
background-color: var(--error-background-color);
8+
color: var(--error-text-color);
9+
}
10+
11+
.section {
12+
padding: 40px calc(2 * var(--margin));
13+
max-width: 1200px;
14+
margin: 0 auto;
15+
line-height: 1.5;
16+
}

packages/web/src/components/Download/index.tsx

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Spinner, SpinnerSize } from "@fluentui/react";
12
import { uniqueId } from "lodash";
23
import * as React from "react";
34
import { useSelector } from "react-redux";
@@ -72,9 +73,29 @@ const getAssetDownloadURL = async (os: OS): Promise<string> => {
7273
* Internal facing page for downloading desktop version of BFF.
7374
*/
7475
export default function Download() {
76+
const [isLoading, setIsLoading] = React.useState(true);
7577
const [error, setError] = React.useState<string>();
78+
const [isAicsEmployee, setIsAicsEmployee] = React.useState(false);
79+
7680
const { fileDownloadService } = useSelector(interaction.selectors.getPlatformDependentServices);
77-
const isAicsEmployee = useSelector(interaction.selectors.isAicsEmployee);
81+
const fileService = useSelector(interaction.selectors.getHttpFileService);
82+
83+
// Check if AICS employee
84+
React.useEffect(() => {
85+
setIsLoading(true);
86+
fileService
87+
.isNetworkAccessible()
88+
.then(setIsAicsEmployee)
89+
.finally(() => setIsLoading(false));
90+
}, [fileService, setIsAicsEmployee]);
91+
92+
if (!isLoading) {
93+
return (
94+
<div>
95+
<Spinner size={SpinnerSize.large} />
96+
</div>
97+
);
98+
}
7899

79100
// Only show download button if user is an AICS employee
80101
// should ever get here, but just in case
@@ -99,11 +120,12 @@ export default function Download() {
99120
};
100121

101122
return (
102-
<div className={styles.root}>
123+
<div>
103124
{error && (
104-
<div className={styles.section}>
105-
<div className={styles.error}>The following error occurred: {error}</div>
106-
</div>
125+
<>
126+
<h2>Error</h2>
127+
<p className={styles.error}>{error}</p>
128+
</>
107129
)}
108130
<div className={styles.section}>
109131
<div className={styles.downloadContainer}>
@@ -118,8 +140,8 @@ export default function Download() {
118140
</div>
119141
</div>
120142
<div className={styles.section}>
121-
<h2 className={styles.header}>Installation Instructions</h2>
122-
<p>To install the BioFile Finder, follow the OS specific instructions below.</p>
143+
<h2>Installation Instructions</h2>
144+
<h3>To install the BioFile Finder, follow the OS specific instructions below</h3>
123145
<Instructions os={os} />
124146
</div>
125147
</div>

packages/web/src/components/Home/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function Home() {
4949
},
5050
];
5151
return (
52-
<div className={styles.root}>
52+
<div>
5353
<div className={styles.banner}>
5454
<div className={classNames(styles.section, styles.bannerContent)}>
5555
<Stack

0 commit comments

Comments
 (0)