Skip to content

Commit

Permalink
fix: channel context types
Browse files Browse the repository at this point in the history
  • Loading branch information
dlhck committed Jan 22, 2025
1 parent b55d8a4 commit 1aacccd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/cart/channel-context.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
'use client';

import { createContext, PropsWithChildren, use, useContext } from 'react';
import { GetActiveChannelQuery } from '../../lib/vendure/types';
import { Active_ChannelFragment } from '@/lib/vendure/types';

type ActiveCannel = Pick<GetActiveChannelQuery, 'activeChannel'>

const ChannelContext = createContext<ActiveCannel | undefined>(undefined);
const ChannelContext = createContext<Active_ChannelFragment | undefined>(undefined);

export function ChannelProvider({
channelPromise,
children
}: PropsWithChildren<{
channelPromise: Promise<ActiveCannel | undefined>;
channelPromise: Promise<Active_ChannelFragment | undefined>;
}>) {
const channel = use(channelPromise);

Expand Down

0 comments on commit 1aacccd

Please sign in to comment.