feat: add checkout process

This commit is contained in:
Ali BARIN
2023-03-20 23:24:04 +00:00
parent 66d7baa126
commit b5ed984f05
6 changed files with 141 additions and 5 deletions

View 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,
};
}

View 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
};
}