Skip to content

Commit

Permalink
Fix duplicated names (Shopify#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel authored and juanpprieto committed Nov 30, 2022
1 parent bfcac4b commit 573fad6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions templates/demo-store/app/components/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {flattenConnection, Image, Money} from '@shopify/hydrogen-react';
import {Button, Heading, IconRemove, Text, Link} from '~/components';
import {getInputStyleClasses} from '~/lib/utils';
import type {
Cart,
Cart as CartType,
CartCost,
CartLine,
} from '@shopify/hydrogen-react/storefront-api-types';
Expand Down Expand Up @@ -38,7 +38,7 @@ export function Cart({
}: {
layout: Layouts;
onClose?: () => void;
cart: Cart | null;
cart: CartType | null;
}) {
const linesCount = cart?.lines?.edges?.length || 0;
const {linesAdding} = useCartLinesAdding();
Expand All @@ -64,7 +64,7 @@ export function CartDetails({
cart,
}: {
layout: Layouts;
cart: Cart | null;
cart: CartType | null;
}) {
// @todo: get optimistic cart cost
const isZeroCost = !cart || cart?.cost?.subtotalAmount?.amount === '0.0';
Expand Down Expand Up @@ -95,7 +95,7 @@ export function CartDetails({
function CartDiscounts({
discountCodes,
}: {
discountCodes: Cart['discountCodes'];
discountCodes: CartType['discountCodes'];
}) {
const {discountCodesUpdating} = useCartDiscountCodesUpdating();
const [hovered, setHovered] = useState(false);
Expand Down Expand Up @@ -165,7 +165,7 @@ function CartLines({
lines: cartLines,
}: {
layout: Layouts;
lines: Cart['lines'] | undefined;
lines: CartType['lines'] | undefined;
}) {
const currentLines = cartLines ? flattenConnection(cartLines) : [];
const {optimisticLinesNew} = useOptimisticCartLinesAdding(currentLines);
Expand Down
12 changes: 6 additions & 6 deletions templates/demo-store/app/routes/products/$productHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {
import {getExcerpt, variantToCartLine} from '~/lib/utils';
import invariant from 'tiny-invariant';
import clsx from 'clsx';
import {
import type {
ProductVariant,
SelectedOptionInput,
Product,
Product as ProductType,
Shop,
ProductConnection,
} from '@shopify/hydrogen-react/storefront-api-types';
Expand All @@ -55,7 +55,7 @@ export async function loader({
});

const {shop, product} = await storefront.query<{
product: Product & {selectedVariant?: ProductVariant};
product: ProductType & {selectedVariant?: ProductVariant};
shop: Shop;
}>(PRODUCT_QUERY, {
variables: {
Expand Down Expand Up @@ -215,7 +215,7 @@ function ProductOptions({
options,
searchParamsWithDefaults,
}: {
options: Product['options'];
options: ProductType['options'];
searchParamsWithDefaults: URLSearchParams;
}) {
const closeRef = useRef<HTMLButtonElement>(null);
Expand Down Expand Up @@ -572,7 +572,7 @@ async function getRecommendedProducts(
productId: string,
) {
const products = await storefront.query<{
recommended: Product[];
recommended: ProductType[];
additional: ProductConnection;
}>(RECOMMENDED_PRODUCTS_QUERY, {
variables: {productId, count: 12},
Expand All @@ -588,7 +588,7 @@ async function getRecommendedProducts(
);

const originalProduct = mergedProducts
.map((item: Product) => item.id)
.map((item: ProductType) => item.id)
.indexOf(productId);

mergedProducts.splice(originalProduct, 1);
Expand Down

0 comments on commit 573fad6

Please sign in to comment.