@articles-media/articles-dev-box 1.0.31 → 1.0.33

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.
Files changed (51) hide show
  1. package/README.md +11 -3
  2. package/dist/Ad-BsG4C_lR.js +668 -0
  3. package/dist/Ad.js +2 -2
  4. package/dist/AdConfirmExitModal-heFPJNdX.js +55 -0
  5. package/dist/AdDetailsModal-D2-4lh9e.js +107 -0
  6. package/dist/ArticlesAd.js +15 -10
  7. package/dist/Button-DvEZjsVV.js +32 -0
  8. package/dist/CreditsModal.js +51 -35
  9. package/dist/DarkModeHandler.js +21 -13
  10. package/dist/FriendsList.js +49 -47
  11. package/dist/GameMenu-BD1HSDJ-.js +84 -0
  12. package/dist/GameMenu.js +2 -0
  13. package/dist/GameScoreboard-DVoXXDnM.js +174 -0
  14. package/dist/GameScoreboard.js +2 -2
  15. package/dist/GlobalBody.js +58 -23
  16. package/dist/GlobalHead.js +5 -5
  17. package/dist/Link-CguWJy6y.js +16 -0
  18. package/dist/ReturnToLauncherButton.js +26 -22
  19. package/dist/SessionButton.js +62 -38
  20. package/dist/SettingsModal-BWEW8IAS.js +430 -0
  21. package/dist/SettingsModal.js +2 -2
  22. package/dist/SignInButton.js +21 -17
  23. package/dist/SocketServerUrlHandler.js +14 -10
  24. package/dist/StatusModal-BXRbJQ10.js +84 -0
  25. package/dist/ToontownModeHandler.js +13 -10
  26. package/dist/ViewUserModal-Dgo1C4sR.js +1798 -0
  27. package/dist/ViewUserModal.js +2 -2
  28. package/dist/articles-dev-box.css +498 -2
  29. package/dist/classnames-No-mjhw1.js +66 -0
  30. package/dist/index.js +23 -22
  31. package/dist/numberWithCommas-B0B9bjWC.js +2198 -0
  32. package/dist/typicalZustandStoreExcludes.js +4 -3
  33. package/dist/typicalZustandStoreStateSlice.js +53 -49
  34. package/dist/useAuthSiteStatus-ZK1GbPBV.js +34 -0
  35. package/dist/useFullscreen.js +38 -18
  36. package/dist/useUserDetails.js +17 -16
  37. package/dist/useUserFriends.js +23 -21
  38. package/dist/useUserToken.js +12 -11
  39. package/package.json +2 -1
  40. package/dist/Ad-CFuDgQYL.js +0 -504
  41. package/dist/AdConfirmExitModal-skW9lp88.js +0 -55
  42. package/dist/AdDetailsModal-CdTR2Y9l.js +0 -107
  43. package/dist/Button-sSB4xpOw.js +0 -31
  44. package/dist/GameScoreboard-9GYlLx72.js +0 -165
  45. package/dist/Link-8nSDV4sI.js +0 -16
  46. package/dist/SettingsModal-CiLvMoLW.js +0 -303
  47. package/dist/StatusModal-PG3i9NKf.js +0 -75
  48. package/dist/ViewUserModal-C5gjfuJ5.js +0 -1549
  49. package/dist/classnames-DCsil9eG.js +0 -39
  50. package/dist/numberWithCommas-DSRplpBy.js +0 -1170
  51. package/dist/useAuthSiteStatus-Cj9IjMj7.js +0 -29
@@ -0,0 +1,174 @@
1
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
2
+ import { t as ViewUserModal } from "./ViewUserModal-Dgo1C4sR.js";
3
+ import { useEffect, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import useSWR from "swr";
6
+ import Modal from "react-bootstrap/Modal";
7
+ //#region src/components/UI/ArticlesSwitch.jsx
8
+ function ArticlesSwitch({ setChecked, checked, readOnly }) {
9
+ return /* @__PURE__ */ jsxs("label", {
10
+ className: `articles-switch mb-0 ${checked && "checked"}`,
11
+ children: [/* @__PURE__ */ jsx("input", {
12
+ type: "checkbox",
13
+ readOnly: readOnly ? true : false,
14
+ checked,
15
+ onChange: () => {}
16
+ }), /* @__PURE__ */ jsx("span", {
17
+ onClick: (e) => {
18
+ if (setChecked) {
19
+ setChecked(!checked);
20
+ return;
21
+ } else {
22
+ e.preventDefault();
23
+ return;
24
+ }
25
+ },
26
+ className: "slider"
27
+ })]
28
+ });
29
+ }
30
+ //#endregion
31
+ //#region src/hooks/Games/useGameScoreboard.js
32
+ var fetcher = async (obj) => {
33
+ if (process.env.NODE_ENV === "development") try {
34
+ const params = new URLSearchParams({ game: obj.game }).toString();
35
+ return await (await fetch(`http://localhost:3001/api/community/games/scoreboard?${params}`)).json();
36
+ } catch (err) {}
37
+ const params = new URLSearchParams({ game: obj.game }).toString();
38
+ return fetch(`${obj.url}?${params}`).then((res) => res.json());
39
+ };
40
+ var options = {
41
+ dedupingInterval: 1e3 * 60 * 30,
42
+ errorRetryInterval: 1e3 * 60 * 5,
43
+ refreshInterval: 0,
44
+ revalidateOnFocus: false,
45
+ revalidateIfStale: false,
46
+ shouldRetryOnError: false
47
+ };
48
+ var useGameScoreboard = (params) => {
49
+ const { data, error, isLoading, isValidating, mutate } = useSWR(params?.game ? {
50
+ url: "https://articles.media/api/community/games/scoreboard",
51
+ game: params.game
52
+ } : null, fetcher, options);
53
+ return {
54
+ data,
55
+ error,
56
+ isLoading,
57
+ isValidating,
58
+ mutate
59
+ };
60
+ };
61
+ //#endregion
62
+ //#region src/components/Games/GameScoreboard.jsx
63
+ function GameScoreboard({ game, metric, reloadScoreboard, setReloadScoreboard, prepend, append }) {
64
+ const [showSettings, setShowSettings] = useState(false);
65
+ const [visible, setVisible] = useState(false);
66
+ const { data: scoreboard, isLoading: scoreboardIsLoading, mutate: scoreboardMutate } = useGameScoreboard({ game });
67
+ useEffect(() => {}, []);
68
+ useEffect(() => {
69
+ if (reloadScoreboard) {
70
+ setReloadScoreboard(false);
71
+ scoreboardMutate();
72
+ }
73
+ }, [reloadScoreboard]);
74
+ return /* @__PURE__ */ jsxs("div", {
75
+ className: "scoreboard",
76
+ children: [
77
+ /* @__PURE__ */ jsxs(Modal, {
78
+ show: showSettings,
79
+ size: "md",
80
+ className: "articles-modal",
81
+ centered: true,
82
+ onHide: () => setShowSettings(false),
83
+ children: [
84
+ /* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: "Scoreboard Settings" }) }),
85
+ /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("div", {
86
+ className: "d-flex justify-content-between align-items-center",
87
+ onClick: () => setVisible(!visible),
88
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("i", { className: "fas fa-trophy-alt" }), /* @__PURE__ */ jsx("span", { children: "Join Scoreboard?" })] }), /* @__PURE__ */ jsx(ArticlesSwitch, { checked: visible })]
89
+ }) }),
90
+ /* @__PURE__ */ jsx(Modal.Footer, {
91
+ className: "justify-content-between",
92
+ children: /* @__PURE__ */ jsx(ArticlesButton, {
93
+ variant: "articles",
94
+ onClick: () => {
95
+ setShowSettings(false);
96
+ },
97
+ children: "Close"
98
+ })
99
+ })
100
+ ]
101
+ }),
102
+ /* @__PURE__ */ jsx("div", {
103
+ className: "prepend-container",
104
+ children: prepend
105
+ }),
106
+ /* @__PURE__ */ jsxs("div", {
107
+ className: "card card-articles card-sm mb-3 mb-lg-0",
108
+ children: [
109
+ /* @__PURE__ */ jsxs("div", {
110
+ className: "card-header d-flex justify-content-between align-items-center",
111
+ children: [/* @__PURE__ */ jsxs("span", { children: [game, " Scoreboard"] }), /* @__PURE__ */ jsx(ArticlesButton, {
112
+ onClick: () => {
113
+ scoreboardMutate();
114
+ },
115
+ small: true,
116
+ children: /* @__PURE__ */ jsx("i", { className: "fad fa-redo me-0" })
117
+ })]
118
+ }),
119
+ /* @__PURE__ */ jsxs("div", {
120
+ className: "card-body p-0",
121
+ children: [(scoreboard?.length || 0) == 0 && /* @__PURE__ */ jsx("div", {
122
+ className: "small p-2",
123
+ children: "No scores yet"
124
+ }), scoreboard?.length > 0 && scoreboard?.map((doc, i) => /* @__PURE__ */ jsxs("div", {
125
+ className: "result d-flex flex-column justify-content-between border-bottom p-2",
126
+ children: [/* @__PURE__ */ jsxs("div", {
127
+ className: "d-flex justify-content-between lh-sm",
128
+ children: [/* @__PURE__ */ jsxs("div", {
129
+ className: "d-flex",
130
+ children: [/* @__PURE__ */ jsx("h5", {
131
+ className: "mb-0 me-3",
132
+ children: i + 1
133
+ }), /* @__PURE__ */ jsx("div", {
134
+ className: "lh-sm",
135
+ children: /* @__PURE__ */ jsx(ViewUserModal, {
136
+ populated_user: doc.populated_user,
137
+ user_id: doc.user_id
138
+ })
139
+ })]
140
+ }), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h5", {
141
+ className: "mb-0",
142
+ children: doc.score || doc.total
143
+ }) })]
144
+ }), doc.last_play && doc.public_last_play && /* @__PURE__ */ jsxs("small", {
145
+ className: "mt-1",
146
+ style: { fontSize: "0.75rem" },
147
+ children: ["Played: ", format(new Date(doc.last_play), "MM/d/yy hh:mmaa")]
148
+ })]
149
+ }, doc._id))]
150
+ }),
151
+ /* @__PURE__ */ jsxs("div", {
152
+ className: "card-footer d-flex justify-content-between align-items-center",
153
+ children: [/* @__PURE__ */ jsx("div", {
154
+ className: "small",
155
+ children: "Play to get on the board!"
156
+ }), /* @__PURE__ */ jsx(ArticlesButton, {
157
+ small: true,
158
+ onClick: () => {
159
+ setShowSettings(true);
160
+ },
161
+ children: /* @__PURE__ */ jsx("i", { className: "fad fa-cog me-0" })
162
+ })]
163
+ })
164
+ ]
165
+ }),
166
+ /* @__PURE__ */ jsx("div", {
167
+ className: "append-container",
168
+ children: append
169
+ })
170
+ ]
171
+ });
172
+ }
173
+ //#endregion
174
+ export { GameScoreboard as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./GameScoreboard-9GYlLx72.js";
2
- export { e as default };
1
+ import { t as GameScoreboard } from "./GameScoreboard-DVoXXDnM.js";
2
+ export { GameScoreboard as default };
@@ -1,36 +1,71 @@
1
1
  "use client";
2
- import { n as e, t } from "./classnames-DCsil9eG.js";
3
- import { n, t as r } from "./useAuthSiteStatus-Cj9IjMj7.js";
4
- import { Suspense as i, lazy as a, memo as o, useState as s } from "react";
5
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import { n as __toESM, t as require_classnames } from "./classnames-No-mjhw1.js";
3
+ import { n as useMainSiteStatus, t as useAuthSiteStatus } from "./useAuthSiteStatus-ZK1GbPBV.js";
4
+ import { Suspense, lazy, memo, useState } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/Global/GlobalBody.jsx
7
- var d = /* @__PURE__ */ e(t(), 1), f = a(() => import("./StatusModal-PG3i9NKf.js"));
8
- function p(e) {
9
- let [t, a] = s(!1), { data: o, error: p, isLoading: m, mutate: h } = n({ disable: process.env.NODE_ENV !== "development" }), { data: g, error: _, isLoading: v, mutate: y } = r({ disable: process.env.NODE_ENV !== "development" });
10
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("link", {
7
+ var import_classnames = /* @__PURE__ */ __toESM(require_classnames(), 1);
8
+ var StatusModal = lazy(() => import("./StatusModal-BXRbJQ10.js"));
9
+ function GlobalBody(props) {
10
+ const [statusModal, setStatusModal] = useState(false);
11
+ const { data: mainSiteStatus, error: mainSiteStatusError, isLoading: mainSiteStatusLoading, mutate: mainSiteStatusMutate } = useMainSiteStatus({ disable: process.env.NODE_ENV !== "development" });
12
+ const { data: authSiteStatus, error: authSiteStatusError, isLoading: authSiteStatusLoading, mutate: authSiteStatusMutate } = useAuthSiteStatus({ disable: process.env.NODE_ENV !== "development" });
13
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("link", {
11
14
  rel: "stylesheet",
12
- href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
13
- }), process.env.NODE_ENV === "development" && /* @__PURE__ */ u(c, { children: [
14
- /* @__PURE__ */ l("style", { children: " \n @keyframes grow-shrink {\n 0% { transform: translateY(-50px); }\n 50% { transform: translateY(0px); }\n 100% { transform: translateY(-50px); }\n }\n .articles-global-body {\n transform: translateY(-40px);\n z-index: 1055!important;\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n margin: 0;\n padding: 0;\n background-color: yellow;\n color: #FFFFFF;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n animation: grow-shrink 2s ease-in;\n border: 4px solid red;\n cursor: pointer;\n }\n .articles-global-body.main-connected {\n background-color: green;\n }\n .articles-global-body.auth-connected {\n border-color: blue;\n } \n " }),
15
- /* @__PURE__ */ l("div", {
15
+ href: `https://cdn.articles.media/fonts/fontawesome/css/all.min.css`
16
+ }), process.env.NODE_ENV === "development" && /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ /* @__PURE__ */ jsx("style", { children: `
18
+ @keyframes grow-shrink {
19
+ 0% { transform: translateY(-50px); }
20
+ 50% { transform: translateY(0px); }
21
+ 100% { transform: translateY(-50px); }
22
+ }
23
+ .articles-global-body {
24
+ transform: translateY(-40px);
25
+ z-index: 1055!important;
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ width: 50px;
33
+ height: 50px;
34
+ margin: 0;
35
+ padding: 0;
36
+ background-color: yellow;
37
+ color: #FFFFFF;
38
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
39
+ animation: grow-shrink 2s ease-in;
40
+ border: 4px solid red;
41
+ cursor: pointer;
42
+ }
43
+ .articles-global-body.main-connected {
44
+ background-color: green;
45
+ }
46
+ .articles-global-body.auth-connected {
47
+ border-color: blue;
48
+ }
49
+ ` }),
50
+ /* @__PURE__ */ jsx("div", {
16
51
  onClick: () => {
17
- a(!0);
52
+ setStatusModal(true);
18
53
  },
19
- className: (0, d.default)("articles-global-body", {
20
- "main-connected": o,
21
- "auth-connected": g
54
+ className: (0, import_classnames.default)(`articles-global-body`, {
55
+ "main-connected": mainSiteStatus,
56
+ "auth-connected": authSiteStatus
22
57
  }),
23
- children: /* @__PURE__ */ l("div", {
58
+ children: /* @__PURE__ */ jsx("div", {
24
59
  className: "content",
25
- children: /* @__PURE__ */ l("i", { className: "fas fa-thumbs-up" })
60
+ children: /* @__PURE__ */ jsx("i", { className: "fas fa-thumbs-up" })
26
61
  })
27
62
  }),
28
- t && /* @__PURE__ */ l(i, { children: /* @__PURE__ */ l(f, {
29
- show: t,
30
- setShow: a
63
+ statusModal && /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(StatusModal, {
64
+ show: statusModal,
65
+ setShow: setStatusModal
31
66
  }) })
32
67
  ] })] });
33
68
  }
34
- var m = o(p);
69
+ var GlobalBody_default = memo(GlobalBody);
35
70
  //#endregion
36
- export { m as default };
71
+ export { GlobalBody_default as default };
@@ -1,10 +1,10 @@
1
- import { Fragment as e, jsx as t } from "react/jsx-runtime";
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
2
  //#region src/components/Global/GlobalHead.jsx
3
- function n() {
4
- return /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("link", {
3
+ function GlobalHead() {
4
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("link", {
5
5
  rel: "stylesheet",
6
- href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
6
+ href: `https://cdn.articles.media/fonts/fontawesome/css/all.min.css`
7
7
  }) });
8
8
  }
9
9
  //#endregion
10
- export { n as default };
10
+ export { GlobalHead as default };
@@ -0,0 +1,16 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ //#region src/components/UI/Link.jsx
3
+ function Link(props) {
4
+ const { href, children, newPage, ...rest } = props;
5
+ return /* @__PURE__ */ jsx("a", {
6
+ href,
7
+ ...rest,
8
+ ...newPage && {
9
+ target: "_blank",
10
+ rel: "noopener noreferrer"
11
+ },
12
+ children
13
+ });
14
+ }
15
+ //#endregion
16
+ export { Link as t };
@@ -1,39 +1,43 @@
1
1
  "use client";
2
- import { t as e } from "./Button-sSB4xpOw.js";
3
- import { useEffect as t, useState as n } from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
3
+ import { useEffect, useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Games/ReturnToLauncherButton.jsx
6
- function a({ className: a, id: o }) {
7
- let [s, c] = n(!1);
8
- if (t(() => {
9
- c(!0);
10
- }, []), !s) return null;
11
- let l = new URLSearchParams(window.location.search), { launcher_mode: u } = Object.fromEntries(l);
12
- return u = u === "1", u ? /* @__PURE__ */ i(e, {
13
- className: `${a} w-100`,
14
- id: o,
15
- small: !0,
6
+ function ReturnToLauncherButton({ className, id }) {
7
+ const [isMounted, setIsMounted] = useState(false);
8
+ useEffect(() => {
9
+ setIsMounted(true);
10
+ }, []);
11
+ if (!isMounted) return null;
12
+ const urlParams = new URLSearchParams(window.location.search);
13
+ let { launcher_mode } = Object.fromEntries(urlParams);
14
+ launcher_mode = launcher_mode === "1" ? true : false;
15
+ if (!launcher_mode) return /* @__PURE__ */ jsxs(ArticlesButton, {
16
+ className: `${className} w-100`,
17
+ small: true,
18
+ id,
16
19
  style: {
17
20
  zIndex: 10,
18
21
  position: "relative"
19
22
  },
20
23
  onClick: () => {
21
- window.location.href = "https://games.articles.media";
24
+ window.location.href = `https://games.articles.media`;
22
25
  },
23
- children: [/* @__PURE__ */ r("i", { className: "fad fa-gamepad" }), "Return to Games"]
24
- }) : /* @__PURE__ */ i(e, {
25
- className: `${a} w-100`,
26
- small: !0,
27
- id: o,
26
+ children: [/* @__PURE__ */ jsx("i", { className: "fad fa-gamepad" }), "View our other games"]
27
+ });
28
+ return /* @__PURE__ */ jsxs(ArticlesButton, {
29
+ className: `${className} w-100`,
30
+ id,
31
+ small: true,
28
32
  style: {
29
33
  zIndex: 10,
30
34
  position: "relative"
31
35
  },
32
36
  onClick: () => {
33
- window.location.href = "https://games.articles.media";
37
+ window.location.href = `https://games.articles.media`;
34
38
  },
35
- children: [/* @__PURE__ */ r("i", { className: "fad fa-gamepad" }), "View our other games"]
39
+ children: [/* @__PURE__ */ jsx("i", { className: "fad fa-gamepad" }), "Return to Games"]
36
40
  });
37
41
  }
38
42
  //#endregion
39
- export { a as default };
43
+ export { ReturnToLauncherButton as default };
@@ -1,46 +1,70 @@
1
- import { t as e } from "./Button-sSB4xpOw.js";
2
- import t from "./SignInButton.js";
3
- import n from "./useUserDetails.js";
4
- import r from "./useUserToken.js";
5
- import { t as i } from "./ViewUserModal-C5gjfuJ5.js";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
1
+ import { t as ArticlesButton } from "./Button-DvEZjsVV.js";
2
+ import SignInButton from "./SignInButton.js";
3
+ import useUserDetails from "./useUserDetails.js";
4
+ import useUserToken from "./useUserToken.js";
5
+ import { t as ViewUserModal } from "./ViewUserModal-Dgo1C4sR.js";
6
+ import FriendsList from "./FriendsList.js";
7
+ import { useState } from "react";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
9
  //#region src/components/User/SessionButton.jsx
8
- function c({ port: c }) {
9
- let { data: l, error: u, isLoading: d, mutate: f } = r(c), { data: p, error: m, isLoading: h, mutate: g } = n({ token: l });
10
- return /* @__PURE__ */ o(a, { children: p ? /* @__PURE__ */ s("div", {
10
+ function SessionButton({ port, friendsButton }) {
11
+ const { data: userToken, error: userTokenError, isLoading: userTokenLoading, mutate: userTokenMutate } = useUserToken(port);
12
+ const { data: userDetails, error: userDetailsError, isLoading: userDetailsLoading, mutate: userDetailsMutate } = useUserDetails({ token: userToken });
13
+ const logoutLink = `/api/signout`;
14
+ const [showFriendsModal, setShowFriendsModal] = useState(false);
15
+ return /* @__PURE__ */ jsx(Fragment, { children: !userDetails ? /* @__PURE__ */ jsx(SignInButton, { className: "mb-2" }) : /* @__PURE__ */ jsxs("div", {
11
16
  className: "w-100 d-flex align-items-stretch mb-2",
12
- children: [/* @__PURE__ */ o(i, {
13
- buttonType: "Link",
14
- className: "w-100",
15
- children: /* @__PURE__ */ s(e, {
17
+ children: [
18
+ /* @__PURE__ */ jsx(ViewUserModal, {
19
+ buttonType: "Link",
16
20
  className: "w-100",
17
- small: !0,
21
+ children: /* @__PURE__ */ jsxs(ArticlesButton, {
22
+ className: "w-100",
23
+ small: true,
24
+ onClick: () => {
25
+ console.log("userDetails", userDetails);
26
+ },
27
+ children: [
28
+ /* @__PURE__ */ jsx("i", { className: "fad fa-sign-out" }),
29
+ "Logged in as ",
30
+ userDetails?.display_name || "Unknown User"
31
+ ]
32
+ })
33
+ }),
34
+ showFriendsModal && /* @__PURE__ */ jsx(FriendsList, {
35
+ show: showFriendsModal,
36
+ setShow: setShowFriendsModal,
37
+ componentType: "modal"
38
+ }),
39
+ friendsButton && /* @__PURE__ */ jsx(ArticlesButton, {
40
+ className: "",
41
+ small: true,
42
+ title: "My Friends",
18
43
  onClick: () => {
19
- console.log("userDetails", p);
44
+ setShowFriendsModal(true);
20
45
  },
21
- children: [
22
- /* @__PURE__ */ o("i", { className: "fad fa-sign-out" }),
23
- "Logged in as ",
24
- p?.display_name || "Unknown User"
25
- ]
46
+ children: /* @__PURE__ */ jsx("i", { className: "fad fa-users" })
47
+ }),
48
+ /* @__PURE__ */ jsx(ArticlesButton, {
49
+ className: "",
50
+ small: true,
51
+ title: "Sign out",
52
+ onClick: () => {
53
+ fetch(logoutLink, {
54
+ method: "GET",
55
+ headers: {}
56
+ }).then((response) => response.json()).then((data) => {
57
+ console.log("Logout successful:", data);
58
+ userTokenMutate(null);
59
+ userDetailsMutate(null);
60
+ }).catch((error) => {
61
+ console.error("Logout error:", error);
62
+ });
63
+ },
64
+ children: /* @__PURE__ */ jsx("i", { className: "fad fa-sign-out" })
26
65
  })
27
- }), /* @__PURE__ */ o(e, {
28
- className: "",
29
- small: !0,
30
- title: "Sign out",
31
- onClick: () => {
32
- fetch("/api/signout", {
33
- method: "GET",
34
- headers: {}
35
- }).then((e) => e.json()).then((e) => {
36
- console.log("Logout successful:", e), f(null), g(null);
37
- }).catch((e) => {
38
- console.error("Logout error:", e);
39
- });
40
- },
41
- children: /* @__PURE__ */ o("i", { className: "fad fa-sign-out" })
42
- })]
43
- }) : /* @__PURE__ */ o(t, { className: "mb-2" }) });
66
+ ]
67
+ }) });
44
68
  }
45
69
  //#endregion
46
- export { c as default };
70
+ export { SessionButton as default };