-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathLocationCardPostureCheckFailView.tsx
More file actions
50 lines (46 loc) · 1.71 KB
/
Copy pathLocationCardPostureCheckFailView.tsx
File metadata and controls
50 lines (46 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import './style.scss';
import { ThemeSpacing, ThemeVariable } from '../../../../types';
import { Button } from '../../../Button/Button';
import { ButtonVariant } from '../../../Button/types';
import { Divider } from '../../../Divider/Divider';
import { Icon, IconKind } from '../../../Icon';
import { SizedBox } from '../../../SizedBox/SizedBox';
import { LocationViewHeader } from '../../components/LocationViewHeader/LocationViewHeader';
import { useLocationCardContext } from '../../context/context';
import { LocationCardViews } from '../../context/types';
export const LocationCardPostureCheckFailView = () => {
const { postureError, setPostureError, setView } = useLocationCardContext();
const backToLocation = () => {
setPostureError(null);
setView(LocationCardViews.Default);
};
const postureErrors = postureError
? postureError
.split(',')
.map((error) => error.trim())
.filter(Boolean)
: ['Your device did not pass posture check.'];
return (
<div className="location-card-posture-check-fail-view">
<Divider spacing={ThemeSpacing.Md} />
<Icon
className="posture-error-icon"
icon={IconKind.GlobeBlocked}
size={48}
staticColor={ThemeVariable.FgWhite70}
/>
<SizedBox height={ThemeSpacing.Md} />
<LocationViewHeader title="Posture check failed">
<div className="posture-errors">
{postureErrors.map((error) => (
<p className="error" key={error}>
{error}
</p>
))}
</div>
</LocationViewHeader>
<SizedBox height={ThemeSpacing.Xl} />
<Button text="Got it" variant={ButtonVariant.Secondary} onClick={backToLocation} />
</div>
);
};