Skip to content

Commit 2286958

Browse files
Merge pull request #339 from SwissBitcoinPay/added-download-page
Added download page
2 parents 7a62453 + 875a9e3 commit 2286958

File tree

6 files changed

+36
-51
lines changed

6 files changed

+36
-51
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
APP_VERSION=2.6.0
2-
APP_BUILD_NUMBER=463
2+
APP_BUILD_NUMBER=464

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
EmailLogin,
1414
SignatureLogin,
1515
Invoice,
16+
Download,
1617
Aml
1718
} from "@screens";
1819
import {
@@ -96,6 +97,7 @@ const App = () => {
9697
<Route path="signature-login" element={<SignatureLogin />} />
9798
<Route path="wallet" element={<Wallet />} />
9899
<Route path="history" element={<History />} />
100+
<Route path="download" element={<Download />} />
99101
<Route path="connect/:id" element={<Connect />} />
100102
<Route path="invoice/:id?" element={<Invoice />} />
101103
<Route path="aml/:id?" element={<Aml />} />

src/screens/Connect/styled.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/screens/Download/Download.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { useEffect } from "react";
2+
import { platform } from "@config";
3+
import { useNavigate } from "@components/Router";
4+
import { Loader } from "@components";
5+
import { Linking } from "@utils";
6+
7+
const { isWeb, isIos, isAndroid } = platform;
8+
9+
export const Download = () => {
10+
const navigate = useNavigate();
11+
12+
useEffect(() => {
13+
if (!isWeb) {
14+
navigate("/");
15+
} else {
16+
if (isIos) {
17+
void Linking.openURL(
18+
"https://apps.apple.com/app/swiss-bitcoin-pay/id6444370155"
19+
);
20+
} else if (isAndroid) {
21+
void Linking.openURL(
22+
"https://play.google.com/store/apps/details?id=ch.swissbitcoinpay.checkout"
23+
);
24+
} else {
25+
navigate("/signup");
26+
}
27+
}
28+
}, []);
29+
30+
return <Loader />;
31+
};

src/screens/Download/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { Download } from "./Download";

src/screens/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export { SignatureLogin } from "./SignatureLogin";
1111
export { History } from "./History";
1212
export { Signup } from "./Signup";
1313
export { Aml } from "./Aml";
14+
export { Download } from "./Download";

0 commit comments

Comments
 (0)