Skip to content

Commit

Permalink
feat: unique link stores
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannNumericite committed Jun 30, 2023
1 parent 47acd73 commit 3f59913
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## [1.2.5](https://github.com/SocialGouv/nata-site/compare/v1.2.4...v1.2.5) (2023-06-30)


### Bug Fixes

* prettier ([8d40ab1](https://github.com/SocialGouv/nata-site/commit/8d40ab1a7ea0bb0d5fbebff641d2614130577cbf))
- prettier ([8d40ab1](https://github.com/SocialGouv/nata-site/commit/8d40ab1a7ea0bb0d5fbebff641d2614130577cbf))

## [1.2.4](https://github.com/SocialGouv/nata-site/compare/v1.2.3...v1.2.4) (2023-06-30)

Expand Down
35 changes: 33 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"eslint-config-next": "13.2.4",
"next": "13.2.4",
"react": "18.2.0",
"react-device-detect": "^2.2.3",
"react-dom": "18.2.0",
"typescript": "4.9.5"
},
Expand Down
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function middleware(request: NextRequest) {

console.log("device : ", device);

if (viewport === "mobile" && OS === "iOS") {
/*if (viewport === "mobile" && OS === "iOS") {
return NextResponse.redirect(
"https://apps.apple.com/us/app/nata/id1670657282"
);
Expand All @@ -17,7 +17,7 @@ export function middleware(request: NextRequest) {
return NextResponse.redirect(
"https://play.google.com/store/apps/details?id=com.nata01&gl=FR&pli=1"
);
}
}*/
}

// See "Matching Paths" below to learn more
Expand Down
20 changes: 20 additions & 0 deletions src/pages/app-stores.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import { useRouter } from "next/navigation";
import Head from "next/head";
import React from "react";
import * as rdd from "react-device-detect";

export default function Terms() {
const { push } = useRouter();

React.useEffect(() => {
if (rdd.isMobile && rdd.isIOS) {
console.log("ios");
push("https://apps.apple.com/us/app/nata/id1670657282");
} else if (rdd.isMobile && rdd.isAndroid) {
console.log("android");
push(
"https://play.google.com/store/apps/details?id=com.nata01&gl=FR&pli=1"
);
} else {
console.log("desktop");
push("/");
}
}, []);

return (
<>
<Head>
Expand Down
16 changes: 14 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,14 @@ queue-microtask@^1.2.2:
resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==

react-dom@^18.2.0, react-dom@18.2.0:
react-device-detect@^2.2.3:
version "2.2.3"
resolved "https://registry.npmjs.org/react-device-detect/-/react-device-detect-2.2.3.tgz"
integrity sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw==
dependencies:
ua-parser-js "^1.0.33"

react-dom@^18.2.0, "react-dom@>= 0.14.0", react-dom@18.2.0:
version "18.2.0"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
Expand All @@ -1642,7 +1649,7 @@ react-is@^16.13.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react@^18.2.0, "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", react@18.2.0:
react@^18.2.0, "react@>= 0.14.0", "react@>= 16.8.0 || 17.x.x || ^18.0.0-0", react@18.2.0:
version "18.2.0"
resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
Expand Down Expand Up @@ -1940,6 +1947,11 @@ typed-array-length@^1.0.4:
resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

ua-parser-js@^1.0.33:
version "1.0.35"
resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.35.tgz"
integrity sha512-fKnGuqmTBnIE+/KXSzCn4db8RTigUzw1AN0DmdU6hJovUTbYJKyqj+8Mt1c4VfRDnOVJnENmfYkIPZ946UrSAA==

unbox-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz"
Expand Down

0 comments on commit 3f59913

Please sign in to comment.