From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Fri, 19 Apr 2024 02:47:55 +0200
Subject: Adding upstream version 124.0.1.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 .../pocket/content/panels/js/saved/overlay.jsx     | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 browser/components/pocket/content/panels/js/saved/overlay.jsx

(limited to 'browser/components/pocket/content/panels/js/saved/overlay.jsx')

diff --git a/browser/components/pocket/content/panels/js/saved/overlay.jsx b/browser/components/pocket/content/panels/js/saved/overlay.jsx
new file mode 100644
index 0000000000..ab2617f112
--- /dev/null
+++ b/browser/components/pocket/content/panels/js/saved/overlay.jsx
@@ -0,0 +1,46 @@
+/*
+SavedOverlay is the view itself and contains all of the methods to manipute the overlay and messaging.
+It does not contain any logic for saving or communication with the extension or server.
+*/
+
+import React from "react";
+import ReactDOM from "react-dom";
+import Saved from "../components/Saved/Saved.jsx";
+
+var SavedOverlay = function (options) {
+  this.inited = false;
+  this.active = false;
+};
+
+SavedOverlay.prototype = {
+  create({ pockethost }) {
+    if (this.active) {
+      return;
+    }
+
+    this.active = true;
+
+    const { searchParams } = new URL(window.location.href);
+    const locale = searchParams.get(`locale`) || ``;
+    const utmSource = searchParams.get(`utmSource`);
+    const utmCampaign = searchParams.get(`utmCampaign`);
+    const utmContent = searchParams.get(`utmContent`);
+
+    ReactDOM.render(
+      <Saved
+        locale={locale}
+        pockethost={pockethost}
+        utmSource={utmSource}
+        utmCampaign={utmCampaign}
+        utmContent={utmContent}
+      />,
+      document.querySelector(`body`)
+    );
+
+    if (window?.matchMedia(`(prefers-color-scheme: dark)`).matches) {
+      document.querySelector(`body`).classList.add(`theme_dark`);
+    }
+  },
+};
+
+export default SavedOverlay;
-- 
cgit v1.2.3

