@qobo/banner 1.0.5 → 1.0.6
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/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/QoboBanner.jsx +2 -2
package/dist/index.cjs
CHANGED
|
@@ -27,4 +27,4 @@ Check the top-level render call using <`+t+">.")}return r}}function me(e,r){{if(
|
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,H,S,lr,S),Te[S+H]=!0}}return e===E?ar(l):nr(l),l}}function or(e,r,t){return we(e,r,t,!0)}function ir(e,r,t){return we(e,r,t,!1)}var sr=ir,ur=or;Y.Fragment=E,Y.jsx=sr,Y.jsxs=ur}()),Y}process.env.NODE_ENV==="production"?Z.exports=cr():Z.exports=dr();var F=Z.exports;function Oe({apiKey:O,apiBaseUrl:_}){const[A,E]=V.useState(!
|
|
30
|
+
<%s key={someKey} {...props} />`,H,S,lr,S),Te[S+H]=!0}}return e===E?ar(l):nr(l),l}}function or(e,r,t){return we(e,r,t,!0)}function ir(e,r,t){return we(e,r,t,!1)}var sr=ir,ur=or;Y.Fragment=E,Y.jsx=sr,Y.jsxs=ur}()),Y}process.env.NODE_ENV==="production"?Z.exports=cr():Z.exports=dr();var F=Z.exports;function Oe({apiKey:O,apiBaseUrl:_}){const[A,E]=V.useState(!1),[P,m]=V.useState(!0),R=50;return V.useEffect(()=>{(async()=>{var f;try{const b=O||void 0||void 0,c=_||void 0||void 0||"https://api.qobo.dev";if(!b){console.warn("[QoboBanner] API key not set (pass apiKey prop or set VITE_API_KEY), defaulting to visible"),m(!1);return}const h=await fetch(`${c}/api/v1/show-banner`,{method:"GET",headers:{"Content-Type":"application/json","X-API-Key":b},cache:"no-store"});if(!h.ok){console.warn(`[QoboBanner] Failed to fetch banner visibility (${h.status}), defaulting to visible`),m(!1);return}const y=await h.json(),D=(y.showBanner??((f=y.data)==null?void 0:f.showBanner)??"true")==="true";E(D),console.log(`[QoboBanner] Banner visibility: ${D}`)}catch(b){console.warn("[QoboBanner] Error fetching banner visibility, defaulting to visible:",b.message),E(!0)}finally{m(!1)}})()},[O,_]),!A&&!P?null:F.jsxs(F.Fragment,{children:[F.jsx("div",{"aria-hidden":"true",style:{height:`${R}px`,width:"100%"}}),F.jsxs("div",{className:"w-full bg-gradient-to-r from-cyan-400 to-blue-500 text-white py-2 px-4 text-center text-sm font-medium shadow-md",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,height:`${R}px`,background:"linear-gradient(90deg, #FF7A2F 0%, #46C6B9 100%)",color:"#F1F5F9",padding:"12px 16px",textAlign:"center",fontSize:"0.95rem",fontWeight:"600",letterSpacing:"0.01em",fontFamily:'"Inter", "Segoe UI", system-ui, -apple-system, sans-serif',boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)",transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center"},children:["Made with"," ",F.jsx("span",{style:{color:"#FF1744",display:"inline-block",margin:"0 0.35rem"},children:"❤️"})," ","by "," ",F.jsx("a",{href:"https://qobo.dev",target:"_blank",rel:"noopener noreferrer",style:{color:"#F1F5F9",textDecoration:"underline",fontWeight:"700",cursor:"pointer"},className:"hover:text-cyan-100 transition-colors",children:"qobo.dev"})]})]})}exports.QoboBanner=Oe;exports.default=Oe;
|
package/dist/index.js
CHANGED
|
@@ -626,7 +626,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
626
626
|
process.env.NODE_ENV === "production" ? Q.exports = dr() : Q.exports = vr();
|
|
627
627
|
var F = Q.exports;
|
|
628
628
|
function hr({ apiKey: O, apiBaseUrl: _ }) {
|
|
629
|
-
const [A, E] = Te(!
|
|
629
|
+
const [A, E] = Te(!1), [P, m] = Te(!0), R = 50;
|
|
630
630
|
return cr(() => {
|
|
631
631
|
(async () => {
|
|
632
632
|
var f;
|
|
@@ -698,7 +698,7 @@ function hr({ apiKey: O, apiBaseUrl: _ }) {
|
|
|
698
698
|
}
|
|
699
699
|
),
|
|
700
700
|
" ",
|
|
701
|
-
"by",
|
|
701
|
+
"by ",
|
|
702
702
|
" ",
|
|
703
703
|
/* @__PURE__ */ F.jsx(
|
|
704
704
|
"a",
|
package/package.json
CHANGED
package/src/QoboBanner.jsx
CHANGED
|
@@ -14,7 +14,7 @@ import React, { useState, useEffect } from 'react';
|
|
|
14
14
|
* - Has consistent styling across all projects
|
|
15
15
|
*/
|
|
16
16
|
export function QoboBanner({ apiKey, apiBaseUrl }) {
|
|
17
|
-
const [isVisible, setIsVisible] = useState(
|
|
17
|
+
const [isVisible, setIsVisible] = useState(false); // Default to visible to prevent layout shift
|
|
18
18
|
const [isLoading, setIsLoading] = useState(true);
|
|
19
19
|
const BANNER_HEIGHT = 50;
|
|
20
20
|
|
|
@@ -105,7 +105,7 @@ export function QoboBanner({ apiKey, apiBaseUrl }) {
|
|
|
105
105
|
>
|
|
106
106
|
❤️
|
|
107
107
|
</span>{' '}
|
|
108
|
-
by{' '}
|
|
108
|
+
by {' '}
|
|
109
109
|
<a
|
|
110
110
|
href="https://qobo.dev"
|
|
111
111
|
target="_blank"
|