Skip to content

Commit

Permalink
chore: plushie banner 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Mar 23, 2024
1 parent 479c9d3 commit e52cdef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/ts/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { log } from "./controllers/analytics-controller";
import { envConfig } from "./constants/env-config";
import * as ServerConfiguration from "./ape/server-configuration";
import * as Skeleton from "./utils/skeleton";
import { formatDistanceStrict } from "date-fns";

if (Misc.isDevEnvironment()) {
$("footer .currentVersion .text").text("localhost");
Expand Down Expand Up @@ -62,16 +63,19 @@ $(document).ready(() => {
// );
// }

const plushieBannerClosed =
window.localStorage.getItem("plushieBannerClosed") === "true";
if (!plushieBannerClosed) {
const plushieBannerClosed2 =
window.localStorage.getItem("plushieBannerClosed2") === "true";
if (!plushieBannerClosed2) {
const string = formatDistanceStrict(1711918800000, Date.now(), {
roundingMethod: "floor",
});
Notifications.addBanner(
`George Plushie - available now for a limited time! <a target="_blank" rel="noopener" href="https://mktp.co/plushie">monkeytype.store</a>`,
`The limited George Plushie will be gone in ${string} - don't miss out! <a target="_blank" rel="noopener" href="https://mktp.co/plushie2">monkeytype.store</a>`,
1,
"./images/plushiebanner.png",
false,
true,
() => {
window.localStorage.setItem("plushieBannerClosed", "true");
window.localStorage.setItem("plushieBannerClosed2", "true");
},
true
);
Expand Down

0 comments on commit e52cdef

Please sign in to comment.