How to use the @codesandbox/common/lib/utils/url-generator.gitHubToSandboxUrl function in @codesandbox/common

To help you get started, we’ve selected a few @codesandbox/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codesandbox / codesandbox-client / packages / app / src / app / pages / GitHub / main.js View on Github external
const getFullGitHubUrl = url =>
  `${protocolAndHost()}${gitHubToSandboxUrl(url)}`;
github codesandbox / codesandbox-client / packages / app / src / app / components / CreateNewSandbox / CreateSandbox / Import / Import.tsx View on Github external
<button style="{{"> {
                  copyToClipboard(transformedUrl);
                }}
                disabled={!transformedUrl}
              &gt;
                Copy Link
              </button>
              <button disabled="{!transformedUrl}" style="{{">
                Generate Sandbox
              </button>
            
          
        

        &lt;&gt;
          
          
            
              
              Import from Stackbit
            
            
              Create a project using{' '}
github codesandbox / codesandbox-client / packages / app / src / app / components / CreateNewSandbox / CreateSandbox / Import / Stackbit.tsx View on Github external
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);
      }
    }
  }
}
github codesandbox / codesandbox-client / packages / app / src / app / pages / GitHub / main.js View on Github external
/&gt;

        {error !== null &amp;&amp; {error}}

        {!noConverted &amp;&amp; (
          &lt;&gt;
            <label>Converted Sandbox URL</label>
            
          
        )}

        <button disabled="{!transformedUrl}">
          Open Sandbox
        </button>
      
    );
  }
}
github codesandbox / codesandbox-client / packages / app / src / app / components / CreateNewSandbox / CreateSandbox / Import / Import.tsx View on Github external
/&gt;
            {error ? (
              
                {error || 'Enter a URL to see the generated URL'}
              
            ) : null}
            
              <button> {
                  copyToClipboard(transformedUrl);
                }}
                disabled={!transformedUrl}
              &gt;
                Copy Link
              </button>
              <button disabled="{!transformedUrl}">
                Generate Sandbox
              </button>
            
          
        
        {state.user &amp;&amp; (
          
            {' '}
            
              
              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.
github codesandbox / codesandbox-client / packages / app / src / app / pages / GitHub / index.tsx View on Github external
const getFullGitHubUrl = url =>
  `${protocolAndHost()}${gitHubToSandboxUrl(url)}`;