fix: set codesandbox referrer to no-referrer (#22792)

This commit is contained in:
Rustin 2020-03-31 21:24:36 +08:00 committed by GitHub
parent 1c302163af
commit 44d74415bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 14 deletions

View File

@ -256,6 +256,7 @@
}
&-codesandbox {
display: inline-block;
width: 20px;
height: 20px;
overflow: hidden;

View File

@ -270,22 +270,18 @@ ${sourceCode.replace('mountNode', "document.getElementById('container')")}
/>
</Tooltip>
</form>
<form
action="https://codesandbox.io/api/v1/sandboxes/define"
method="POST"
target="_blank"
onClick={() => this.track({ type: 'codesandbox', demo: meta.id })}
>
<input
type="hidden"
name="parameters"
value={compress(JSON.stringify(codesanboxPrefillConfig))}
/>
<form>
<Tooltip title={<FormattedMessage id="app.demo.codesandbox" />}>
<input
type="submit"
value="Create New Sandbox with Prefilled Data"
{/* FIXME: This temporarily solution to fix issues/22636, we need revert it to use form after the codesandbox api issue fixed. */}
<a
aria-label="Create New Sandbox with Prefilled Data"
rel="noopener noreferrer"
target="_blank"
href={`https://codesandbox.io/api/v1/sandboxes/define?parameters=${compress(
JSON.stringify(codesanboxPrefillConfig),
)}`}
className="code-box-codesandbox"
onClick={() => this.track({ type: 'codesandbox', demo: meta.id })}
/>
</Tooltip>
</form>