Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getFullGitHubUrl = (url: string) =>
`${protocolAndHost()}${gitHubToSandboxUrl(url)}`;
const getFullGitHubUrl = url =>
`${protocolAndHost()}${gitHubToSandboxUrl(url)}`;
<button style="{{"> {
copyToClipboard(transformedUrl);
}}
disabled={!transformedUrl}
>
Copy Link
</button>
<button disabled="{!transformedUrl}" style="{{">
Generate Sandbox
</button>
<>
Import from Stackbit
Create a project using{' '}
function receiveMessage(event) {
if (event.origin === 'https://app.stackbit.com' && event.data) {
const data = JSON.parse(event.data);
if (
data.type === 'project-update' &&
data.project &&
data.project.repository &&
data.project.repository.url
) {
stackbitWindow.close();
closeModal();
history.push(gitHubToSandboxUrl(data.project.repository.url));
window.removeEventListener('message', receiveMessage, false);
}
}
}
}
/>
{error !== null && {error}}
{!noConverted && (
<>
<label>Converted Sandbox URL</label>
)}
<button disabled="{!transformedUrl}">
Open Sandbox
</button>
);
}
}
const getFullGitHubUrl = (url: string) =>
`${protocolAndHost()}${gitHubToSandboxUrl(url)}`;
/>
{error ? (
{error || 'Enter a URL to see the generated URL'}
) : null}
<button> {
copyToClipboard(transformedUrl);
}}
disabled={!transformedUrl}
>
Copy Link
</button>
<button disabled="{!transformedUrl}">
Generate Sandbox
</button>
{state.user && (
{' '}
Import from Stackbit
Create a project using Stackbit. This generates a project for you
that{"'"}s automatically set up with any Theme, Site Generator and
CMS.
const getFullGitHubUrl = url =>
`${protocolAndHost()}${gitHubToSandboxUrl(url)}`;