feat: add checkout process
This commit is contained in:
14
packages/web/src/hooks/usePaddle.ee.ts
Normal file
14
packages/web/src/hooks/usePaddle.ee.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { PaddleContext } from 'contexts/Paddle.ee';
|
||||
|
||||
type UsePaddleReturn = {
|
||||
loaded: boolean;
|
||||
};
|
||||
|
||||
export default function usePaddle(): UsePaddleReturn {
|
||||
const paddleContext = React.useContext(PaddleContext);
|
||||
|
||||
return {
|
||||
loaded: paddleContext.loaded,
|
||||
};
|
||||
}
|
19
packages/web/src/hooks/usePaddleInfo.ee.ts
Normal file
19
packages/web/src/hooks/usePaddleInfo.ee.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { useQuery } from '@apollo/client';
|
||||
|
||||
import { GET_PADDLE_INFO } from 'graphql/queries/get-paddle-info.ee';
|
||||
|
||||
type UsePaddleInfoReturn = {
|
||||
sandbox: boolean;
|
||||
vendorId: string;
|
||||
loading: boolean;
|
||||
};
|
||||
|
||||
export default function usePaddleInfo(): UsePaddleInfoReturn {
|
||||
const { data, loading } = useQuery(GET_PADDLE_INFO);
|
||||
|
||||
return {
|
||||
sandbox: data?.getPaddleInfo?.sandbox,
|
||||
vendorId: data?.getPaddleInfo?.vendorId,
|
||||
loading
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user