@opexa/portal-components 0.0.159 → 0.0.161

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.
@@ -1,15 +1,10 @@
1
1
  import type { FavoriteGame, Game, GameSession, Message } from '../../types';
2
- interface PopupStore {
2
+ export interface PopupStore {
3
3
  open: boolean;
4
4
  setOpen: (open: boolean) => void;
5
5
  '~touched': boolean;
6
6
  }
7
- interface CollapsibleStore {
8
- collapsed: boolean;
9
- setCollapsed: (collapsed: boolean) => void;
10
- '~touched': boolean;
11
- }
12
- type GameLaunchDetails = {
7
+ export type GameLaunchStore__Details = {
13
8
  status: 'WAITING';
14
9
  game?: null;
15
10
  session?: null;
@@ -26,28 +21,28 @@ type GameLaunchDetails = {
26
21
  game: Game | FavoriteGame;
27
22
  session?: null;
28
23
  };
29
- interface GameLaunchStore {
30
- details: GameLaunchDetails;
31
- setDetails: (details: GameLaunchDetails) => void;
24
+ export interface GameLaunchStore {
25
+ details: GameLaunchStore__Details;
26
+ setDetails: (details: GameLaunchStore__Details) => void;
32
27
  '~touched': boolean;
33
28
  }
34
- interface SearchStore extends PopupStore {
29
+ export interface SearchStore extends PopupStore {
35
30
  }
36
- type DepositWithdrawalTab = 'DEPOSIT' | 'WITHDRAWAL';
37
- type MessagesTab = 'ALL' | 'UNREAD';
38
- interface MessagesStore extends PopupStore {
39
- tab: MessagesTab;
40
- setTab: (tab: MessagesTab) => void;
31
+ export type MessagesStore__Tab = 'ALL' | 'UNREAD';
32
+ export interface MessagesStore extends PopupStore {
33
+ tab: MessagesStore__Tab;
34
+ setTab: (tab: MessagesStore__Tab) => void;
41
35
  }
42
- interface MessageStore extends PopupStore {
36
+ export interface MessageStore extends PopupStore {
43
37
  open: boolean;
44
38
  setOpen: (open: boolean) => void;
45
39
  data: Message | null;
46
40
  setData: (data: Message | null) => void;
47
41
  }
48
- interface DepositWithdrawalStore extends PopupStore {
49
- tab: DepositWithdrawalTab;
50
- setTab: (tab: DepositWithdrawalTab) => void;
42
+ export type DepositWithdrawalStore__Tab = 'DEPOSIT' | 'WITHDRAWAL';
43
+ export interface DepositWithdrawalStore extends PopupStore {
44
+ tab: DepositWithdrawalStore__Tab;
45
+ setTab: (tab: DepositWithdrawalStore__Tab) => void;
51
46
  promo: string | null;
52
47
  setPromo: (promo: string | null) => void;
53
48
  }
@@ -63,7 +58,8 @@ interface GlobalStore {
63
58
  account__mobile: PopupStore;
64
59
  messages: MessagesStore;
65
60
  message: MessageStore;
66
- sidebar: CollapsibleStore;
61
+ sidebar: PopupStore;
62
+ sidebar__mobile: PopupStore;
67
63
  kyc: PopupStore;
68
64
  spotBonus: PopupStore;
69
65
  }
@@ -196,12 +196,33 @@ export const useGlobalStore = create((set) => ({
196
196
  '~touched': false,
197
197
  },
198
198
  sidebar: {
199
- collapsed: false,
200
- setCollapsed(collapsed) {
199
+ open: true,
200
+ setOpen(open) {
201
+ set((prev) => ({
202
+ sidebar: {
203
+ ...prev.sidebar,
204
+ open,
205
+ '~touched': true,
206
+ },
207
+ sidebar__mobile: {
208
+ ...prev.sidebar__mobile,
209
+ '~touched': true,
210
+ },
211
+ }));
212
+ },
213
+ '~touched': false,
214
+ },
215
+ sidebar__mobile: {
216
+ open: false,
217
+ setOpen(open) {
201
218
  set((prev) => ({
219
+ sidebar__mobile: {
220
+ ...prev.sidebar__mobile,
221
+ open,
222
+ '~touched': true,
223
+ },
202
224
  sidebar: {
203
225
  ...prev.sidebar,
204
- collapsed,
205
226
  '~touched': true,
206
227
  },
207
228
  }));
@@ -1,8 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { getSession } from '../../server/services/getSession.js';
4
5
  import { prefetchBonusQuery } from '../../server/utils/prefetchBonusQuery.js';
5
6
  import { getBonus } from '../../services/wallet.js';
7
+ import { stripTags } from '../../utils/stripTags.js';
6
8
  import { Bonus__client } from './Bonus.client.js';
7
9
  async function fetchBonus(id) {
8
10
  const session = await getSession();
@@ -20,7 +22,7 @@ export async function Bonus(props) {
20
22
  prefetchBonusQuery(props.id),
21
23
  ]);
22
24
  if (result.status === 'fulfilled' && result.value) {
23
- return _jsx(Bonus__client, { ...props });
25
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "twitter:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Bonus__client, { ...props })] }));
24
26
  }
25
27
  else {
26
28
  return notFound();
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { prefetchCashbackQuery } from '../../server/utils/prefetchCashbackQuery.js';
4
5
  import { getCashback } from '../../services/wallet.js';
6
+ import { stripTags } from '../../utils/stripTags.js';
5
7
  import { Cashback__client } from './Cashback.client.js';
6
8
  export async function Cashback(props) {
7
9
  const [result] = await Promise.allSettled([
@@ -9,7 +11,7 @@ export async function Cashback(props) {
9
11
  prefetchCashbackQuery(props.id),
10
12
  ]);
11
13
  if (result.status === 'fulfilled' && result.value) {
12
- return _jsx(Cashback__client, { ...props });
14
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Cashback__client, { ...props })] }));
13
15
  }
14
16
  else {
15
17
  return notFound();
@@ -1,11 +1,13 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import Image from 'next/image';
4
4
  import Link from 'next/link';
5
+ import { DOMAIN } from '../../constants/index.js';
5
6
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
6
7
  import { Prose } from '../../ui/Prose/index.js';
8
+ import { stripTags } from '../../utils/stripTags.js';
7
9
  export function CustomPromo(props) {
8
- return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
9
- __html: props.promo.description,
10
- } })] }));
10
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
11
+ __html: props.promo.description,
12
+ } })] })] }));
11
13
  }
@@ -1,10 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
3
  import Link from 'next/link';
4
+ import { DOMAIN } from '../../constants/index.js';
4
5
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
5
6
  import { Prose } from '../../ui/Prose/index.js';
7
+ import { stripTags } from '../../utils/stripTags.js';
6
8
  export function News(props) {
7
- return (_jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
8
- __html: props.news.content,
9
- } })] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:title", content: props.news.title }), _jsx("meta", { name: "og:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:image", content: props.news.image }), _jsx("meta", { name: "twitter:title", content: props.news.title }), _jsx("meta", { name: "twitter:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "twitter:image", content: props.news.image }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
10
+ __html: props.news.content,
11
+ } })] })] }));
10
12
  }
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
+ import { DOMAIN } from '../../constants/index.js';
3
4
  import { prefetchPromoQuery } from '../../server/utils/prefetchPromoQuery.js';
4
5
  import { getPromo } from '../../services/wallet.js';
6
+ import { stripTags } from '../../utils/stripTags.js';
5
7
  import { Promo__client } from './Promo.client.js';
6
8
  export async function Promo(props) {
7
9
  const [result] = await Promise.allSettled([
@@ -9,7 +11,7 @@ export async function Promo(props) {
9
11
  prefetchPromoQuery(props.id),
10
12
  ]);
11
13
  if (result.status === 'fulfilled' && result.value) {
12
- return _jsx(Promo__client, { ...props });
14
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Promo__client, { ...props })] }));
13
15
  }
14
16
  else {
15
17
  return notFound();
@@ -0,0 +1 @@
1
+ export declare const stripTags: (html: string) => string;
@@ -0,0 +1,4 @@
1
+ import { cache } from 'react';
2
+ export const stripTags = cache((html) => {
3
+ return html.replace(/<[^>]+>/gi, '');
4
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.159",
3
+ "version": "0.0.161",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",
@@ -101,8 +101,8 @@
101
101
  "@hookform/resolvers": "5.1.1",
102
102
  "@opexa/object-id": "0.1.6",
103
103
  "@tailwindcss/postcss": "4",
104
- "@tanstack/react-query": "5.80.10",
105
- "@tanstack/react-query-devtools": "5.80.10",
104
+ "@tanstack/react-query": "5.81.2",
105
+ "@tanstack/react-query-devtools": "5.81.2",
106
106
  "@total-typescript/ts-reset": "0.6.1",
107
107
  "@types/lodash-es": "4.17.12",
108
108
  "@types/node": "24",