Skip to content

Commit 06f45b1

Browse files
Posture errors layout (#909)
1 parent c9b5e4f commit 06f45b1

6 files changed

Lines changed: 101 additions & 16 deletions

File tree

new-ui/src/shared/components/Icon/Icon.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { IconFiltration } from './icons/IconFiltration';
6161
import { IconGateway } from './icons/IconGateway';
6262
import { IconGithub } from './icons/IconGithub';
6363
import { IconGlobe } from './icons/IconGlobe';
64+
import { IconGlobeBlocked } from './icons/IconGlobeBlocked';
6465
import { IconGroups } from './icons/IconGroups';
6566
import { IconHamburger } from './icons/IconHamburger';
6667
import { IconHelp } from './icons/IconHelp';
@@ -291,6 +292,8 @@ export const Icon = <T extends IconKindValue>({
291292
return IconFileAdd;
292293
case 'globe':
293294
return IconGlobe;
295+
case 'globe-blocked':
296+
return IconGlobeBlocked;
294297
case 'help':
295298
return IconHelp;
296299
case 'access-settings':

new-ui/src/shared/components/Icon/icon-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const IconKind = {
3838
PieChart: 'pie-chart',
3939
Notification: 'notification',
4040
Globe: 'globe',
41+
GlobeBlocked: 'globe-blocked',
4142
Groups: 'groups',
4243
OpenInNewWindow: 'open-in-new-window',
4344
Users: 'users',
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import type { SVGProps } from 'react';
2+
3+
export const IconGlobeBlocked = (props: SVGProps<SVGSVGElement>) => {
4+
return (
5+
<svg
6+
className="stroke-icon"
7+
width="26"
8+
height="24"
9+
viewBox="0 0 26 24"
10+
fill="none"
11+
xmlns="http://www.w3.org/2000/svg"
12+
{...props}
13+
>
14+
<g opacity="0.5">
15+
<path
16+
d="M13.9422 22.659C13.3299 22.7681 12.7176 22.8149 12.0739 22.8149C6.06058 22.8149 1.17773 17.965 1.17773 11.9923C1.17773 6.01958 6.06058 1.16968 12.0739 1.16968C17.6632 1.16968 22.2635 5.34901 22.8915 10.7291"
17+
stroke="currentColor"
18+
strokeWidth="1.5"
19+
strokeLinejoin="round"
20+
/>
21+
<path
22+
d="M12.0735 22.8149C9.51436 22.8149 7.44189 17.965 7.44189 11.9923C7.44189 6.01958 9.51436 1.16968 12.0735 1.16968C14.1931 1.16968 15.983 4.5225 16.5325 9.0917"
23+
stroke="currentColor"
24+
strokeWidth="1.5"
25+
strokeLinejoin="round"
26+
/>
27+
<path
28+
d="M12.7015 16.0468C12.3404 16.0468 11.9636 16.0468 11.5867 16.0468C7.0493 15.9688 3.43819 14.8928 1.16162 14.0195"
29+
stroke="currentColor"
30+
strokeWidth="1.5"
31+
strokeLinejoin="round"
32+
/>
33+
<path
34+
d="M22.9696 7.9375C20.6145 8.84198 16.6266 10.0428 11.5867 9.96479C7.0493 9.88682 3.43819 8.81079 1.16162 7.9375"
35+
stroke="currentColor"
36+
strokeWidth="1.5"
37+
strokeLinejoin="round"
38+
/>
39+
<path
40+
d="M20.2379 22.8304C22.7698 22.8304 24.8224 20.7916 24.8224 18.2768C24.8224 15.7619 22.7698 13.7231 20.2379 13.7231C17.7059 13.7231 15.6533 15.7619 15.6533 18.2768C15.6533 20.7916 17.7059 22.8304 20.2379 22.8304Z"
41+
stroke="currentColor"
42+
strokeWidth="1.5"
43+
strokeLinejoin="round"
44+
/>
45+
<path
46+
d="M17.0508 15.1111L23.3624 21.3957"
47+
stroke="currentColor"
48+
strokeWidth="1.5"
49+
strokeLinejoin="round"
50+
/>
51+
</g>
52+
</svg>
53+
);
54+
};

new-ui/src/shared/components/Icon/style.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@
3939
.icon[style*='--icon-color'] svg circle {
4040
stroke: var(--icon-color);
4141
}
42+
43+
.icon svg.stroke-icon path,
44+
.icon[style*='--icon-color'] svg.stroke-icon path {
45+
fill: none;
46+
stroke: var(--icon-color, var(--c-white-100));
47+
}
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './style.scss';
2-
import { ThemeSpacing } from '../../../../types';
2+
import { ThemeSpacing, ThemeVariable } from '../../../../types';
33
import { Button } from '../../../Button/Button';
44
import { ButtonVariant } from '../../../Button/types';
55
import { Divider } from '../../../Divider/Divider';
@@ -17,22 +17,34 @@ export const LocationCardPostureCheckFailView = () => {
1717
setView(LocationCardViews.Default);
1818
};
1919

20+
const postureErrors = postureError
21+
? postureError
22+
.split(',')
23+
.map((error) => error.trim())
24+
.filter(Boolean)
25+
: ['Your device did not pass posture check.'];
26+
2027
return (
2128
<div className="location-card-posture-check-fail-view">
2229
<Divider spacing={ThemeSpacing.Md} />
23-
<Icon className="posture-warning-icon" icon={IconKind.WarningFilled} size={48} />
30+
<Icon
31+
className="posture-error-icon"
32+
icon={IconKind.GlobeBlocked}
33+
size={48}
34+
staticColor={ThemeVariable.FgWhite70}
35+
/>
2436
<SizedBox height={ThemeSpacing.Md} />
2537
<LocationViewHeader title="Posture check failed">
26-
<p className="error">
27-
{postureError ?? 'Your device did not pass posture check.'}
28-
</p>
38+
<div className="posture-errors">
39+
{postureErrors.map((error) => (
40+
<p className="error" key={error}>
41+
{error}
42+
</p>
43+
))}
44+
</div>
2945
</LocationViewHeader>
3046
<SizedBox height={ThemeSpacing.Xl} />
31-
<Button
32-
text="Try again"
33-
variant={ButtonVariant.Secondary}
34-
onClick={backToLocation}
35-
/>
47+
<Button text="Got it" variant={ButtonVariant.Secondary} onClick={backToLocation} />
3648
</div>
3749
);
3850
};

new-ui/src/shared/components/LocationCard/views/LocationCardPostureCheckFailView/style.scss

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,32 @@
33
flex-direction: column;
44
align-items: center;
55

6-
.posture-warning-icon {
6+
.posture-error-icon {
77
display: block;
8-
9-
svg path {
10-
fill: var(--fg-white-70);
11-
}
8+
width: 48px;
9+
height: 48px;
1210
}
1311

1412
.location-card-view-header {
1513
align-items: center;
14+
row-gap: var(--spacing-sm);
1615
text-align: center;
1716

1817
> .title {
19-
color: var(--fg-white-70);
18+
font: var(--t-body-sm-600);
19+
color: var(--fg-white-100);
20+
}
21+
22+
.posture-errors {
23+
display: flex;
24+
flex-direction: column;
25+
align-items: center;
26+
gap: var(--spacing-xs);
2027
}
2128

2229
p.error {
30+
margin: 0;
31+
font: var(--t-body-xs-400);
2332
color: var(--fg-white-70);
2433
}
2534
}

0 commit comments

Comments
 (0)