tangled
alpha
login
or
join now
margin.at
/
margin
88
fork
atom
Write on the margins of the internet. Powered by the AT Protocol.
margin.at
extension
web
atproto
comments
88
fork
atom
overview
issues
4
pulls
1
pipelines
add iOS shortcut to landing page
scanash.com
1 month ago
1671dabc
00e0d2a6
+81
-63
1 changed file
expand all
collapse all
unified
split
web
src
pages
Landing.jsx
+81
-63
web/src/pages/Landing.jsx
···
11
11
Shield,
12
12
Zap,
13
13
} from "lucide-react";
14
14
-
import { SiFirefox, SiGooglechrome, SiBluesky } from "react-icons/si";
14
14
+
import { SiFirefox, SiGooglechrome, SiBluesky, SiApple } from "react-icons/si";
15
15
import { FaEdge } from "react-icons/fa";
16
16
import logo from "../assets/logo.svg";
17
17
···
19
19
typeof navigator !== "undefined" && /Firefox/i.test(navigator.userAgent);
20
20
const isEdge =
21
21
typeof navigator !== "undefined" && /Edg/i.test(navigator.userAgent);
22
22
+
const isIOS =
23
23
+
typeof navigator !== "undefined" &&
24
24
+
/iPad|iPhone|iPod/.test(navigator.userAgent);
25
25
+
const isSafari =
26
26
+
typeof navigator !== "undefined" &&
27
27
+
/Safari/.test(navigator.userAgent) &&
28
28
+
!/Chrome/.test(navigator.userAgent);
29
29
+
const isIOSSafari = isIOS && isSafari;
22
30
23
31
function getExtensionInfo() {
32
32
+
if (isIOSSafari) {
33
33
+
return {
34
34
+
url: "https://www.icloud.com/shortcuts/21c87edf29b046db892c9e57dac6d1fd",
35
35
+
Icon: SiApple,
36
36
+
label: "iOS",
37
37
+
isShortcut: true,
38
38
+
};
39
39
+
}
24
40
if (isFirefox) {
25
41
return {
26
42
url: "https://addons.mozilla.org/en-US/firefox/addon/margin/",
···
451
467
rel="noreferrer"
452
468
className="btn btn-primary btn-lg"
453
469
>
454
454
-
<ext.Icon size={18} />
455
455
-
Install for {ext.label}
470
470
+
{ext.Icon && <ext.Icon size={18} />}
471
471
+
{ext.isShortcut ? "Get iOS Shortcut" : `Install for ${ext.label}`}
456
472
</a>
457
473
{user ? (
458
474
<Link to="/home" className="btn btn-secondary btn-lg">
···
466
482
</Link>
467
483
)}
468
484
</div>
469
469
-
<p className="landing-browsers">
470
470
-
Also available for{" "}
471
471
-
{isFirefox ? (
472
472
-
<>
473
473
-
<a
474
474
-
href="https://microsoftedge.microsoft.com/addons/detail/margin/nfjnmllpdgcdnhmmggjihjbidmeadddn"
475
475
-
target="_blank"
476
476
-
rel="noreferrer"
477
477
-
>
478
478
-
Edge
479
479
-
</a>{" "}
480
480
-
and{" "}
481
481
-
<a
482
482
-
href="https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa/"
483
483
-
target="_blank"
484
484
-
rel="noreferrer"
485
485
-
>
486
486
-
Chrome
487
487
-
</a>
488
488
-
</>
489
489
-
) : isEdge ? (
490
490
-
<>
491
491
-
<a
492
492
-
href="https://addons.mozilla.org/en-US/firefox/addon/margin/"
493
493
-
target="_blank"
494
494
-
rel="noreferrer"
495
495
-
>
496
496
-
Firefox
497
497
-
</a>{" "}
498
498
-
and{" "}
499
499
-
<a
500
500
-
href="https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa/"
501
501
-
target="_blank"
502
502
-
rel="noreferrer"
503
503
-
>
504
504
-
Chrome
505
505
-
</a>
506
506
-
</>
507
507
-
) : (
508
508
-
<>
509
509
-
<a
510
510
-
href="https://addons.mozilla.org/en-US/firefox/addon/margin/"
511
511
-
target="_blank"
512
512
-
rel="noreferrer"
513
513
-
>
514
514
-
Firefox
515
515
-
</a>{" "}
516
516
-
and{" "}
517
517
-
<a
518
518
-
href="https://microsoftedge.microsoft.com/addons/detail/margin/nfjnmllpdgcdnhmmggjihjbidmeadddn"
519
519
-
target="_blank"
520
520
-
rel="noreferrer"
521
521
-
>
522
522
-
Edge
523
523
-
</a>
524
524
-
</>
525
525
-
)}
526
526
-
</p>
485
485
+
{!isIOSSafari && (
486
486
+
<p className="landing-browsers">
487
487
+
Also available for{" "}
488
488
+
{isFirefox ? (
489
489
+
<>
490
490
+
<a
491
491
+
href="https://microsoftedge.microsoft.com/addons/detail/margin/nfjnmllpdgcdnhmmggjihjbidmeadddn"
492
492
+
target="_blank"
493
493
+
rel="noreferrer"
494
494
+
>
495
495
+
Edge
496
496
+
</a>{" "}
497
497
+
and{" "}
498
498
+
<a
499
499
+
href="https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa/"
500
500
+
target="_blank"
501
501
+
rel="noreferrer"
502
502
+
>
503
503
+
Chrome
504
504
+
</a>
505
505
+
</>
506
506
+
) : isEdge ? (
507
507
+
<>
508
508
+
<a
509
509
+
href="https://addons.mozilla.org/en-US/firefox/addon/margin/"
510
510
+
target="_blank"
511
511
+
rel="noreferrer"
512
512
+
>
513
513
+
Firefox
514
514
+
</a>{" "}
515
515
+
and{" "}
516
516
+
<a
517
517
+
href="https://chromewebstore.google.com/detail/margin/cgpmbiiagnehkikhcbnhiagfomajncpa/"
518
518
+
target="_blank"
519
519
+
rel="noreferrer"
520
520
+
>
521
521
+
Chrome
522
522
+
</a>
523
523
+
</>
524
524
+
) : (
525
525
+
<>
526
526
+
<a
527
527
+
href="https://addons.mozilla.org/en-US/firefox/addon/margin/"
528
528
+
target="_blank"
529
529
+
rel="noreferrer"
530
530
+
>
531
531
+
Firefox
532
532
+
</a>{" "}
533
533
+
and{" "}
534
534
+
<a
535
535
+
href="https://microsoftedge.microsoft.com/addons/detail/margin/nfjnmllpdgcdnhmmggjihjbidmeadddn"
536
536
+
target="_blank"
537
537
+
rel="noreferrer"
538
538
+
>
539
539
+
Edge
540
540
+
</a>
541
541
+
</>
542
542
+
)}
543
543
+
</p>
544
544
+
)}
527
545
</div>
528
546
</section>
529
547
···
675
693
rel="noreferrer"
676
694
className="btn btn-primary btn-lg"
677
695
>
678
678
-
<ext.Icon size={18} />
679
679
-
Get the Extension
696
696
+
{ext.Icon && <ext.Icon size={18} />}
697
697
+
{ext.isShortcut ? "Get iOS Shortcut" : "Get the Extension"}
680
698
</a>
681
699
</div>
682
700
</section>