diff --git a/.env b/.env index 021fd172..53e57a9f 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ APP_VERSION=2.6.0 -APP_BUILD_NUMBER=463 \ No newline at end of file +APP_BUILD_NUMBER=464 \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 9703f5c1..992054ad 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,6 +13,7 @@ import { EmailLogin, SignatureLogin, Invoice, + Download, Aml } from "@screens"; import { @@ -96,6 +97,7 @@ const App = () => { } /> } /> } /> + } /> } /> } /> } /> diff --git a/src/screens/Connect/styled.ts b/src/screens/Connect/styled.ts deleted file mode 100644 index dfa6db8c..00000000 --- a/src/screens/Connect/styled.ts +++ /dev/null @@ -1,50 +0,0 @@ -import styled from "styled-components"; -import { View, Text, QR, Button, Image } from "@components"; - -export const ConnectPageContainer = styled(View)` - flex: 1; - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -`; - -export const ConnectPageTitleText = styled(Text)` - text-align: center; -`; - -export const ActivationQR = styled(QR)` - margin: 32px 0px; - border-radius: 8px; - overflow: hidden; -`; - -export const AppsContainer = styled(View)` - display: flex; - position: relative; - - margin-top: 32px; - width: fit-content; - user-select: none; - flex-direction: row; -`; - -export const AppIconLink = styled(Button)` - display: flex; - position: relative; - height: fit-content; - overflow: hidden; - height: 48px; - border-radius: 6.4px; - - & ~ & { - margin-left: 16px; - border-radius: 8.2px; - } -`; - -export const AppIconImg = styled(Image)` - height: 100%; -`; diff --git a/src/screens/Download/Download.tsx b/src/screens/Download/Download.tsx new file mode 100644 index 00000000..48af3675 --- /dev/null +++ b/src/screens/Download/Download.tsx @@ -0,0 +1,31 @@ +import { useEffect } from "react"; +import { platform } from "@config"; +import { useNavigate } from "@components/Router"; +import { Loader } from "@components"; +import { Linking } from "@utils"; + +const { isWeb, isIos, isAndroid } = platform; + +export const Download = () => { + const navigate = useNavigate(); + + useEffect(() => { + if (!isWeb) { + navigate("/"); + } else { + if (isIos) { + void Linking.openURL( + "https://apps.apple.com/app/swiss-bitcoin-pay/id6444370155" + ); + } else if (isAndroid) { + void Linking.openURL( + "https://play.google.com/store/apps/details?id=ch.swissbitcoinpay.checkout" + ); + } else { + navigate("/signup"); + } + } + }, []); + + return ; +}; diff --git a/src/screens/Download/index.ts b/src/screens/Download/index.ts new file mode 100644 index 00000000..315284a3 --- /dev/null +++ b/src/screens/Download/index.ts @@ -0,0 +1 @@ +export { Download } from "./Download"; diff --git a/src/screens/index.ts b/src/screens/index.ts index f7d9c0da..fc42ad69 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -11,3 +11,4 @@ export { SignatureLogin } from "./SignatureLogin"; export { History } from "./History"; export { Signup } from "./Signup"; export { Aml } from "./Aml"; +export { Download } from "./Download";