revert lib/utils refactoring

This commit is contained in:
tedraykov
2024-06-20 14:59:27 +03:00
parent f90da11e31
commit b47f13e2d8
20 changed files with 108 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
import { ChevronRightIcon, EllipsisHorizontalIcon } from '@heroicons/react/16/solid';
import { cn } from 'lib/shopify/utils';
import { cn } from 'lib/utils';
import Link, { LinkProps } from 'next/link';
import { ComponentPropsWithoutRef, ReactNode, forwardRef } from 'react';

View File

@@ -8,7 +8,7 @@ import {
BreadcrumbPage,
BreadcrumbSeparator
} from './breadcrumb-list';
import { findParentCollection } from 'lib/shopify/utils';
import { findParentCollection } from 'lib/utils';
type BreadcrumbProps = {
type: 'product' | 'collection';

View File

@@ -2,7 +2,7 @@ import { PlusIcon } from '@heroicons/react/16/solid';
import Price from 'components/price';
import { DEFAULT_OPTION } from 'lib/constants';
import { CartItem } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import Image from 'next/image';
import Link from 'next/link';
import { DeleteItemButton } from './delete-item-button';

View File

@@ -2,7 +2,7 @@
import { CheckIcon } from '@heroicons/react/24/outline';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { cn } from 'lib/shopify/utils';
import { cn } from 'lib/utils';
import { forwardRef } from 'react';
const Checkbox = forwardRef<

View File

@@ -3,7 +3,7 @@
import { Button } from '@headlessui/react';
import { MAKE_FILTER_ID, MODEL_FILTER_ID, PART_TYPES, YEAR_FILTER_ID } from 'lib/constants';
import { Menu, Metaobject } from 'lib/shopify/types';
import { createUrl, findParentCollection } from 'lib/shopify/utils';
import { createUrl, findParentCollection } from 'lib/utils';
import get from 'lodash.get';
import { useParams, useRouter, useSearchParams } from 'next/navigation';
import { useEffect, useState } from 'react';

View File

@@ -1,7 +1,7 @@
'use client';
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import { useRouter, useSearchParams } from 'next/navigation';
export default function Search() {

View File

@@ -3,7 +3,7 @@ import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/react
import { ChevronDownIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx';
import { Filter, FilterType } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import PriceRange from './price-range';
import SelectedList from './selected-list';

View File

@@ -3,7 +3,7 @@
import Price from 'components/price';
import { useDebounce } from 'hooks';
import { Filter } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import get from 'lodash.get';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { useCallback, useEffect, useRef, useState } from 'react';

View File

@@ -2,7 +2,7 @@
import { XMarkIcon } from '@heroicons/react/16/solid';
import { Filter } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
const SelectedList = ({ filters }: { filters: Filter[] }) => {

View File

@@ -1,6 +1,6 @@
import clsx from 'clsx';
import { SortFilterItem } from 'lib/constants';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import Link from 'next/link';
import { usePathname, useSearchParams } from 'next/navigation';

View File

@@ -3,7 +3,7 @@
import { ArrowRightIcon } from '@heroicons/react/16/solid';
import { MAKE_FILTER_ID } from 'lib/constants';
import { Metaobject } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import { useRouter, useSearchParams } from 'next/navigation';
const ButtonGroup = ({ manufacturer }: { manufacturer: Metaobject }) => {

View File

@@ -6,7 +6,7 @@ import Price from 'components/price';
import SideDialog from 'components/side-dialog';
import { CORE_VARIANT_ID_KEY, CORE_WAIVER } from 'lib/constants';
import { CoreChargeOption, ProductVariant } from 'lib/shopify/types';
import { cn, createUrl } from 'lib/shopify/utils';
import { cn, createUrl } from 'lib/utils';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { useState } from 'react';

View File

@@ -2,7 +2,7 @@
import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
import { TileImage } from 'components/grid/tile';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import Image from 'next/image';
import Link from 'next/link';
import { usePathname, useSearchParams } from 'next/navigation';

View File

@@ -6,7 +6,7 @@ import clsx from 'clsx';
import Price from 'components/price';
import { CORE_VARIANT_ID_KEY, CORE_WAIVER } from 'lib/constants';
import { CoreChargeOption, Money, ProductOption, ProductVariant } from 'lib/shopify/types';
import { createUrl } from 'lib/shopify/utils';
import { createUrl } from 'lib/utils';
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { Fragment, useEffect, useState } from 'react';

View File

@@ -1,7 +1,7 @@
'use client';
import Price from 'components/price';
import { cn } from 'lib/shopify/utils';
import { cn } from 'lib/utils';
import { ReactNode, useState } from 'react';
const options = ['Included', 'Premium Labor', '+1 Year'] as const;

View File

@@ -1,6 +1,6 @@
'use client';
import { cn } from 'lib/shopify/utils';
import { cn } from 'lib/utils';
import { ITooltip, Tooltip as ReactTooltip } from 'react-tooltip';
const Tooltip = ({ id, children, className }: ITooltip) => {