@articles-media/articles-dev-box 1.0.17 → 1.0.23
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/README.md +6 -5
- package/dist/Ad-Ck5UdTq3.js +387 -0
- package/dist/Ad.js +2 -604
- package/dist/AdConfirmExitModal-CJ-HtcVC.js +56 -0
- package/dist/AdDetailsModal-DRNRTL2W.js +108 -0
- package/dist/ArticlesAd.js +16 -15
- package/dist/Button-BlAdEbSd.js +30 -0
- package/dist/CreditsModal.js +56 -0
- package/dist/DarkModeHandler.js +17 -16
- package/dist/FriendsList.js +77 -121
- package/dist/GameScoreboard-CBY3JsFa.js +165 -0
- package/dist/GameScoreboard.js +2 -190
- package/dist/GlobalBody.js +36 -7
- package/dist/GlobalHead.js +10 -12
- package/dist/Link-MFZblBb4.js +17 -0
- package/dist/Modal-BX1s6CCU.js +1631 -0
- package/dist/ReturnToLauncherButton.js +39 -54
- package/dist/SettingsModal-XI2dMI09.js +247 -0
- package/dist/SettingsModal.js +2 -658
- package/dist/StatusModal-elrPJvX1.js +70 -0
- package/dist/ViewUserModal-DDjWLpyM.js +3094 -0
- package/dist/ViewUserModal.js +3 -3149
- package/dist/articles-dev-box.css +2 -1
- package/dist/classnames-DP6dWde5.js +31 -0
- package/dist/index.js +16 -28
- package/dist/jsx-runtime-VZk6y-ec.js +191 -0
- package/dist/numberWithCommas-BSKBdR-e.js +18 -0
- package/dist/useAuthSiteStatus-1rHjYC4N.js +29 -0
- package/dist/useFullscreen.js +24 -0
- package/dist/useUserDetails.js +22 -32
- package/dist/useUserFriends.js +29 -51
- package/dist/useUserToken.js +16 -21
- package/package.json +26 -67
- package/dist/Ad.cjs +0 -1
- package/dist/AdConfirmExitModal-Bhz-lt9w.js +0 -72
- package/dist/AdConfirmExitModal-N3Lvhb4y.cjs +0 -1
- package/dist/AdDetailsModal-BMj8DjV0.cjs +0 -1
- package/dist/AdDetailsModal-DXvfmyKK.js +0 -83
- package/dist/ArticlesAd.cjs +0 -1
- package/dist/Button-0ZK0NKiK.cjs +0 -1
- package/dist/Button-_Quon8UV.js +0 -54
- package/dist/DarkModeHandler.cjs +0 -1
- package/dist/ElementChildren-DN3RWY2E.js +0 -51
- package/dist/ElementChildren-eAwIENLl.cjs +0 -1
- package/dist/FriendsList.cjs +0 -1
- package/dist/GameScoreboard.cjs +0 -1
- package/dist/GlobalBody-BrrtfBBs.js +0 -123
- package/dist/GlobalBody-weON_TbJ.cjs +0 -33
- package/dist/GlobalBody.cjs +0 -1
- package/dist/GlobalHead.cjs +0 -1
- package/dist/Modal-Bdhkgkwr.cjs +0 -2
- package/dist/Modal-nux8R77F.js +0 -2087
- package/dist/ReturnToLauncherButton.cjs +0 -1
- package/dist/SettingsModal.cjs +0 -1
- package/dist/StatusModal-B086BgSW.js +0 -71
- package/dist/StatusModal-CzPyqQQA.cjs +0 -1
- package/dist/ViewUserModal.cjs +0 -1
- package/dist/index-BlP2-uOi.cjs +0 -1
- package/dist/index-C8MeSLnR.js +0 -2504
- package/dist/index-DWV8myok.cjs +0 -6
- package/dist/index-YnD2EP-S.js +0 -43
- package/dist/index.cjs +0 -1
- package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
- package/dist/jsx-runtime-tc70JA_2.js +0 -264
- package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
- package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
- package/dist/useUserDetails.cjs +0 -1
- package/dist/useUserFriends.cjs +0 -1
- package/dist/useUserToken.cjs +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { t } from "./Button-BlAdEbSd.js";
|
|
3
|
+
import { t as n } from "./Link-MFZblBb4.js";
|
|
4
|
+
import { t as r } from "./Modal-BX1s6CCU.js";
|
|
5
|
+
import { useEffect as i } from "react";
|
|
6
|
+
//#region src/components/Ads/AdDetailsModal.jsx
|
|
7
|
+
var a = e();
|
|
8
|
+
function o(e) {
|
|
9
|
+
let { setModalShow: o, ad: s, previewData: c } = e;
|
|
10
|
+
i(() => {
|
|
11
|
+
console.log("Mounted");
|
|
12
|
+
}, []);
|
|
13
|
+
let l = () => {
|
|
14
|
+
o(!1);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ (0, a.jsx)("div", { children: /* @__PURE__ */ (0, a.jsxs)(r, {
|
|
17
|
+
show: !0,
|
|
18
|
+
backdropClassName: "ad-details-modal-backdrop",
|
|
19
|
+
className: "articles-modal",
|
|
20
|
+
centered: !0,
|
|
21
|
+
onHide: l,
|
|
22
|
+
size: "md",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ (0, a.jsx)(r.Header, {
|
|
25
|
+
className: "align-items-center",
|
|
26
|
+
closeButton: !0,
|
|
27
|
+
children: /* @__PURE__ */ (0, a.jsx)(r.Title, { children: "Ad Details" })
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ (0, a.jsxs)(r.Body, {
|
|
30
|
+
className: "",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ (0, a.jsxs)("p", {
|
|
33
|
+
className: "mb-1",
|
|
34
|
+
children: ["Advertiser: ", /* @__PURE__ */ (0, a.jsx)("b", { children: s?.business })]
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ (0, a.jsxs)("p", {
|
|
37
|
+
className: "mb-0",
|
|
38
|
+
children: ["Ad ID: ", /* @__PURE__ */ (0, a.jsx)("b", { children: c?._id || s._id })]
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ (0, a.jsx)("hr", {}),
|
|
41
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
42
|
+
className: "mb-1",
|
|
43
|
+
children: "This ad is being shown to you for the following reasons"
|
|
44
|
+
}),
|
|
45
|
+
s.city ? /* @__PURE__ */ (0, a.jsxs)("div", { children: [
|
|
46
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
47
|
+
className: "h4 mb-1",
|
|
48
|
+
children: s.business
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ (0, a.jsx)("div", { children: "Is advertising to all zip codes within a" }),
|
|
51
|
+
/* @__PURE__ */ (0, a.jsx)("span", { children: /* @__PURE__ */ (0, a.jsx)("div", {
|
|
52
|
+
className: "badge bg-black shadow-articles",
|
|
53
|
+
children: "15 Mile Radius"
|
|
54
|
+
}) }),
|
|
55
|
+
/* @__PURE__ */ (0, a.jsx)("div", { children: "of it's business" }),
|
|
56
|
+
/* @__PURE__ */ (0, a.jsx)("hr", { className: "border w-50 border-white" }),
|
|
57
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
58
|
+
className: "d-flex align-items-center",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ (0, a.jsx)("div", { children: "Your Zip code" }),
|
|
61
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
62
|
+
className: "badge bg-black shadow-articles ms-2",
|
|
63
|
+
children: "00000"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
66
|
+
className: "ms-2",
|
|
67
|
+
children: "is"
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
70
|
+
className: "badge bg-black shadow-articles ms-2",
|
|
71
|
+
children: "4.2 miles away"
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
] }) : /* @__PURE__ */ (0, a.jsxs)("div", { children: [/* @__PURE__ */ (0, a.jsx)("div", {
|
|
76
|
+
className: "h4 mb-1",
|
|
77
|
+
children: s.business
|
|
78
|
+
}), /* @__PURE__ */ (0, a.jsx)("div", { children: "Is advertising to all users" })] }),
|
|
79
|
+
/* @__PURE__ */ (0, a.jsx)("div", { className: "grow" }),
|
|
80
|
+
/* @__PURE__ */ (0, a.jsx)("hr", { className: "w-100" }),
|
|
81
|
+
/* @__PURE__ */ (0, a.jsx)("div", {
|
|
82
|
+
className: "reason lh-sm mb-2",
|
|
83
|
+
children: "Ads we display to you will always be transparent as to why you are seeing them."
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ (0, a.jsx)(n, {
|
|
86
|
+
href: "https://articles.media/settings/account",
|
|
87
|
+
newPage: !0,
|
|
88
|
+
className: "",
|
|
89
|
+
children: /* @__PURE__ */ (0, a.jsx)(t, {
|
|
90
|
+
small: !0,
|
|
91
|
+
children: "Settings"
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ (0, a.jsx)(r.Footer, {
|
|
97
|
+
className: "d-flex justify-content-center",
|
|
98
|
+
children: /* @__PURE__ */ (0, a.jsx)(t, {
|
|
99
|
+
variant: "articles",
|
|
100
|
+
onClick: l,
|
|
101
|
+
children: "Close"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
}) });
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { o as default };
|
package/dist/ArticlesAd.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
//#region src/components/Ads/ArticlesAd.jsx
|
|
4
|
+
var n = e();
|
|
5
|
+
function r({ darkMode: e }) {
|
|
6
|
+
return t(() => {}, []), t(() => {
|
|
7
|
+
let e = document.createElement("script");
|
|
8
|
+
return e.src = "https://accounts.articles.media/js/ad.js", e.async = !0, document.body.appendChild(e), () => {
|
|
9
|
+
document.body.removeChild(e);
|
|
10
|
+
};
|
|
11
|
+
}, []), /* @__PURE__ */ (0, n.jsx)("div", {
|
|
12
|
+
className: "",
|
|
13
|
+
children: /* @__PURE__ */ (0, n.jsx)("div", { className: "articles-media-ad" })
|
|
14
|
+
});
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { r as e, t } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { t as n } from "./classnames-DP6dWde5.js";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
//#region src/components/UI/Button.jsx
|
|
5
|
+
var i = /* @__PURE__ */ e(n(), 1), a = t(), o = r((e, t) => {
|
|
6
|
+
let { size: n, variant: r, style: o, small: s, large: c, onClick: l, className: u, disabled: d, active: f, type: p, onMouseDown: m, onMouseUp: h, onMouseLeave: g, onTouchStart: _, onTouchEnd: v, ...y } = e;
|
|
7
|
+
return /* @__PURE__ */ (0, a.jsx)("button", {
|
|
8
|
+
ref: t,
|
|
9
|
+
...p && { type: "submit" },
|
|
10
|
+
disabled: d,
|
|
11
|
+
style: o,
|
|
12
|
+
onMouseDown: m,
|
|
13
|
+
onMouseUp: h,
|
|
14
|
+
onMouseLeave: g,
|
|
15
|
+
onTouchStart: _,
|
|
16
|
+
onTouchEnd: v,
|
|
17
|
+
className: (0, i.default)(`btn ${r ? `btn-${r}` : "btn-articles"}`, {
|
|
18
|
+
[u]: u,
|
|
19
|
+
"btn-lg": c,
|
|
20
|
+
"btn-sm": s,
|
|
21
|
+
active: f,
|
|
22
|
+
[`btn-${n}`]: n
|
|
23
|
+
}),
|
|
24
|
+
onClick: l,
|
|
25
|
+
children: e.children
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
o.displayName = "ArticlesButton";
|
|
29
|
+
//#endregion
|
|
30
|
+
export { o as t };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { t } from "./Button-BlAdEbSd.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { Modal as r } from "react-bootstrap";
|
|
5
|
+
//#region src/components/Games/Credits/CreditsModal.jsx
|
|
6
|
+
var i = e();
|
|
7
|
+
function a({ show: e, setShow: a, useStore: o, owner: s, repo: c, developers: l, publisher: u, introText: d }) {
|
|
8
|
+
let [f, p] = n(!1);
|
|
9
|
+
return /* @__PURE__ */ (0, i.jsxs)(r, {
|
|
10
|
+
className: "articles-modal",
|
|
11
|
+
size: "md",
|
|
12
|
+
show: e,
|
|
13
|
+
centered: !0,
|
|
14
|
+
scrollable: !0,
|
|
15
|
+
onExited: () => {},
|
|
16
|
+
onHide: () => {
|
|
17
|
+
a(!1);
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ (0, i.jsx)(r.Header, {
|
|
21
|
+
closeButton: !0,
|
|
22
|
+
children: /* @__PURE__ */ (0, i.jsx)(r.Title, { children: "Game Credits" })
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ (0, i.jsxs)(r.Body, {
|
|
25
|
+
className: "flex-column p-3",
|
|
26
|
+
children: [
|
|
27
|
+
d && /* @__PURE__ */ (0, i.jsx)("div", {
|
|
28
|
+
className: "mb-3",
|
|
29
|
+
children: d
|
|
30
|
+
}),
|
|
31
|
+
l ? /* @__PURE__ */ (0, i.jsx)("div", {}) : /* @__PURE__ */ (0, i.jsx)("div", { children: "Developed by: ArticlesJoey " }),
|
|
32
|
+
u ? /* @__PURE__ */ (0, i.jsx)("div", {}) : /* @__PURE__ */ (0, i.jsx)("div", { children: "Published by: Articles Media " }),
|
|
33
|
+
/* @__PURE__ */ (0, i.jsx)("div", { className: "mb-3" }),
|
|
34
|
+
s && c && /* @__PURE__ */ (0, i.jsxs)("div", { children: [/* @__PURE__ */ (0, i.jsx)("div", { children: "Attributions:" }), /* @__PURE__ */ (0, i.jsx)("a", {
|
|
35
|
+
href: `https://github.com/${s}/${c}/blob/main/README.md`,
|
|
36
|
+
target: "_blank",
|
|
37
|
+
rel: "noopener noreferrer",
|
|
38
|
+
children: /* @__PURE__ */ (0, i.jsxs)(t, { children: [/* @__PURE__ */ (0, i.jsx)("i", { className: "fab fa-github" }), "View on GitHub"] })
|
|
39
|
+
})] })
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ (0, i.jsxs)(r.Footer, {
|
|
43
|
+
className: "justify-content-between",
|
|
44
|
+
children: [/* @__PURE__ */ (0, i.jsx)("div", {}), /* @__PURE__ */ (0, i.jsx)(t, {
|
|
45
|
+
variant: "outline-dark",
|
|
46
|
+
onClick: () => {
|
|
47
|
+
a(!1);
|
|
48
|
+
},
|
|
49
|
+
children: "Close"
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { a as default };
|
package/dist/DarkModeHandler.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
//#region src/components/UI/DarkModeHandler.jsx
|
|
4
|
+
var n = e();
|
|
5
|
+
function r({ useStore: e }) {
|
|
6
|
+
let r = e((e) => e.darkMode), i = e((e) => e._hasHydrated);
|
|
7
|
+
return t(() => {
|
|
8
|
+
if (i) {
|
|
9
|
+
if (r == null) {
|
|
10
|
+
let t = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11
|
+
e.getState().setDarkMode(!!t);
|
|
12
|
+
}
|
|
13
|
+
r ? document.body.setAttribute("data-bs-theme", "dark") : document.body.setAttribute("data-bs-theme", "light");
|
|
14
|
+
}
|
|
15
|
+
}, [r, i]), /* @__PURE__ */ (0, n.jsx)(n.Fragment, {});
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as default };
|
package/dist/FriendsList.js
CHANGED
|
@@ -1,122 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
variant: "articles",
|
|
77
|
-
onClick: () => {
|
|
78
|
-
},
|
|
79
|
-
children: /* @__PURE__ */ e.jsx("i", { className: "fad fa-info" })
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] })
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
i.user_id
|
|
86
|
-
)) })
|
|
87
|
-
] }),
|
|
88
|
-
/* @__PURE__ */ e.jsxs(a.Footer, { className: "justify-content-between", children: [
|
|
89
|
-
/* @__PURE__ */ e.jsxs(
|
|
90
|
-
l,
|
|
91
|
-
{
|
|
92
|
-
variant: "articles",
|
|
93
|
-
onClick: () => {
|
|
94
|
-
h();
|
|
95
|
-
},
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ e.jsx("i", { className: "fad fa-redo me-2" }),
|
|
98
|
-
/* @__PURE__ */ e.jsx("span", { children: "Refresh" })
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
/* @__PURE__ */ e.jsxs(
|
|
103
|
-
l,
|
|
104
|
-
{
|
|
105
|
-
variant: "articles",
|
|
106
|
-
onClick: () => {
|
|
107
|
-
d(!1);
|
|
108
|
-
},
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ e.jsx("i", { className: "fad fa-times me-2" }),
|
|
111
|
-
"Close"
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
] })
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
);
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { t } from "./Button-BlAdEbSd.js";
|
|
3
|
+
import n from "./useUserFriends.js";
|
|
4
|
+
import { Modal as r } from "react-bootstrap";
|
|
5
|
+
//#region src/components/Friends/FriendsList.jsx
|
|
6
|
+
var i = e();
|
|
7
|
+
function a({ show: e, setShow: a, componentType: o, className: s, style: c = {}, user_id: l, user_token: u, id: d = null, allowInvite: f = !1, inviteFunction: p = null, modalBackdropClassName: m = "" }) {
|
|
8
|
+
let { data: h, error: g, isLoading: _, mutate: v } = n({
|
|
9
|
+
user_id: l,
|
|
10
|
+
user_token: u
|
|
11
|
+
});
|
|
12
|
+
if ((!o || o == "list") && !_ && h && h.length > 0) return /* @__PURE__ */ (0, i.jsx)("ul", {
|
|
13
|
+
className: s,
|
|
14
|
+
style: c,
|
|
15
|
+
children: h.map((e) => /* @__PURE__ */ (0, i.jsxs)("li", { children: [
|
|
16
|
+
e?.populated_user?.username,
|
|
17
|
+
" - ",
|
|
18
|
+
e?.populated_user?.display_name || "No Display Name"
|
|
19
|
+
] }, e.user_id))
|
|
20
|
+
});
|
|
21
|
+
if (o.toLowerCase() == "modal") return /* @__PURE__ */ (0, i.jsxs)(r, {
|
|
22
|
+
show: e,
|
|
23
|
+
size: "md",
|
|
24
|
+
className: `articles-modal ${s}`,
|
|
25
|
+
modalBackdropClassName: m,
|
|
26
|
+
centered: !0,
|
|
27
|
+
onHide: () => a(!1),
|
|
28
|
+
style: c,
|
|
29
|
+
id: d,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ (0, i.jsx)(r.Header, { children: /* @__PURE__ */ (0, i.jsx)(r.Title, { children: "Friends" }) }),
|
|
32
|
+
/* @__PURE__ */ (0, i.jsxs)(r.Body, { children: [
|
|
33
|
+
_ && /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
34
|
+
className: "d-flex align-items-center",
|
|
35
|
+
children: [/* @__PURE__ */ (0, i.jsx)("i", { className: "fad fa-spinner-third fa-spin fa-2x" }), /* @__PURE__ */ (0, i.jsx)("div", { children: "Loading..." })]
|
|
36
|
+
}),
|
|
37
|
+
!_ && h && h.length == 0 && /* @__PURE__ */ (0, i.jsx)("div", { children: "No friends to show." }),
|
|
38
|
+
!_ && h && h.length > 0 && /* @__PURE__ */ (0, i.jsx)("div", { children: h.map((e) => /* @__PURE__ */ (0, i.jsxs)("div", {
|
|
39
|
+
className: "d-flex align-items-center justify-content-between border p-1",
|
|
40
|
+
children: [
|
|
41
|
+
e?.populated_user?.username,
|
|
42
|
+
" - ",
|
|
43
|
+
e?.populated_user?.display_name || "No Display Name",
|
|
44
|
+
/* @__PURE__ */ (0, i.jsxs)("div", { children: [f && /* @__PURE__ */ (0, i.jsx)(t, {
|
|
45
|
+
variant: "articles",
|
|
46
|
+
onClick: () => {
|
|
47
|
+
f(e);
|
|
48
|
+
},
|
|
49
|
+
children: /* @__PURE__ */ (0, i.jsx)("i", { className: "fad fa-comment-check" })
|
|
50
|
+
}), /* @__PURE__ */ (0, i.jsx)(t, {
|
|
51
|
+
variant: "articles",
|
|
52
|
+
onClick: () => {},
|
|
53
|
+
children: /* @__PURE__ */ (0, i.jsx)("i", { className: "fad fa-info" })
|
|
54
|
+
})] })
|
|
55
|
+
]
|
|
56
|
+
}, e.user_id)) })
|
|
57
|
+
] }),
|
|
58
|
+
/* @__PURE__ */ (0, i.jsxs)(r.Footer, {
|
|
59
|
+
className: "justify-content-between",
|
|
60
|
+
children: [/* @__PURE__ */ (0, i.jsxs)(t, {
|
|
61
|
+
variant: "articles",
|
|
62
|
+
onClick: () => {
|
|
63
|
+
v();
|
|
64
|
+
},
|
|
65
|
+
children: [/* @__PURE__ */ (0, i.jsx)("i", { className: "fad fa-redo me-2" }), /* @__PURE__ */ (0, i.jsx)("span", { children: "Refresh" })]
|
|
66
|
+
}), /* @__PURE__ */ (0, i.jsxs)(t, {
|
|
67
|
+
variant: "articles",
|
|
68
|
+
onClick: () => {
|
|
69
|
+
a(!1);
|
|
70
|
+
},
|
|
71
|
+
children: [/* @__PURE__ */ (0, i.jsx)("i", { className: "fad fa-times me-2" }), "Close"]
|
|
72
|
+
})]
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
119
76
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { a as default };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { t as e } from "./jsx-runtime-VZk6y-ec.js";
|
|
2
|
+
import { t } from "./Button-BlAdEbSd.js";
|
|
3
|
+
import { t as n } from "./Modal-BX1s6CCU.js";
|
|
4
|
+
import { t as r } from "./ViewUserModal-DDjWLpyM.js";
|
|
5
|
+
import { useEffect as i, useState as a } from "react";
|
|
6
|
+
import o from "swr";
|
|
7
|
+
//#region src/components/UI/ArticlesSwitch.jsx
|
|
8
|
+
var s = e();
|
|
9
|
+
function c({ setChecked: e, checked: t, readOnly: n }) {
|
|
10
|
+
return /* @__PURE__ */ (0, s.jsxs)("label", {
|
|
11
|
+
className: `articles-switch mb-0 ${t && "checked"}`,
|
|
12
|
+
children: [/* @__PURE__ */ (0, s.jsx)("input", {
|
|
13
|
+
type: "checkbox",
|
|
14
|
+
readOnly: !!n,
|
|
15
|
+
checked: t,
|
|
16
|
+
onChange: () => {}
|
|
17
|
+
}), /* @__PURE__ */ (0, s.jsx)("span", {
|
|
18
|
+
onClick: (n) => {
|
|
19
|
+
if (e) {
|
|
20
|
+
e(!t);
|
|
21
|
+
return;
|
|
22
|
+
} else {
|
|
23
|
+
n.preventDefault();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
className: "slider"
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/hooks/Games/useGameScoreboard.js
|
|
33
|
+
var l = async (e) => {
|
|
34
|
+
if (process.env.NODE_ENV === "development") try {
|
|
35
|
+
let t = new URLSearchParams({ game: e.game }).toString();
|
|
36
|
+
return await (await fetch(`http://localhost:3001/api/community/games/scoreboard?${t}`)).json();
|
|
37
|
+
} catch {}
|
|
38
|
+
let t = new URLSearchParams({ game: e.game }).toString();
|
|
39
|
+
return fetch(`${e.url}?${t}`).then((e) => e.json());
|
|
40
|
+
}, u = {
|
|
41
|
+
dedupingInterval: 1e3 * 60 * 30,
|
|
42
|
+
refreshInterval: 0,
|
|
43
|
+
revalidateOnFocus: !1,
|
|
44
|
+
revalidateIfStale: !1,
|
|
45
|
+
shouldRetryOnError: !1
|
|
46
|
+
}, d = (e) => {
|
|
47
|
+
let { data: t, error: n, isLoading: r, isValidating: i, mutate: a } = o(e?.game ? {
|
|
48
|
+
url: "https://articles.media/api/community/games/scoreboard",
|
|
49
|
+
game: e.game
|
|
50
|
+
} : null, l, u);
|
|
51
|
+
return {
|
|
52
|
+
data: t,
|
|
53
|
+
error: n,
|
|
54
|
+
isLoading: r,
|
|
55
|
+
isValidating: i,
|
|
56
|
+
mutate: a
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/Games/GameScoreboard.jsx
|
|
61
|
+
function f({ game: e, reloadScoreboard: o, setReloadScoreboard: l, prepend: u, append: f }) {
|
|
62
|
+
let [p, m] = a(!1), [h, g] = a(!1), { data: _, isLoading: v, mutate: y } = d({ game: e });
|
|
63
|
+
return i(() => {}, []), i(() => {
|
|
64
|
+
o && (l(!1), y());
|
|
65
|
+
}, [o]), /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
66
|
+
className: "scoreboard",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ (0, s.jsxs)(n, {
|
|
69
|
+
show: p,
|
|
70
|
+
size: "md",
|
|
71
|
+
className: "articles-modal",
|
|
72
|
+
centered: !0,
|
|
73
|
+
onHide: () => m(!1),
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ (0, s.jsx)(n.Header, { children: /* @__PURE__ */ (0, s.jsx)(n.Title, { children: "Scoreboard Settings" }) }),
|
|
76
|
+
/* @__PURE__ */ (0, s.jsx)(n.Body, { children: /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
77
|
+
className: "d-flex justify-content-between align-items-center",
|
|
78
|
+
onClick: () => g(!h),
|
|
79
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", { children: [/* @__PURE__ */ (0, s.jsx)("i", { className: "fas fa-trophy-alt" }), /* @__PURE__ */ (0, s.jsx)("span", { children: "Join Scoreboard?" })] }), /* @__PURE__ */ (0, s.jsx)(c, { checked: h })]
|
|
80
|
+
}) }),
|
|
81
|
+
/* @__PURE__ */ (0, s.jsx)(n.Footer, {
|
|
82
|
+
className: "justify-content-between",
|
|
83
|
+
children: /* @__PURE__ */ (0, s.jsx)(t, {
|
|
84
|
+
variant: "articles",
|
|
85
|
+
onClick: () => {
|
|
86
|
+
m(!1);
|
|
87
|
+
},
|
|
88
|
+
children: "Close"
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ (0, s.jsx)("div", {
|
|
94
|
+
className: "prepend-container",
|
|
95
|
+
children: u
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
98
|
+
className: "card card-articles card-sm mb-3 mb-lg-0",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
101
|
+
className: "card-header d-flex justify-content-between align-items-center",
|
|
102
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("span", { children: [e, " Scoreboard"] }), /* @__PURE__ */ (0, s.jsx)(t, {
|
|
103
|
+
onClick: () => {
|
|
104
|
+
y();
|
|
105
|
+
},
|
|
106
|
+
small: !0,
|
|
107
|
+
children: /* @__PURE__ */ (0, s.jsx)("i", { className: "fad fa-redo me-0" })
|
|
108
|
+
})]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
111
|
+
className: "card-body p-0",
|
|
112
|
+
children: [(_?.length || 0) == 0 && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
113
|
+
className: "small p-2",
|
|
114
|
+
children: "No scores yet"
|
|
115
|
+
}), _?.map((e, t) => /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
116
|
+
className: "result d-flex flex-column justify-content-between border-bottom p-2",
|
|
117
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
118
|
+
className: "d-flex justify-content-between lh-sm",
|
|
119
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
120
|
+
className: "d-flex",
|
|
121
|
+
children: [/* @__PURE__ */ (0, s.jsx)("h5", {
|
|
122
|
+
className: "mb-0 me-3",
|
|
123
|
+
children: t + 1
|
|
124
|
+
}), /* @__PURE__ */ (0, s.jsx)("div", {
|
|
125
|
+
className: "lh-sm",
|
|
126
|
+
children: /* @__PURE__ */ (0, s.jsx)(r, {
|
|
127
|
+
populated_user: e.populated_user,
|
|
128
|
+
user_id: e.user_id
|
|
129
|
+
})
|
|
130
|
+
})]
|
|
131
|
+
}), /* @__PURE__ */ (0, s.jsx)("div", { children: /* @__PURE__ */ (0, s.jsx)("h5", {
|
|
132
|
+
className: "mb-0",
|
|
133
|
+
children: e.score || e.total
|
|
134
|
+
}) })]
|
|
135
|
+
}), e.last_play && e.public_last_play && /* @__PURE__ */ (0, s.jsxs)("small", {
|
|
136
|
+
className: "mt-1",
|
|
137
|
+
style: { fontSize: "0.75rem" },
|
|
138
|
+
children: ["Played: ", format(new Date(e.last_play), "MM/d/yy hh:mmaa")]
|
|
139
|
+
})]
|
|
140
|
+
}, e._id))]
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
143
|
+
className: "card-footer d-flex justify-content-between align-items-center",
|
|
144
|
+
children: [/* @__PURE__ */ (0, s.jsx)("div", {
|
|
145
|
+
className: "small",
|
|
146
|
+
children: "Play to get on the board!"
|
|
147
|
+
}), /* @__PURE__ */ (0, s.jsx)(t, {
|
|
148
|
+
small: !0,
|
|
149
|
+
onClick: () => {
|
|
150
|
+
m(!0);
|
|
151
|
+
},
|
|
152
|
+
children: /* @__PURE__ */ (0, s.jsx)("i", { className: "fad fa-cog me-0" })
|
|
153
|
+
})]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ (0, s.jsx)("div", {
|
|
158
|
+
className: "append-container",
|
|
159
|
+
children: f
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { f as t };
|