Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-phan committed Aug 15, 2024
1 parent 88350d4 commit 26aba08
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 19 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @weaverse/pilot

## 2.8.1

### Patch Changes

- Updated dependencies
- @weaverse/hydrogen@3.4.1

## 2.7.8

### Patch Changes
Expand Down
20 changes: 17 additions & 3 deletions app/sections/collection-filters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import { useLoaderData } from "@remix-run/react";
import { Pagination } from "@shopify/hydrogen";
import type { Filter } from "@shopify/hydrogen/storefront-api-types";
import type {
ComponentLoaderArgs,
HydrogenComponentProps,
HydrogenComponentSchema,
} from "@weaverse/hydrogen";
import { forwardRef, useState } from "react";
import { useInView } from "react-intersection-observer";
import type { CollectionDetailsQuery } from "storefrontapi.generated";
import { Button, PageHeader, Section, Text } from "~/modules";
import type { AppliedFilter } from "~/modules/SortFilter";
import { DrawerFilter } from "~/modules/DrawerFilter";
import type { AppliedFilter } from "~/modules/SortFilter";
import { ProductsLoadedOnScroll } from "./products-loaded-on-scroll";

interface CollectionFiltersProps extends HydrogenComponentProps {
Expand All @@ -21,9 +22,15 @@ interface CollectionFiltersProps extends HydrogenComponentProps {

let CollectionFilters = forwardRef<HTMLElement, CollectionFiltersProps>(
(props, sectionRef) => {
let { showCollectionDescription, loadPrevText, loadMoreText, ...rest } =
props;
let {
showCollectionDescription,
loadPrevText,
loadMoreText,
loaderData,
...rest
} = props;

console.log(4444, loaderData?.randomNumber);
let { ref, inView } = useInView();
let [numberInRow, setNumberInRow] = useState(4);
let onLayoutChange = (number: number) => {
Expand Down Expand Up @@ -105,6 +112,13 @@ let CollectionFilters = forwardRef<HTMLElement, CollectionFiltersProps>(
},
);

export let loader = async ({ weaverse }: ComponentLoaderArgs) => {
let { storefront } = weaverse;
let randomNumber = Math.floor(Math.random() * 1000);
console.log(3333, randomNumber);
return { randomNumber };
};

export default CollectionFilters;

export let schema: HydrogenComponentSchema = {
Expand Down
Loading

0 comments on commit 26aba08

Please sign in to comment.