Skip to content

Commit

Permalink
fix: open in codesandbox and stackblitz tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
lerte committed Oct 16, 2024
1 parent ef0b22a commit 6dc8b55
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
18 changes: 9 additions & 9 deletions apps/docs/src/components/OpenInCodeSandbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ export default defineConfig({
})

return (
<form
method="POST"
target="_blank"
action="https://codesandbox.io/api/v1/sandboxes/define"
>
<input type="hidden" name="parameters" value={parameters} />
<Tooltip placement="top" content="Open in CodeSandbox">
<Tooltip placement="top" content="Open in CodeSandbox">
<form
method="POST"
target="_blank"
action="https://codesandbox.io/api/v1/sandboxes/define"
>
<input type="hidden" name="parameters" value={parameters} />
<IconButton type="submit">
<svg
width="24"
Expand All @@ -218,8 +218,8 @@ export default defineConfig({
<line x1="12" x2="12" y1="22.08" y2="12" />
</svg>
</IconButton>
</Tooltip>
</form>
</form>
</Tooltip>
)
}

Expand Down
52 changes: 26 additions & 26 deletions apps/docs/src/components/OpenInStackblitz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,35 +168,35 @@ export default defineConfig({
}

return (
<form
method="post"
target="_target"
className="flex"
action="https://stackblitz.com/run"
>
{Object.keys(project).map((item) =>
item != 'files' ? (
<input
key={item}
type="hidden"
name={`project[${item}]`}
// @ts-expect-error
value={project[item]}
/>
) : (
Object.keys(project[item]).map((file) => (
<Tooltip placement="top" content="Open in Stackblitz">
<form
method="post"
target="_target"
className="flex"
action="https://stackblitz.com/run"
>
{Object.keys(project).map((item) =>
item != 'files' ? (
<input
key={file}
key={item}
type="hidden"
name={`project[files][${file}]`}
name={`project[${item}]`}
// @ts-expect-error
value={project[item][file]}
value={project[item]}
/>
))
)
)}
) : (
Object.keys(project[item]).map((file) => (
<input
key={file}
type="hidden"
name={`project[files][${file}]`}
// @ts-expect-error
value={project[item][file]}
/>
))
)
)}

<Tooltip placement="top" content="Open in Stackblitz">
<IconButton type="submit">
<svg
viewBox="0 0 28 28"
Expand All @@ -206,8 +206,8 @@ export default defineConfig({
<path d="M12.747 16.273h-7.46L18.925 1.5l-3.671 10.227h7.46L9.075 26.5l3.671-10.227z"></path>
</svg>
</IconButton>
</Tooltip>
</form>
</form>
</Tooltip>
)
}

Expand Down

0 comments on commit 6dc8b55

Please sign in to comment.