Skip to content

Commit

Permalink
Revert "feat: Wap Components (#144)"
Browse files Browse the repository at this point in the history
This reverts commit 85e4d38.
  • Loading branch information
guitavano authored Mar 7, 2024
1 parent 85e4d38 commit 456b040
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 285 deletions.
9 changes: 3 additions & 6 deletions apps/site.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import commerce, { Props as CommerceProps } from "apps/commerce/mod.ts";
import { color as wap } from "apps/wap/mod.ts";
import { color as shopify } from "apps/shopify/mod.ts";
import { color as vnda } from "apps/vnda/mod.ts";
import { color as vtex } from "apps/vtex/mod.ts";
import { color as wake } from "apps/wake/mod.ts";
import { color as linx } from "apps/linx/mod.ts";
import { color as shopify } from "apps/shopify/mod.ts";
import { color as nuvemshop } from "apps/nuvemshop/mod.ts";
import { Section } from "deco/blocks/section.ts";
import type { App as A, AppContext as AC } from "deco/mod.ts";
Expand All @@ -26,7 +25,6 @@ export type Platform =
| "vnda"
| "shopify"
| "wake"
| "wap"
| "linx"
| "nuvemshop"
| "custom";
Expand All @@ -46,8 +44,6 @@ const color = (platform: string) => {
return wake;
case "shopify":
return shopify;
case "wap":
return wap;
case "linx":
return linx;
case "nuvemshop":
Expand All @@ -70,7 +66,8 @@ export default function Site(
if (firstRun) {
firstRun = false;
console.info(
` 🐁 ${rgb24("Storefront", color("deco"))} | ${rgb24(_platform, color(_platform))
` 🐁 ${rgb24("Storefront", color("deco"))} | ${
rgb24(_platform, color(_platform))
} \n`,
);
}
Expand Down
20 changes: 0 additions & 20 deletions components/header/Buttons/Cart/wap.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions components/header/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import CartButtonShopify from "$store/islands/Header/Cart/shopify.tsx";
import CartButtonVDNA from "$store/islands/Header/Cart/vnda.tsx";
import CartButtonVTEX from "$store/islands/Header/Cart/vtex.tsx";
import CartButtonWake from "$store/islands/Header/Cart/wake.tsx";
import CartButtonWap from "$store/islands/Header/Cart/wap.tsx";
import CartButtonNuvemshop from "$store/islands/Header/Cart/nuvemshop.tsx";
import Searchbar from "$store/islands/Header/Searchbar.tsx";
import { usePlatform } from "$store/sdk/usePlatform.tsx";
Expand All @@ -16,7 +15,6 @@ import NavItem from "./NavItem.tsx";
import { navbarHeight } from "./constants.ts";
import { Buttons, Logo } from "$store/components/header/Header.tsx";


// Make it sure to render it on the server only. DO NOT render it on an island
function Navbar(
{ items, searchbar, logo, buttons, logoPosition = "left", device }: {
Expand Down Expand Up @@ -62,13 +60,11 @@ function Navbar(
{platform === "linx" && <CartButtonLinx />}
{platform === "shopify" && <CartButtonShopify />}
{platform === "nuvemshop" && <CartButtonNuvemshop />}
{platform === "wap" && <CartButtonWap />}
</div>
</div>
);
}


// Desktop header
return (
<div class="hidden sm:grid sm:grid-cols-3 items-center border-b border-base-200 w-full px-6">
Expand Down Expand Up @@ -129,7 +125,6 @@ function Navbar(
class="flex btn btn-circle btn-sm btn-ghost gap-1"
aria-label="Wishlist"
>

<Icon id="Heart" size={24} strokeWidth={0.4} />
</button>
WISHLIST
Expand All @@ -143,7 +138,6 @@ function Navbar(
{platform === "linx" && <CartButtonLinx />}
{platform === "shopify" && <CartButtonShopify />}
{platform === "nuvemshop" && <CartButtonNuvemshop />}
{platform === "wap" && <CartButtonWap />}
</div>
)}
</div>
Expand Down
5 changes: 0 additions & 5 deletions components/minicart/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const CartWake = lazy(() => import("./wake/Cart.tsx"));
const CartLinx = lazy(() => import("./linx/Cart.tsx"));
const CartShopify = lazy(() => import("./shopify/Cart.tsx"));
const CartNuvemshop = lazy(() => import("./nuvemshop/Cart.tsx"));
const CartWap = lazy(() => import("./wap/Cart.tsx"));

export interface Props {
platform: ReturnType<typeof usePlatform>;
Expand All @@ -27,10 +26,6 @@ function Cart({ platform }: Props) {
return <CartWake />;
}

if (platform === "wap") {
return <CartWap />;
}

if (platform === "linx") {
return <CartLinx />;
}
Expand Down
59 changes: 0 additions & 59 deletions components/minicart/wap/Cart.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions components/product/AddToCartButton/wap.tsx

This file was deleted.

116 changes: 48 additions & 68 deletions components/product/ProductInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import AddToCartButtonShopify from "$store/islands/AddToCartButton/shopify.tsx";
import AddToCartButtonVNDA from "$store/islands/AddToCartButton/vnda.tsx";
import AddToCartButtonVTEX from "$store/islands/AddToCartButton/vtex.tsx";
import AddToCartButtonWake from "$store/islands/AddToCartButton/wake.tsx";
import AddToCartButtonWap from "$store/islands/AddToCartButton/wap.tsx";
import AddToCartButtonNuvemshop from "$store/islands/AddToCartButton/nuvemshop.tsx";
import OutOfStock from "$store/islands/OutOfStock.tsx";
import ShippingSimulation from "$store/islands/ShippingSimulation.tsx";
import WishlistButtonVtex from "../../islands/WishlistButton/vtex.tsx";
import WishlistButtonWake from "../../islands/WishlistButton/wake.tsx";
import WishlistButtonWap from "../../islands/WishlistButton/wap.tsx";
import { formatPrice } from "$store/sdk/format.ts";
import { useId } from "$store/sdk/useId.ts";
import { useOffer } from "$store/sdk/useOffer.ts";
Expand Down Expand Up @@ -71,10 +69,6 @@ function ProductInfo({ page, layout }: Props) {
listPrice,
});

const attributoSimples = product.additionalProperty?.find(
(p) => p.valueReference === "ATRIBUTO SIMPLES"
);

return (
<div class="flex flex-col" id={id}>
<Breadcrumb itemListElement={breadcrumb.itemListElement} />
Expand Down Expand Up @@ -113,80 +107,66 @@ function ProductInfo({ page, layout }: Props) {
</div>
{/* Add to Cart and Favorites button */}
<div class="mt-4 sm:mt-10 flex flex-col gap-2">
{availability === "https://schema.org/InStock" ? (
<>
{platform === "vtex" && (
<>
<AddToCartButtonVTEX
{availability === "https://schema.org/InStock"
? (
<>
{platform === "vtex" && (
<>
<AddToCartButtonVTEX
eventParams={{ items: [eventItem] }}
productID={productID}
seller={seller}
/>
<WishlistButtonVtex
variant="full"
productID={productID}
productGroupID={productGroupID}
/>
</>
)}
{platform === "wake" && (
<>
<AddToCartButtonWake
eventParams={{ items: [eventItem] }}
productID={productID}
/>
<WishlistButtonWake
variant="full"
productID={productID}
productGroupID={productGroupID}
/>
</>
)}
{platform === "linx" && (
<AddToCartButtonLinx
eventParams={{ items: [eventItem] }}
productID={productID}
seller={seller}
/>
<WishlistButtonVtex
variant="full"
productID={productID}
productGroupID={productGroupID}
/>
</>
)}
{platform === "wake" && (
<>
<AddToCartButtonWake
)}
{platform === "vnda" && (
<AddToCartButtonVNDA
eventParams={{ items: [eventItem] }}
productID={productID}
additionalProperty={additionalProperty}
/>
<WishlistButtonWake
variant="full"
productID={productID}
productGroupID={productGroupID}
/>
</>
)}
{platform === "wap" && (
<>
<AddToCartButtonWap
)}
{platform === "shopify" && (
<AddToCartButtonShopify
eventParams={{ items: [eventItem] }}
productID={productID}
idAtributoSimples={Number(attributoSimples?.propertyID || 0)}
/>
<WishlistButtonWap
variant="full"
productID={productID}
)}
{platform === "nuvemshop" && (
<AddToCartButtonNuvemshop
productGroupID={productGroupID}
eventParams={{ items: [eventItem] }}
additionalProperty={additionalProperty}
/>
</>
)}
{platform === "linx" && (
<AddToCartButtonLinx
eventParams={{ items: [eventItem] }}
productID={productID}
productGroupID={productGroupID}
/>
)}
{platform === "vnda" && (
<AddToCartButtonVNDA
eventParams={{ items: [eventItem] }}
productID={productID}
additionalProperty={additionalProperty}
/>
)}
{platform === "shopify" && (
<AddToCartButtonShopify
eventParams={{ items: [eventItem] }}
productID={productID}
/>
)}
{platform === "nuvemshop" && (
<AddToCartButtonNuvemshop
productGroupID={productGroupID}
eventParams={{ items: [eventItem] }}
additionalProperty={additionalProperty}
/>
)}
</>
) : (
<OutOfStock productID={productID} />
)}
)}
</>
)
: <OutOfStock productID={productID} />}
</div>
{/* Shipping Simulation */}
<div class="mt-8">
Expand Down
Loading

0 comments on commit 456b040

Please sign in to comment.