Skip to content

Commit e43ae40

Browse files
add mobile client links
1 parent 09c1cd2 commit e43ae40

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

web/src/pages/openidCallback/components/OpenIDCallbackCard.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import { MessageBoxType } from '../../../shared/components/layout/MessageBox/typ
1818
import { deviceBreakpoints } from '../../../shared/constants';
1919
import { CopyField } from '../../../shared/defguard-ui/components/Layout/CopyField/CopyField';
2020
import { MessageBox } from '../../../shared/defguard-ui/components/Layout/MessageBox/MessageBox';
21-
import { useToaster } from '../../../shared/defguard-ui/hooks/toasts/useToaster';
2221
import { isPresent } from '../../../shared/defguard-ui/utils/isPresent';
2322
import { useApi } from '../../../shared/hooks/api/useApi';
2423
import { useClipboard } from '../../../shared/hooks/useClipboard';
24+
import { sharedLinks } from '../../../shared/links';
2525

2626
type ErrorResponse = {
2727
error: string;
@@ -33,7 +33,6 @@ export const OpenIDCallbackCard = () => {
3333
const { LL } = useI18nContext();
3434
const [error, setError] = useState<string | null>(null);
3535
const { writeToClipboard } = useClipboard();
36-
const toaster = useToaster();
3736

3837
const { isLoading, data } = useQuery(
3938
[],
@@ -149,9 +148,9 @@ export const OpenIDCallbackCard = () => {
149148
</div>
150149
<div className="row">
151150
<a
152-
onClick={() => {
153-
toaster.success('Unimplemented yet');
154-
}}
151+
href={sharedLinks.client.download.android}
152+
rel="noopener noreferrer"
153+
target="_blank"
155154
>
156155
<svg
157156
xmlns="http://www.w3.org/2000/svg"
@@ -240,9 +239,9 @@ export const OpenIDCallbackCard = () => {
240239
</svg>
241240
</a>
242241
<a
243-
onClick={() => {
244-
toaster.success('Unimplemented yet');
245-
}}
242+
href={sharedLinks.client.download.ios}
243+
rel="noopener noreferrer"
244+
target="_blank"
246245
>
247246
<svg
248247
xmlns="http://www.w3.org/2000/svg"
@@ -350,12 +349,15 @@ export const OpenIDCallbackCard = () => {
350349
/>
351350
</svg>
352351
</a>
353-
<a href="https://defguard.net/download" rel="noopener noreferrer" target="_blank">
352+
<a
353+
href={sharedLinks.client.download.desktop}
354+
rel="noopener noreferrer"
355+
target="_blank"
356+
>
354357
<Button
355358
size={ButtonSize.SMALL}
356359
styleVariant={ButtonStyleVariant.LINK}
357-
text="Download Desktop"
358-
onClick={() => {}}
360+
text="Download for Desktop"
359361
/>
360362
</a>
361363
</div>

web/src/shared/components/layout/Button/Button.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,12 @@ export const Button = ({
9191
className={getClassName}
9292
disabled={isDisabled}
9393
onClick={(e) => {
94-
if (!disabled && !loading && (onClick || type !== 'button')) {
95-
if (onClick) {
96-
onClick(e);
97-
}
98-
} else {
94+
if (disabled || loading) {
9995
e.preventDefault();
10096
e.stopPropagation();
97+
return;
10198
}
99+
onClick?.(e);
102100
}}
103101
onMouseEnter={() => setHovered(true)}
104102
onMouseLeave={() => setHovered(false)}

web/src/shared/defguard-ui

web/src/shared/links.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const sharedLinks = {
2+
client: {
3+
download: {
4+
android: 'https://play.google.com/store/apps/details?id=net.defguard.mobile',
5+
ios: 'https://testflight.apple.com/join/Jvdhkt7h',
6+
desktop: 'https://defguard.net/download/',
7+
},
8+
},
9+
};

0 commit comments

Comments
 (0)