How to use the @codesandbox/common/lib/utils/url-generator.sandboxUrl 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 / Search / SandboxCard / index.js View on Github external
function SandboxCard({ hit }) {
  return (
    
      
        <header>
          <title>
            {hit.title ? (
              &lt;Highlight attribute="title" hit={hit} /&gt;
            ) : (
              hit.objectID
            )}
          </title>
          
             tag.length &lt; 20)}
            /&gt;
          </header>
github codesandbox / codesandbox-client / packages / app / src / app / overmind / effects / router.ts View on Github external
updateSandboxUrl(
    {
      id,
      alias,
      git,
    }: {
      id?: string;
      alias?: string;
      git?: GitInfo;
    },
    { openInNewWindow = false }: { openInNewWindow?: boolean } = {}
  ) {
    const url = sandboxUrl({
      id,
      alias,
      git,
    });

    if (openInNewWindow) {
      window.open(url, '_blank');
    } else {
      history.push(url);
    }
  },
  redirectToNewSandbox() {
github codesandbox / codesandbox-client / packages / app / src / app / store / modules / workspace / actions.js View on Github external
.then(data => {
      window.history.replaceState({}, null, sandboxUrl(data));
      return { data };
    })
    .catch(error => ({ error }));
github codesandbox / codesandbox-client / packages / app / src / app / pages / common / Modals / ShareModal / getCode.ts View on Github external
export const getEditorUrl = (sandbox, mainModule, state) =>
  protocolAndHost() +
  sandboxUrl(sandbox) +
  getOptionsUrl(sandbox, mainModule, state);
github codesandbox / codesandbox-client / packages / app / src / embed / components / Actions / index.js View on Github external
<button aria-label="{sandbox.userLiked">
            
          </button>
        
      ) : null}
      <button href="{`${sandboxUrl(sandbox)}?from-embed`}" rel="noopener noreferrer">
        Open Sandbox
      </button>
    
  );
}
github codesandbox / codesandbox-client / packages / app / src / app / components / CreateNewSandbox / CreateSandbox / TemplateList / TemplateList.tsx View on Github external
? () =&gt; (
                            
                               {
                                  evt.stopPropagation();
                                  actions.modalClosed();
                                }}
                                to={sandboxUrl(template.sandbox)}
                              &gt;
                                
                              
                            
                          )
                        : undefined
github codesandbox / codesandbox-client / packages / app / src / app / pages / Search / Results / index.js View on Github external
const selectSandbox = ({ alias, git, objectID }) =>
  window.open(sandboxUrl({ alias, id: objectID, git }));