Rustin
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
14 deletions
-
site/theme/static/demo.less
-
site/theme/template/Content/Demo.jsx
|
|
@ -256,6 +256,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
&-codesandbox { |
|
|
|
display: inline-block; |
|
|
|
width: 20px; |
|
|
|
height: 20px; |
|
|
|
overflow: hidden; |
|
|
|
|
|
@ -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> |
|
|
|