blob: defdf5217d4ff27c5d3419f045926c0a46679960 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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";
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;
|