Skip to content

Commit 52dfab1

Browse files
add apple help modal to configure client page
1 parent afe8f18 commit 52dfab1

File tree

4 files changed

+60
-32
lines changed

4 files changed

+60
-32
lines changed

webnext/src/pages/ClientDownload/ClientDownloadPage.tsx

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useQuery } from '@tanstack/react-query';
33
import { useNavigate } from '@tanstack/react-router';
44
import { useMemo, useState } from 'react';
55
import { m } from '../../paraglide/messages';
6+
import { AppleHelpModal } from '../../shared/components/AppleHelpModal/AppleHelpModal';
67
import { Page } from '../../shared/components/Page/Page';
78
import { PageNavigation } from '../../shared/components/PageNavigation/PageNavigation';
89
import { EnrollmentStep } from '../../shared/components/Step/Step';
@@ -20,7 +21,6 @@ import { isPresent } from '../../shared/defguard-ui/utils/isPresent';
2021
import { getClientArtifactsQueryOptions } from '../../shared/query/queryOptions';
2122
import { openVirtualLink } from '../../shared/utils/openVirtualLink';
2223
import androidIcon from './assets/android.png';
23-
import apple_video_src from './assets/apple_hardware_help.mp4';
2424
import iosIcon from './assets/ios.png';
2525
import laptopIcon from './assets/laptop.png';
2626
import desktopIcon from './assets/pc-tower.png';
@@ -162,6 +162,12 @@ export const ClientDownloadPage = () => {
162162
icon={iosIcon}
163163
/>
164164
</div>
165+
<AppleHelpModal
166+
isOpen={appleHelpModalOpen}
167+
onClose={() => {
168+
setAppleHelpModalOpen(false);
169+
}}
170+
/>
165171
<Modal
166172
title={m.client_download_modal_title()}
167173
size="small"
@@ -187,37 +193,6 @@ export const ClientDownloadPage = () => {
187193
}}
188194
/>
189195
</Modal>
190-
<Modal
191-
title={m.client_download_apple_help_title()}
192-
size="small"
193-
isOpen={appleHelpModalOpen}
194-
onClose={() => {
195-
setAppleHelpModalOpen(false);
196-
}}
197-
>
198-
<p>{m.client_download_apple_help_content_1()}</p>
199-
<SizedBox height={ThemeSpacing.Xl} />
200-
<video
201-
controls
202-
playsInline
203-
preload="metadata"
204-
src={apple_video_src}
205-
style={{
206-
width: '100%',
207-
height: 'auto',
208-
}}
209-
/>
210-
<SizedBox height={ThemeSpacing.Xl} />
211-
<p>{m.client_download_apple_help_content_2()}</p>
212-
<ModalControls
213-
submitProps={{
214-
text: m.controls_got_it(),
215-
onClick: () => {
216-
setAppleHelpModalOpen(false);
217-
},
218-
}}
219-
/>
220-
</Modal>
221196
<PageNavigation
222197
backText={m.controls_back()}
223198
onBack={() => {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { capitalCase } from 'change-case';
66
import { QRCodeCanvas } from 'qrcode.react';
77
import { useMemo, useState } from 'react';
88
import { m } from '../../../paraglide/messages';
9+
import { AppleHelpModal } from '../../../shared/components/AppleHelpModal/AppleHelpModal';
910
import { ContactFooter } from '../../../shared/components/ContactFooter/ContactFooter';
1011
import { ContainerWithIcon } from '../../../shared/components/ContainerWithIcon/ContainerWithIcon';
1112
import { Page } from '../../../shared/components/Page/Page';
@@ -30,6 +31,8 @@ export const ConfigureClientPage = () => {
3031

3132
const { data: clientLinks } = useQuery(getClientArtifactsQueryOptions);
3233

34+
const [appleHelpModalOpen, setAppleHelpModalOpen] = useState(false);
35+
3336
const clientDownloadMenu = useMemo(
3437
(): MenuItemsGroup[] => [
3538
{
@@ -44,6 +47,7 @@ export const ConfigureClientPage = () => {
4447
{
4548
header: {
4649
text: m.client_download_apple_help_header(),
50+
onHelp: () => setAppleHelpModalOpen(true),
4751
},
4852
items: [
4953
{
@@ -217,6 +221,12 @@ export const ConfigureClientPage = () => {
217221
<p className="finish">{m.client_setup_footer_extra()}</p>
218222
<ContactFooter email={pageData.enrollmentData.admin.email} />
219223
</footer>
224+
<AppleHelpModal
225+
isOpen={appleHelpModalOpen}
226+
onClose={() => {
227+
setAppleHelpModalOpen(false);
228+
}}
229+
/>
220230
</Page>
221231
);
222232
};
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { m } from '../../../paraglide/messages';
2+
import { Modal } from '../../defguard-ui/components/Modal/Modal';
3+
import { ModalControls } from '../../defguard-ui/components/ModalControls/ModalControls';
4+
import { SizedBox } from '../../defguard-ui/components/SizedBox/SizedBox';
5+
import { ThemeSpacing } from '../../defguard-ui/types';
6+
import apple_video_src from './assets/apple_hardware_help.mp4';
7+
8+
type Props = {
9+
isOpen: boolean;
10+
onClose: () => void;
11+
};
12+
13+
export const AppleHelpModal = ({ isOpen, onClose }: Props) => {
14+
return (
15+
<Modal
16+
title={m.client_download_apple_help_title()}
17+
size="small"
18+
isOpen={isOpen}
19+
onClose={onClose}
20+
>
21+
<p>{m.client_download_apple_help_content_1()}</p>
22+
<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+
/>
33+
<SizedBox height={ThemeSpacing.Xl} />
34+
<p>{m.client_download_apple_help_content_2()}</p>
35+
<ModalControls
36+
submitProps={{
37+
text: m.controls_got_it(),
38+
onClick: onClose,
39+
}}
40+
/>
41+
</Modal>
42+
);
43+
};

webnext/src/pages/ClientDownload/assets/apple_hardware_help.mp4 renamed to webnext/src/shared/components/AppleHelpModal/assets/apple_hardware_help.mp4

File renamed without changes.

0 commit comments

Comments
 (0)