Skip to content

Commit

Permalink
Add filtered redirect to gift card page from customer details (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloud11PL committed Dec 13, 2021
1 parent 7dcb9e8 commit 64900c8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Skeleton from "@saleor/components/Skeleton";
import { useCustomerDetails } from "@saleor/customers/hooks/useCustomerDetails";
import GiftCardCreateDialog from "@saleor/giftCards/GiftCardCreateDialog/GiftCardCreateDialog";
import { getExtendedGiftCard } from "@saleor/giftCards/GiftCardUpdate/providers/GiftCardDetailsProvider/utils";
import { giftCardListUrl } from "@saleor/giftCards/urls";
import useNavigator from "@saleor/hooks/useNavigator";
import { getFullName } from "@saleor/misc";
import { mapEdgesToItems } from "@saleor/utils/maps";
import * as React from "react";
Expand All @@ -22,6 +24,7 @@ import { useCardActionsStyles } from "./styles";

const CustomerGiftCardsCard: React.FC = () => {
const intl = useIntl();
const navigate = useNavigator();
const [openCreateDialog, setOpenCreateDialog] = useState(false);
const customerDetails = useCustomerDetails();
const customer = customerDetails?.customer?.user;
Expand All @@ -45,7 +48,11 @@ const CustomerGiftCardsCard: React.FC = () => {
});

const handleViewAllButton = () => {
// history push to filtered gift cards
navigate(
giftCardListUrl({
usedBy: [id]
})
);
};

const handleCreateNewCardButton = () => {
Expand Down

0 comments on commit 64900c8

Please sign in to comment.