Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/9716 #38

Merged
merged 11 commits into from
Jan 18, 2024
30 changes: 30 additions & 0 deletions components/blueTags/BlueTagProduct.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useEffect } from "preact/hooks";

interface Props{
blueProductId: string;
}

const TagBlueProduct = ({ blueProductId }:Props) => {
useEffect(() => {
window.blue_q = window.blue_q || [];
window.blue_q.push(
{ event: "setCampaignId", value: "236D6DD2-E221-52CF-59E8647FC96917D8" },
{ event: "setProductId", value: blueProductId },
{ event: "setPageType", value: "product" }
);

const script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//event.getblue.io/js/blue-tag.min.js';
script.async = true;
document.head.appendChild(script);

return () => {
document.head.removeChild(script);
};
}, [blueProductId]);

return null;
};

export default TagBlueProduct;
35 changes: 35 additions & 0 deletions components/blueTags/BlueTagVisit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useEffect } from "preact/hooks";

declare global {
interface Window {
blue_q?: Array<{ event: string; value: string }>;
}
}

const BlueTagVisit = () => {
useEffect(() => {
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "//event.getblue.io/js/blue-tag.min.js";
script.async = true;
document.head.appendChild(script);

const eventData = [
{ event: "setCampaignId", value: "236D6DD2-E221-52CF-59E8647FC96917D8" },
{ event: "setPageType", value: "visit" },
];

window.blue_q = window.blue_q || [];
window.blue_q.push(...eventData);

console.log("tag visit");

eventData.forEach(({ event, value }) => {
window.blue_q!.push({ event, value });
});
}, []);

return null;
};

export default BlueTagVisit;
14 changes: 14 additions & 0 deletions components/product/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,20 @@ function ProductCard(
/>
</div>
)}
{/* Tag produto restrito*/}
{ProductWarning && (
<div
class={`flex justify-center absolute ${
positionBottom ?? `bottom-[10%]`
}`}
>
<TagWarning
width={tagWarningWidth}
height={tagWarningHeight}
style={`flex justify-center`}
/>
</div>
)}
</a>
{listPrice2 !== price2 && (
<DiscountBadge
Expand Down
6 changes: 6 additions & 0 deletions components/product/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { getShareLink } from "$store/sdk/shareLinks.tsx";
import { useVariantPossibilities } from "$store/sdk/useVariantPossiblities.ts";

import ProductAsideInfo from "deco-sites/hospitalar/components/product/ProductAsideInfo.tsx";
import TagBlueProduct from "deco-sites/hospitalar/components/blueTags/BlueTagProduct.tsx";

export type Variant = "front-back" | "slider" | "auto";

Expand Down Expand Up @@ -86,6 +87,7 @@ function ProductInfo(
isVariantOf,
url,
} = product;

const { price, listPrice, seller, availability, installment } = useOffer(
offers,
);
Expand Down Expand Up @@ -182,6 +184,10 @@ function ProductInfo(
</div>
)}

{/* Tag Blue Product */}

<TagBlueProduct blueProductId={productID} />

{/* Analytics Event */}
<SendEventOnLoad
event={{
Expand Down
4 changes: 4 additions & 0 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import * as $_app from "./routes/_app.tsx";
import * as $styles_css from "./routes/styles.css.ts";
import * as $AddToCartActions from "./islands/AddToCartActions.tsx";
import * as $AddToCartButton from "./islands/AddToCartButton.tsx";
import * as $BlueTagProduct from "./islands/BlueTagProduct.tsx";
import * as $BlueTagVisit from "./islands/BlueTagVisit.tsx";
import * as $Debug from "./islands/Debug.tsx";
import * as $HeaderButton from "./islands/HeaderButton.tsx";
import * as $HeaderModals from "./islands/HeaderModals.tsx";
Expand All @@ -32,6 +34,8 @@ const manifest = {
islands: {
"./islands/AddToCartActions.tsx": $AddToCartActions,
"./islands/AddToCartButton.tsx": $AddToCartButton,
"./islands/BlueTagProduct.tsx": $BlueTagProduct,
"./islands/BlueTagVisit.tsx": $BlueTagVisit,
"./islands/Debug.tsx": $Debug,
"./islands/HeaderButton.tsx": $HeaderButton,
"./islands/HeaderModals.tsx": $HeaderModals,
Expand Down
1 change: 1 addition & 0 deletions islands/BlueTagProduct.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '$store/components/blueTags/BlueTagProduct.tsx';
1 change: 1 addition & 0 deletions islands/BlueTagVisit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "$store/components/blueTags/BlueTagVisit.tsx";
166 changes: 84 additions & 82 deletions manifest.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,97 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $$$$$$0 from "./sections/Category/CategoryBanner.tsx";
import * as $$$$$$1 from "./sections/Category/CategoryBreadcrumb.tsx";
import * as $$$$$$2 from "./sections/Category/CategoryList.tsx";
import * as $$$$$$3 from "./sections/Category/CategoryText.tsx";
import * as $$$$$$4 from "./sections/Container.tsx";
import * as $$$$$$5 from "./sections/Content/Benefits.tsx";
import * as $$$$$$6 from "./sections/Content/CopyRight.tsx";
import * as $$$$$$7 from "./sections/Content/Faq.tsx";
import * as $$$$$$8 from "./sections/Content/InfoCard.tsx";
import * as $$$$$$9 from "./sections/Content/InfoCardSeo.tsx";
import * as $$$$$$10 from "./sections/Content/Logos.tsx";
import * as $$$$$$11 from "./sections/Content/Testimonials.tsx";
import * as $$$$$$12 from "./sections/DesignSystem/DesignSystem.tsx";
import * as $$$$$$13 from "./sections/Footer/Footer.tsx";
import * as $$$$$$14 from "./sections/Header/HeaderLayout.tsx";
import * as $$$$$$15 from "./sections/Header/HeaderNavMenu.tsx";
import * as $$$$$$16 from "./sections/Header/TopNavBar.tsx";
import * as $$$$$$17 from "./sections/Images/BannerGrid.tsx";
import * as $$$$$$18 from "./sections/Images/Carousel.tsx";
import * as $$$$$$19 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$20 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$21 from "./sections/Institutional/AccordionsContent.tsx";
import * as $$$$$$22 from "./sections/Institutional/AsideMenu.tsx";
import * as $$$$$$23 from "./sections/Institutional/CardsContent.tsx";
import * as $$$$$$24 from "./sections/Institutional/ContactForm.tsx";
import * as $$$$$$25 from "./sections/Institutional/InstitutionalPage.tsx";
import * as $$$$$$26 from "./sections/Institutional/TextContent.tsx";
import * as $$$$$$27 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$28 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$29 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$30 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$31 from "./sections/Miscellaneous/NotFound.tsx";
import * as $$$$$$32 from "./sections/Miscellaneous/ProxyIframe.tsx";
import * as $$$$$$33 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$34 from "./sections/Newsletter/NewsletterModal.tsx";
import * as $$$$$$35 from "./sections/Product/ProductDetails.tsx";
import * as $$$$$$36 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$37 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$38 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$39 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$40 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$0 from "./sections/BlueTags/BlueTagVisit.tsx";
import * as $$$$$$1 from "./sections/Category/CategoryBanner.tsx";
import * as $$$$$$2 from "./sections/Category/CategoryBreadcrumb.tsx";
import * as $$$$$$3 from "./sections/Category/CategoryList.tsx";
import * as $$$$$$4 from "./sections/Category/CategoryText.tsx";
import * as $$$$$$5 from "./sections/Container.tsx";
import * as $$$$$$6 from "./sections/Content/Benefits.tsx";
import * as $$$$$$7 from "./sections/Content/CopyRight.tsx";
import * as $$$$$$8 from "./sections/Content/Faq.tsx";
import * as $$$$$$9 from "./sections/Content/InfoCard.tsx";
import * as $$$$$$10 from "./sections/Content/InfoCardSeo.tsx";
import * as $$$$$$11 from "./sections/Content/Logos.tsx";
import * as $$$$$$12 from "./sections/Content/Testimonials.tsx";
import * as $$$$$$13 from "./sections/DesignSystem/DesignSystem.tsx";
import * as $$$$$$14 from "./sections/Footer/Footer.tsx";
import * as $$$$$$15 from "./sections/Header/HeaderLayout.tsx";
import * as $$$$$$16 from "./sections/Header/HeaderNavMenu.tsx";
import * as $$$$$$17 from "./sections/Header/TopNavBar.tsx";
import * as $$$$$$18 from "./sections/Images/BannerGrid.tsx";
import * as $$$$$$19 from "./sections/Images/Carousel.tsx";
import * as $$$$$$20 from "./sections/Images/ImageGallery.tsx";
import * as $$$$$$21 from "./sections/Images/ShoppableBanner.tsx";
import * as $$$$$$22 from "./sections/Institutional/AccordionsContent.tsx";
import * as $$$$$$23 from "./sections/Institutional/AsideMenu.tsx";
import * as $$$$$$24 from "./sections/Institutional/CardsContent.tsx";
import * as $$$$$$25 from "./sections/Institutional/ContactForm.tsx";
import * as $$$$$$26 from "./sections/Institutional/InstitutionalPage.tsx";
import * as $$$$$$27 from "./sections/Institutional/TextContent.tsx";
import * as $$$$$$28 from "./sections/Links/LinkTree.tsx";
import * as $$$$$$29 from "./sections/Links/Shortcuts.tsx";
import * as $$$$$$30 from "./sections/Miscellaneous/CampaignTimer.tsx";
import * as $$$$$$31 from "./sections/Miscellaneous/CookieConsent.tsx";
import * as $$$$$$32 from "./sections/Miscellaneous/NotFound.tsx";
import * as $$$$$$33 from "./sections/Miscellaneous/ProxyIframe.tsx";
import * as $$$$$$34 from "./sections/Newsletter/Newsletter.tsx";
import * as $$$$$$35 from "./sections/Newsletter/NewsletterModal.tsx";
import * as $$$$$$36 from "./sections/Product/ProductDetails.tsx";
import * as $$$$$$37 from "./sections/Product/ProductShelf.tsx";
import * as $$$$$$38 from "./sections/Product/SearchResult.tsx";
import * as $$$$$$39 from "./sections/Product/Wishlist.tsx";
import * as $$$$$$40 from "./sections/Social/InstagramPosts.tsx";
import * as $$$$$$41 from "./sections/Social/WhatsApp.tsx";
import * as $$$$$$$$$$$0 from "./apps/decohub.ts";
import * as $$$$$$$$$$$1 from "./apps/site.ts";

const manifest = {
"sections": {
"deco-sites/hospitalar/sections/Category/CategoryBanner.tsx": $$$$$$0,
"deco-sites/hospitalar/sections/Category/CategoryBreadcrumb.tsx": $$$$$$1,
"deco-sites/hospitalar/sections/Category/CategoryList.tsx": $$$$$$2,
"deco-sites/hospitalar/sections/Category/CategoryText.tsx": $$$$$$3,
"deco-sites/hospitalar/sections/Container.tsx": $$$$$$4,
"deco-sites/hospitalar/sections/Content/Benefits.tsx": $$$$$$5,
"deco-sites/hospitalar/sections/Content/CopyRight.tsx": $$$$$$6,
"deco-sites/hospitalar/sections/Content/Faq.tsx": $$$$$$7,
"deco-sites/hospitalar/sections/Content/InfoCard.tsx": $$$$$$8,
"deco-sites/hospitalar/sections/Content/InfoCardSeo.tsx": $$$$$$9,
"deco-sites/hospitalar/sections/Content/Logos.tsx": $$$$$$10,
"deco-sites/hospitalar/sections/Content/Testimonials.tsx": $$$$$$11,
"deco-sites/hospitalar/sections/DesignSystem/DesignSystem.tsx": $$$$$$12,
"deco-sites/hospitalar/sections/Footer/Footer.tsx": $$$$$$13,
"deco-sites/hospitalar/sections/Header/HeaderLayout.tsx": $$$$$$14,
"deco-sites/hospitalar/sections/Header/HeaderNavMenu.tsx": $$$$$$15,
"deco-sites/hospitalar/sections/Header/TopNavBar.tsx": $$$$$$16,
"deco-sites/hospitalar/sections/Images/BannerGrid.tsx": $$$$$$17,
"deco-sites/hospitalar/sections/Images/Carousel.tsx": $$$$$$18,
"deco-sites/hospitalar/sections/Images/ImageGallery.tsx": $$$$$$19,
"deco-sites/hospitalar/sections/Images/ShoppableBanner.tsx": $$$$$$20,
"deco-sites/hospitalar/sections/BlueTags/BlueTagVisit.tsx": $$$$$$0,
"deco-sites/hospitalar/sections/Category/CategoryBanner.tsx": $$$$$$1,
"deco-sites/hospitalar/sections/Category/CategoryBreadcrumb.tsx": $$$$$$2,
"deco-sites/hospitalar/sections/Category/CategoryList.tsx": $$$$$$3,
"deco-sites/hospitalar/sections/Category/CategoryText.tsx": $$$$$$4,
"deco-sites/hospitalar/sections/Container.tsx": $$$$$$5,
"deco-sites/hospitalar/sections/Content/Benefits.tsx": $$$$$$6,
"deco-sites/hospitalar/sections/Content/CopyRight.tsx": $$$$$$7,
"deco-sites/hospitalar/sections/Content/Faq.tsx": $$$$$$8,
"deco-sites/hospitalar/sections/Content/InfoCard.tsx": $$$$$$9,
"deco-sites/hospitalar/sections/Content/InfoCardSeo.tsx": $$$$$$10,
"deco-sites/hospitalar/sections/Content/Logos.tsx": $$$$$$11,
"deco-sites/hospitalar/sections/Content/Testimonials.tsx": $$$$$$12,
"deco-sites/hospitalar/sections/DesignSystem/DesignSystem.tsx": $$$$$$13,
"deco-sites/hospitalar/sections/Footer/Footer.tsx": $$$$$$14,
"deco-sites/hospitalar/sections/Header/HeaderLayout.tsx": $$$$$$15,
"deco-sites/hospitalar/sections/Header/HeaderNavMenu.tsx": $$$$$$16,
"deco-sites/hospitalar/sections/Header/TopNavBar.tsx": $$$$$$17,
"deco-sites/hospitalar/sections/Images/BannerGrid.tsx": $$$$$$18,
"deco-sites/hospitalar/sections/Images/Carousel.tsx": $$$$$$19,
"deco-sites/hospitalar/sections/Images/ImageGallery.tsx": $$$$$$20,
"deco-sites/hospitalar/sections/Images/ShoppableBanner.tsx": $$$$$$21,
"deco-sites/hospitalar/sections/Institutional/AccordionsContent.tsx":
$$$$$$21,
"deco-sites/hospitalar/sections/Institutional/AsideMenu.tsx": $$$$$$22,
"deco-sites/hospitalar/sections/Institutional/CardsContent.tsx": $$$$$$23,
"deco-sites/hospitalar/sections/Institutional/ContactForm.tsx": $$$$$$24,
$$$$$$22,
"deco-sites/hospitalar/sections/Institutional/AsideMenu.tsx": $$$$$$23,
"deco-sites/hospitalar/sections/Institutional/CardsContent.tsx": $$$$$$24,
"deco-sites/hospitalar/sections/Institutional/ContactForm.tsx": $$$$$$25,
"deco-sites/hospitalar/sections/Institutional/InstitutionalPage.tsx":
$$$$$$25,
"deco-sites/hospitalar/sections/Institutional/TextContent.tsx": $$$$$$26,
"deco-sites/hospitalar/sections/Links/LinkTree.tsx": $$$$$$27,
"deco-sites/hospitalar/sections/Links/Shortcuts.tsx": $$$$$$28,
"deco-sites/hospitalar/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$29,
"deco-sites/hospitalar/sections/Miscellaneous/CookieConsent.tsx": $$$$$$30,
"deco-sites/hospitalar/sections/Miscellaneous/NotFound.tsx": $$$$$$31,
"deco-sites/hospitalar/sections/Miscellaneous/ProxyIframe.tsx": $$$$$$32,
"deco-sites/hospitalar/sections/Newsletter/Newsletter.tsx": $$$$$$33,
"deco-sites/hospitalar/sections/Newsletter/NewsletterModal.tsx": $$$$$$34,
"deco-sites/hospitalar/sections/Product/ProductDetails.tsx": $$$$$$35,
"deco-sites/hospitalar/sections/Product/ProductShelf.tsx": $$$$$$36,
"deco-sites/hospitalar/sections/Product/SearchResult.tsx": $$$$$$37,
"deco-sites/hospitalar/sections/Product/Wishlist.tsx": $$$$$$38,
"deco-sites/hospitalar/sections/Social/InstagramPosts.tsx": $$$$$$39,
"deco-sites/hospitalar/sections/Social/WhatsApp.tsx": $$$$$$40,
$$$$$$26,
"deco-sites/hospitalar/sections/Institutional/TextContent.tsx": $$$$$$27,
"deco-sites/hospitalar/sections/Links/LinkTree.tsx": $$$$$$28,
"deco-sites/hospitalar/sections/Links/Shortcuts.tsx": $$$$$$29,
"deco-sites/hospitalar/sections/Miscellaneous/CampaignTimer.tsx": $$$$$$30,
"deco-sites/hospitalar/sections/Miscellaneous/CookieConsent.tsx": $$$$$$31,
"deco-sites/hospitalar/sections/Miscellaneous/NotFound.tsx": $$$$$$32,
"deco-sites/hospitalar/sections/Miscellaneous/ProxyIframe.tsx": $$$$$$33,
"deco-sites/hospitalar/sections/Newsletter/Newsletter.tsx": $$$$$$34,
"deco-sites/hospitalar/sections/Newsletter/NewsletterModal.tsx": $$$$$$35,
"deco-sites/hospitalar/sections/Product/ProductDetails.tsx": $$$$$$36,
"deco-sites/hospitalar/sections/Product/ProductShelf.tsx": $$$$$$37,
"deco-sites/hospitalar/sections/Product/SearchResult.tsx": $$$$$$38,
"deco-sites/hospitalar/sections/Product/Wishlist.tsx": $$$$$$39,
"deco-sites/hospitalar/sections/Social/InstagramPosts.tsx": $$$$$$40,
"deco-sites/hospitalar/sections/Social/WhatsApp.tsx": $$$$$$41,
},
"apps": {
"deco-sites/hospitalar/apps/decohub.ts": $$$$$$$$$$$0,
Expand Down
1 change: 1 addition & 0 deletions sections/BlueTags/BlueTagVisit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "$store/components/blueTags/BlueTagVisit.tsx";
5 changes: 4 additions & 1 deletion static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Disallow all crawlers access to certain pages.
User-agent: *

Allow: /
Expand All @@ -8,4 +9,6 @@ Disallow: /checkout/*
Disallow: /busca/*
Disallow: /quick-view/*
Disallow: /espiar/*
Noindex: /buscapagina/*
Noindex: /buscapagina/*

Sitemap: https://www.hospitalardistribuidora.com.br/sitemap.xml