Skip to content

Commit

Permalink
style: auto format files
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-vasconcellos committed Nov 2, 2023
1 parent 0d40982 commit 7b546bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
3 changes: 0 additions & 3 deletions adaptio-shelves/components/shelves/HighlightShelf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Header from "../../components/ui/SectionHeader.tsx";
import Slider from "../../components/ui/Slider.tsx";
import SliderJS from "../../islands/SliderJS.tsx";
import { useId } from "../../sdk/useId.ts";
import { usePlatform } from "../../sdk/usePlatform.tsx";
import type { Product } from "../../../commerce/types.ts";
import { Section } from "deco/blocks/section.ts";
import { renderSection } from "../../../website/pages/Page.tsx";
Expand All @@ -27,7 +26,6 @@ function HighlightShelf({
cardSection,
}: Props) {
const id = useId();
const platform = usePlatform();

if (!products || products.length === 0) {
return null;
Expand Down Expand Up @@ -60,7 +58,6 @@ function HighlightShelf({
...cardSection.props,
product,
itemListName: title,
platform,
index,
},
})}
Expand Down
11 changes: 6 additions & 5 deletions adaptio-shelves/sdk/useOffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {

const bestInstallment = (
acc: UnitPriceSpecification | null,
curr: UnitPriceSpecification
curr: UnitPriceSpecification,
) => {
if (curr.priceComponentType !== "https://schema.org/Installment") {
return acc;
Expand Down Expand Up @@ -36,7 +36,7 @@ const bestInstallment = (

const installmentToString = (
installment: UnitPriceSpecification,
sellingPrice: number
sellingPrice: number,
) => {
const { billingDuration, billingIncrement, price } = installment;

Expand All @@ -54,7 +54,7 @@ const installmentToString = (
export const useOffer = (aggregateOffer?: AggregateOffer) => {
const offer = aggregateOffer?.offers[0];
const listPrice = offer?.priceSpecification.find(
(spec) => spec.priceType === "https://schema.org/ListPrice"
(spec) => spec.priceType === "https://schema.org/ListPrice",
);
const installment = offer?.priceSpecification.reduce(bestInstallment, null);
const seller = offer?.seller;
Expand All @@ -66,7 +66,8 @@ export const useOffer = (aggregateOffer?: AggregateOffer) => {
listPrice: listPrice?.price,
availability,
seller,
installments:
installment && price ? installmentToString(installment, price) : null,
installments: installment && price
? installmentToString(installment, price)
: null,
};
};
10 changes: 0 additions & 10 deletions adaptio-shelves/sdk/usePlatform.tsx

This file was deleted.

0 comments on commit 7b546bb

Please sign in to comment.