Skip to content

Commit 2d4b5ab

Browse files
apple modal update (#198)
* apple hardware help modal tweaks * fit video
1 parent 5b3ef5e commit 2d4b5ab

File tree

5 files changed

+47
-27
lines changed

5 files changed

+47
-27
lines changed

web/messages/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"cmp_enrol_final": "Final step",
2222
"cmp_openid_button": "Sign in with {provider}",
2323
"cmp_copy_field_tooltip": "Copied",
24-
"footer_contact": "If you need assistance, please contact your defguard administrator at.",
24+
"footer_contact": "If you need assistance, please contact your defguard administrator at",
2525
"session_end_title": "Session expired.",
2626
"session_end_subtitle": "Please start the process again.",
2727
"session_end_link": "Back to main page",

web/src/pages/ClientDownload/ClientDownloadPage.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import {
66
useNavigate,
77
useRouterState,
88
} from '@tanstack/react-router';
9-
import { useMemo, useState } from 'react';
9+
import { lazy, Suspense, useMemo, useState } from 'react';
1010
import { m } from '../../paraglide/messages';
11-
import { AppleHelpModal } from '../../shared/components/AppleHelpModal/AppleHelpModal';
1211
import { Page } from '../../shared/components/Page/Page';
1312
import { PageNavigation } from '../../shared/components/PageNavigation/PageNavigation';
1413
import { EnrollmentStep } from '../../shared/components/Step/Step';
@@ -32,6 +31,11 @@ import laptopIcon from './assets/laptop.png';
3231
import linuxIcon from './assets/linux.png';
3332
import desktopIcon from './assets/pc-tower.png';
3433

34+
const AppleHelpModal = lazy(async () => ({
35+
default: (await import('../../shared/components/AppleHelpModal/AppleHelpModal'))
36+
.AppleHelpModal,
37+
}));
38+
3539
export const ClientDownloadPage = () => {
3640
const { data: pageData } = useQuery(getClientArtifactsQueryOptions);
3741
const { enrollmentState } = useLoaderData({
@@ -207,12 +211,14 @@ export const ClientDownloadPage = () => {
207211
text={m.client_download_mobile_warning()}
208212
/>
209213
)}
210-
<AppleHelpModal
211-
isOpen={appleHelpModalOpen}
212-
onClose={() => {
213-
setAppleHelpModalOpen(false);
214-
}}
215-
/>
214+
<Suspense fallback={null}>
215+
<AppleHelpModal
216+
isOpen={appleHelpModalOpen}
217+
onClose={() => {
218+
setAppleHelpModalOpen(false);
219+
}}
220+
/>
221+
</Suspense>
216222
<Modal
217223
title={m.client_download_modal_title()}
218224
size="small"

web/src/pages/enrollment/ConfigureClient/ConfigureClientPage.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { useQuery } from '@tanstack/react-query';
44
import { useLoaderData } from '@tanstack/react-router';
55
import { capitalCase } from 'change-case';
66
import { QRCodeCanvas } from 'qrcode.react';
7-
import { useMemo, useState } from 'react';
7+
import { lazy, Suspense, useMemo, useState } from 'react';
88
import { m } from '../../../paraglide/messages';
9-
import { AppleHelpModal } from '../../../shared/components/AppleHelpModal/AppleHelpModal';
109
import { ContactFooter } from '../../../shared/components/ContactFooter/ContactFooter';
1110
import { ContainerWithIcon } from '../../../shared/components/ContainerWithIcon/ContainerWithIcon';
1211
import { Page } from '../../../shared/components/Page/Page';
@@ -25,6 +24,11 @@ import { ThemeSpacing } from '../../../shared/defguard-ui/types';
2524
import { getClientArtifactsQueryOptions } from '../../../shared/query/queryOptions';
2625
import { openClientLink } from '../../../shared/utils/openVirtualLink';
2726

27+
const AppleHelpModal = lazy(async () => ({
28+
default: (await import('../../../shared/components/AppleHelpModal/AppleHelpModal'))
29+
.AppleHelpModal,
30+
}));
31+
2832
export const ConfigureClientPage = () => {
2933
const pageData = useLoaderData({
3034
from: '/client-setup',
@@ -250,12 +254,14 @@ export const ConfigureClientPage = () => {
250254
<p className="finish">{m.client_setup_footer_extra()}</p>
251255
<ContactFooter email={pageData.enrollmentData.admin.email} />
252256
</footer>
253-
<AppleHelpModal
254-
isOpen={appleHelpModalOpen}
255-
onClose={() => {
256-
setAppleHelpModalOpen(false);
257-
}}
258-
/>
257+
<Suspense fallback={null}>
258+
<AppleHelpModal
259+
isOpen={appleHelpModalOpen}
260+
onClose={() => {
261+
setAppleHelpModalOpen(false);
262+
}}
263+
/>
264+
</Suspense>
259265
</Page>
260266
);
261267
};

web/src/shared/components/AppleHelpModal/AppleHelpModal.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './style.scss';
12
import { m } from '../../../paraglide/messages';
23
import { Modal } from '../../defguard-ui/components/Modal/Modal';
34
import { ModalControls } from '../../defguard-ui/components/ModalControls/ModalControls';
@@ -17,19 +18,13 @@ export const AppleHelpModal = ({ isOpen, onClose }: Props) => {
1718
size="small"
1819
isOpen={isOpen}
1920
onClose={onClose}
21+
id="apple-hardware-help"
2022
>
2123
<p>{m.client_download_apple_help_content_1()}</p>
2224
<SizedBox height={ThemeSpacing.Xl} />
23-
<video
24-
controls
25-
playsInline
26-
preload="metadata"
27-
src={apple_video_src}
28-
style={{
29-
width: '100%',
30-
height: 'auto',
31-
}}
32-
/>
25+
<video autoPlay loop playsInline preload="auto">
26+
<source src={`${apple_video_src}#t=0.1`} type="video/mp4" />
27+
</video>
3328
<SizedBox height={ThemeSpacing.Xl} />
3429
<p>{m.client_download_apple_help_content_2()}</p>
3530
<ModalControls
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#apple-hardware-help .modal-content {
2+
video {
3+
aspect-ratio: 16 / 9;
4+
width: 100%;
5+
height: auto;
6+
object-fit: cover;
7+
}
8+
9+
p {
10+
font: var(--t-body-sm-400);
11+
color: var(--fg-default);
12+
}
13+
}

0 commit comments

Comments
 (0)