Created
December 20, 2024 13:11
-
-
Save ajtransak/398ae7827910dbfe25d60231343e9bc2 to your computer and use it in GitHub Desktop.
Transak Sandbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from "react"; | |
import Stack from "@mui/material/Stack"; | |
import Box from "@mui/material/Box"; | |
import config from "../config"; | |
export default function OffRampStreamIFrame() { | |
const [iframeSrc, setIframeSrc] = useState(""); | |
useEffect(() => { | |
const baseUrl = "https://global-stg.transak.com"; | |
const queryParams = [ | |
`apiKey=${config.apiKeyGlobalStaging}`, | |
`isTransakStreamOffRamp=true`, | |
`cryptoCurrencyCode=ETH`, | |
`network=ethereum`, | |
].join("&"); | |
setIframeSrc(`${baseUrl}?${queryParams}`); | |
}, []); | |
return ( | |
<Stack direction="column" alignItems="center" sx={{ p: "4px" }}> | |
<Box | |
sx={{ | |
display: "flex", | |
justifyContent: "center", | |
alignItems: "center", | |
width: "100%", | |
minHeight: "100px", | |
border: "1px dashed grey", | |
p: "16px", | |
}} | |
> | |
{iframeSrc && ( | |
<iframe | |
title="Transak" | |
src={iframeSrc} | |
allow="camera;microphone;fullscreen;payment" | |
style={{ height: 650, width: 400, border: "none" }} | |
/> | |
)} | |
</Box> | |
</Stack> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment