@greatapps/common 1.1.238 → 1.1.239
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.
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useAppNavigationContext } from "../AppNavigationContext";
|
|
4
4
|
import { Progress } from "../../../index";
|
|
5
|
+
import { useBuyCreditsModal } from "../../../store/useBuyCreditsModal";
|
|
5
6
|
function CreditsCard({ used, total, onClick }) {
|
|
6
7
|
const { breakpoint } = useAppNavigationContext();
|
|
8
|
+
const { openModal } = useBuyCreditsModal();
|
|
9
|
+
const handleClick = onClick ?? (() => openModal());
|
|
7
10
|
if (breakpoint !== "mobile") return null;
|
|
8
11
|
return /* @__PURE__ */ jsxs(
|
|
9
12
|
"div",
|
|
10
13
|
{
|
|
11
|
-
className:
|
|
12
|
-
onClick,
|
|
14
|
+
className: "flex flex-col bg-gray-950 rounded-lg gap-4 w-full px-4 pt-4 pb-[18px] cursor-pointer",
|
|
15
|
+
onClick: handleClick,
|
|
13
16
|
children: [
|
|
14
17
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
15
18
|
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-semibold text-white", children: "Cr\xE9ditos usados" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/navigation/subcomponents/CreditsCard.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useAppNavigationContext } from '../AppNavigationContext';\r\nimport { Progress } from '../../../index';\r\n\r\nexport interface CreditsCardProps {\r\n used: number;\r\n total: number;\r\n onClick?: () => void;\r\n}\r\n\r\nexport function CreditsCard({ used, total, onClick }: CreditsCardProps) {\r\n const { breakpoint } = useAppNavigationContext();\r\n\r\n // Only renders in mobile overlay\r\n if (breakpoint !== 'mobile') return null;\r\n\r\n return (\r\n <div\r\n className
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/navigation/subcomponents/CreditsCard.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useAppNavigationContext } from '../AppNavigationContext';\r\nimport { Progress } from '../../../index';\r\nimport { useBuyCreditsModal } from '../../../store/useBuyCreditsModal';\r\n\r\nexport interface CreditsCardProps {\r\n used: number;\r\n total: number;\r\n onClick?: () => void;\r\n}\r\n\r\nexport function CreditsCard({ used, total, onClick }: CreditsCardProps) {\r\n const { breakpoint } = useAppNavigationContext();\r\n const { openModal } = useBuyCreditsModal();\r\n const handleClick = onClick ?? (() => openModal());\r\n\r\n // Only renders in mobile overlay\r\n if (breakpoint !== 'mobile') return null;\r\n\r\n return (\r\n <div\r\n className=\"flex flex-col bg-gray-950 rounded-lg gap-4 w-full px-4 pt-4 pb-[18px] cursor-pointer\"\r\n onClick={handleClick}\r\n >\r\n <div className=\"flex items-center justify-between\">\r\n <span className=\"paragraph-xsmall-semibold text-white\">Créditos usados</span>\r\n <span className=\"paragraph-xsmall-medium text-white/50\">{used} / {total}</span>\r\n </div>\r\n <Progress className=\"bg-white/10 h-[6px]\" indicatorColor=\"bg-white\" value={Math.round((used / total) * 100)} />\r\n </div>\r\n );\r\n}\r\n"],"mappings":";AA0BQ,cACA,YADA;AAxBR,SAAS,+BAA+B;AACxC,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AAQ5B,SAAS,YAAY,EAAE,MAAM,OAAO,QAAQ,GAAqB;AACtE,QAAM,EAAE,WAAW,IAAI,wBAAwB;AAC/C,QAAM,EAAE,UAAU,IAAI,mBAAmB;AACzC,QAAM,cAAc,YAAY,MAAM,UAAU;AAGhD,MAAI,eAAe,SAAU,QAAO;AAEpC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,SAAS;AAAA,MAET;AAAA,6BAAC,SAAI,WAAU,qCACb;AAAA,8BAAC,UAAK,WAAU,wCAAuC,gCAAe;AAAA,UACtE,qBAAC,UAAK,WAAU,yCAAyC;AAAA;AAAA,YAAK;AAAA,YAAI;AAAA,aAAM;AAAA,WAC1E;AAAA,QACA,oBAAC,YAAS,WAAU,uBAAsB,gBAAe,YAAW,OAAO,KAAK,MAAO,OAAO,QAAS,GAAG,GAAG;AAAA;AAAA;AAAA,EAC/G;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useAppNavigationContext } from '../AppNavigationContext';
|
|
4
4
|
import { Progress } from '../../../index';
|
|
5
|
+
import { useBuyCreditsModal } from '../../../store/useBuyCreditsModal';
|
|
5
6
|
|
|
6
7
|
export interface CreditsCardProps {
|
|
7
8
|
used: number;
|
|
@@ -11,14 +12,16 @@ export interface CreditsCardProps {
|
|
|
11
12
|
|
|
12
13
|
export function CreditsCard({ used, total, onClick }: CreditsCardProps) {
|
|
13
14
|
const { breakpoint } = useAppNavigationContext();
|
|
15
|
+
const { openModal } = useBuyCreditsModal();
|
|
16
|
+
const handleClick = onClick ?? (() => openModal());
|
|
14
17
|
|
|
15
18
|
// Only renders in mobile overlay
|
|
16
19
|
if (breakpoint !== 'mobile') return null;
|
|
17
20
|
|
|
18
21
|
return (
|
|
19
22
|
<div
|
|
20
|
-
className=
|
|
21
|
-
onClick={
|
|
23
|
+
className="flex flex-col bg-gray-950 rounded-lg gap-4 w-full px-4 pt-4 pb-[18px] cursor-pointer"
|
|
24
|
+
onClick={handleClick}
|
|
22
25
|
>
|
|
23
26
|
<div className="flex items-center justify-between">
|
|
24
27
|
<span className="paragraph-xsmall-semibold text-white">Créditos usados</span>
|