mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-01-27 15:22:56 +08:00
feat: append email to checkout url
This commit is contained in:
parent
93b92be14a
commit
7597a244fd
@ -197,7 +197,7 @@ export const PremiumView = () => (
|
||||
component="a"
|
||||
variant="gradient"
|
||||
gradient={{ from: "blue", to: "teal" }}
|
||||
href={paymentURL}
|
||||
href={paymentURL()}
|
||||
target="_blank"
|
||||
>
|
||||
UPGRADE TO PREMIUM $5.00
|
||||
|
@ -1,5 +1,14 @@
|
||||
import useUser from "src/store/useUser";
|
||||
|
||||
export const baseURL = process.env.NEXT_PUBLIC_BASE_URL as string;
|
||||
export const paymentURL = process.env.NEXT_PUBLIC_PAYMENT_URL as string;
|
||||
|
||||
export const paymentURL = () => {
|
||||
const email = useUser.getState().user?.email;
|
||||
let url = process.env.NEXT_PUBLIC_PAYMENT_URL as string;
|
||||
|
||||
if (email) url += `?checkout[email]=${email}`;
|
||||
return url;
|
||||
};
|
||||
|
||||
// Example taken from https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json
|
||||
const sampleJson = Object.freeze({
|
||||
|
@ -53,7 +53,7 @@ export const PremiumModal: React.FC<ModalProps> = ({ opened, onClose }) => {
|
||||
</Title>
|
||||
<Button
|
||||
component="a"
|
||||
href={paymentURL}
|
||||
href={paymentURL()}
|
||||
variant="filled"
|
||||
color="teal"
|
||||
size="md"
|
||||
|
@ -64,7 +64,7 @@ const Pricing = () => {
|
||||
</Title>
|
||||
<Button
|
||||
component="a"
|
||||
href={paymentURL}
|
||||
href={paymentURL()}
|
||||
variant="filled"
|
||||
color="teal"
|
||||
size="md"
|
||||
|
Loading…
x
Reference in New Issue
Block a user