@everymatrix/player-account-gaming-limits-popup 0.0.161 → 0.0.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-account-gaming-limits-popup",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.162",
|
|
4
4
|
"main": "dist/player-account-gaming-limits-popup.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "f0ae2ffa2c984a3f90ab2eea42992f92e6acf725"
|
|
40
40
|
}
|
|
@@ -1,31 +1,58 @@
|
|
|
1
1
|
<svelte:options tag={null} />
|
|
2
2
|
<script lang="typescript">
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
import { _, addNewMessages } from './i18n';
|
|
6
|
+
import { PlayerGamingLimitsTranslations } from './translations';
|
|
3
7
|
|
|
4
|
-
export let showpopup:
|
|
8
|
+
export let showpopup:any = '';
|
|
5
9
|
export let infocontent:string = '';
|
|
6
10
|
export let infoname:string = '';
|
|
7
|
-
|
|
11
|
+
export let iteminfoamount:string = '';
|
|
12
|
+
export let lang:string = 'en';
|
|
13
|
+
export let playercurrency:string = 'USD';
|
|
8
14
|
|
|
9
15
|
let showPopup:boolean = false;
|
|
10
16
|
|
|
17
|
+
Object.keys(PlayerGamingLimitsTranslations).forEach((item) => {
|
|
18
|
+
addNewMessages(item, PlayerGamingLimitsTranslations[item]);
|
|
19
|
+
});
|
|
20
|
+
|
|
11
21
|
let userAgent:String = window.navigator.userAgent;
|
|
12
22
|
let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
|
|
13
23
|
|
|
14
24
|
const closeInfoPopup = () => {
|
|
15
25
|
showPopup = false;
|
|
16
|
-
window.postMessage({ type: 'ClosePlayerAccountGamingLimitsPopup'
|
|
26
|
+
window.postMessage({ type: 'ClosePlayerAccountGamingLimitsPopup' }, window.location.href);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const messageHandler = (e:any) => {
|
|
30
|
+
if (e.data && e.data.type == 'ClosePlayerAccountGamingLimitsPopup') {
|
|
31
|
+
showPopup = false;
|
|
32
|
+
}
|
|
17
33
|
}
|
|
18
34
|
|
|
19
35
|
const initialLoad = () => {
|
|
36
|
+
if(iteminfoamount < 0) {
|
|
37
|
+
iteminfoamount = '0';
|
|
38
|
+
}
|
|
20
39
|
showPopup = showpopup;
|
|
21
40
|
}
|
|
22
41
|
|
|
42
|
+
onMount(() => {
|
|
43
|
+
window.addEventListener('message', messageHandler, false);
|
|
44
|
+
|
|
45
|
+
return () => {
|
|
46
|
+
window.removeEventListener('message', messageHandler);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
23
50
|
$: showpopup && initialLoad();
|
|
24
51
|
</script>
|
|
25
52
|
|
|
26
53
|
{#if showPopup}
|
|
27
54
|
<section class={isMobile ? 'InfoCardPopupMobileModal' : ''}>
|
|
28
|
-
<div class="InfoCardPopupWrapper {isMobile ? 'InfoCardPopupMobileWrapper' : ''}">
|
|
55
|
+
<div class="InfoCardPopupWrapper {isMobile ? 'InfoCardPopupMobileWrapper' : ''} {iteminfoamount ? 'InfoCardPopupLimitChanged' : ''}">
|
|
29
56
|
<div class="InfoCardPopupHeader">
|
|
30
57
|
<div class="InfoCardPopupIcon">i</div>
|
|
31
58
|
<div class="InfoCardPopupTitle">{infoname}</div>
|
|
@@ -34,7 +61,11 @@
|
|
|
34
61
|
</div>
|
|
35
62
|
</div>
|
|
36
63
|
<div class="InfoCardPopupContentArea">
|
|
37
|
-
|
|
64
|
+
{#if iteminfoamount}
|
|
65
|
+
<p class="InfoCardPopupContent">{$_('popupText.amountChanged', { values: { amount: iteminfoamount, currency: playercurrency}})}</p>
|
|
66
|
+
{:else}
|
|
67
|
+
<p class="InfoCardPopupContent">{infocontent}</p>
|
|
68
|
+
{/if}
|
|
38
69
|
</div>
|
|
39
70
|
</div>
|
|
40
71
|
</section>
|
|
@@ -60,6 +91,9 @@
|
|
|
60
91
|
content: '';
|
|
61
92
|
}
|
|
62
93
|
}
|
|
94
|
+
.InfoCardPopupLimitChanged {
|
|
95
|
+
background: #FFFFF8;
|
|
96
|
+
}
|
|
63
97
|
.InfoCardPopupWrapper {
|
|
64
98
|
width: ttp(12.5);
|
|
65
99
|
padding: ttp(1.25);
|
|
@@ -69,8 +103,8 @@
|
|
|
69
103
|
border-radius: 0.3125;
|
|
70
104
|
display: block;
|
|
71
105
|
position: absolute;
|
|
72
|
-
top:
|
|
73
|
-
left: -
|
|
106
|
+
top: 32px;
|
|
107
|
+
left: -84px;
|
|
74
108
|
z-index: 9;
|
|
75
109
|
&:before {
|
|
76
110
|
content: "";
|
package/src/i18n.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dictionary,
|
|
3
|
+
locale,
|
|
4
|
+
addMessages,
|
|
5
|
+
_
|
|
6
|
+
} from 'svelte-i18n';
|
|
7
|
+
|
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
+
locale.subscribe((data) => {
|
|
10
|
+
if (data == null) {
|
|
11
|
+
dictionary.set(translations);
|
|
12
|
+
locale.set(_locale);
|
|
13
|
+
}
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function addNewMessages(lang, dict) {
|
|
20
|
+
addMessages(lang, dict);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const PlayerGamingLimitsTranslations = {
|
|
2
|
+
en: {
|
|
3
|
+
popupText: {
|
|
4
|
+
amountChanged: `Your limit has been changed or increased: {amount} {currency}. You will have to wait for the expiration date for your new limit to take effect:`,
|
|
5
|
+
}
|
|
6
|
+
},
|
|
7
|
+
ro: {
|
|
8
|
+
popupText: {
|
|
9
|
+
amountChanged: `Your limit has been changed or increased: {amount} {currency}. You will have to wait for the expiration date for your new limit to take effect:`,
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|