@usequeek/theme-kit 0.5.3 → 0.5.4
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 +5 -3
- package/components/powered-by-queek.tsx +11 -5
- package/package.json +1 -1
- package/types/vendor.ts +4 -1
package/README.md
CHANGED
|
@@ -560,9 +560,11 @@ export default function Footer() {
|
|
|
560
560
|
(`utm_source=powered_by&utm_medium=storefront&utm_campaign=<store slug>`,
|
|
561
561
|
campaign omitted when the store has no slug); the component reads the slug
|
|
562
562
|
from the storefront context, so themes pass nothing.
|
|
563
|
-
-
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
- A merchant may hide the credit: the component hides itself when
|
|
564
|
+
`config.display.show_powered_by` is `false` (on by default, so a store that
|
|
565
|
+
never saved the setting shows it). A theme places `<PoweredByQueek />` and
|
|
566
|
+
reads nothing. `hidden` (default false) is the same switch from a prop. Neither
|
|
567
|
+
hides the cookie preferences button.
|
|
566
568
|
|
|
567
569
|
## Cookie consent
|
|
568
570
|
|
|
@@ -10,9 +10,10 @@ export interface PoweredByQueekProps {
|
|
|
10
10
|
/** Extra class so a footer can position the link — styling stays theme-owned. */
|
|
11
11
|
className?: string;
|
|
12
12
|
/**
|
|
13
|
-
* Lets a caller hide the attribution link from a prop. Defaults to false
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Lets a caller hide the attribution link from a prop. Defaults to false. The
|
|
14
|
+
* store's own switch (`config.display.show_powered_by`, on by default) hides it
|
|
15
|
+
* the same way, so a theme passes nothing for it. Neither hides the cookie
|
|
16
|
+
* preferences link, which is not attribution.
|
|
16
17
|
*/
|
|
17
18
|
hidden?: boolean;
|
|
18
19
|
}
|
|
@@ -21,6 +22,10 @@ export interface PoweredByQueekProps {
|
|
|
21
22
|
* The storefront attribution link, owned by the kit: themes import and place
|
|
22
23
|
* it, and never re-implement it.
|
|
23
24
|
*
|
|
25
|
+
* A merchant may hide the credit (Display, "Show Powered by Queek"): it is on
|
|
26
|
+
* unless `config.display.show_powered_by` is `false`, so a store that never
|
|
27
|
+
* saved the setting, or a payload without it, shows the credit.
|
|
28
|
+
*
|
|
24
29
|
* Required on every footer variant of every theme (enforced by the
|
|
25
30
|
* `theme/footer-shows-powered-by` rule of `npm run check`). The link
|
|
26
31
|
* target (`https://usequeek.com/business`) and `rel` are the contract —
|
|
@@ -42,9 +47,10 @@ export interface PoweredByQueekProps {
|
|
|
42
47
|
* look).
|
|
43
48
|
*/
|
|
44
49
|
export function PoweredByQueek({ className, hidden = false }: PoweredByQueekProps): JSX.Element | null {
|
|
45
|
-
const
|
|
50
|
+
const store = useContext(StorefrontContext);
|
|
51
|
+
const vendor = store?.vendor;
|
|
46
52
|
|
|
47
|
-
if (hidden) return <ConsentPreferencesLink />;
|
|
53
|
+
if (hidden || store?.config?.display?.show_powered_by === false) return <ConsentPreferencesLink />;
|
|
48
54
|
|
|
49
55
|
return (
|
|
50
56
|
<span className="core-powered-by-group">
|
package/package.json
CHANGED
package/types/vendor.ts
CHANGED
|
@@ -192,10 +192,13 @@ export interface StorefrontConfig {
|
|
|
192
192
|
/**
|
|
193
193
|
* Store-wide display choices every theme honours. `show_product_counts` (default false): a theme
|
|
194
194
|
* prints a product count ("6 products") only when the store turns it on; read it through
|
|
195
|
-
* `useProductCount()`, never from here.
|
|
195
|
+
* `useProductCount()`, never from here. `show_powered_by` (default true): the footer
|
|
196
|
+
* "Powered by Queek" credit; `PoweredByQueek` hides it when this is `false`, so a theme
|
|
197
|
+
* places the component and reads nothing from here.
|
|
196
198
|
*/
|
|
197
199
|
display?: {
|
|
198
200
|
show_product_counts?: boolean;
|
|
201
|
+
show_powered_by?: boolean;
|
|
199
202
|
};
|
|
200
203
|
/** Resolved semantic design tokens. Absent for stores that have none. */
|
|
201
204
|
tokens?: DesignTokens | null;
|