Skip to content

Commit

Permalink
Add params option to share configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Billiam authored and sgenoud committed Jan 8, 2024
1 parent b8e56a4 commit eedf78b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/studio/src/LinkWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export function MakeLink() {
const [disableAutoPosition, setDisableAutoPosition] = useState(false);
const [disableDamping, setDisableDamping] = useState(false);
const [hideGrid, setHideGrid] = useState(false);
const [expandParametersPanel, setExpandParametersPanel] = useState(false);

let link = null;
if (inputVal) {
Expand All @@ -229,6 +230,7 @@ export function MakeLink() {
url.searchParams.set("disable-auto-position", "true");
disableDamping && url.searchParams.set("disable-damping", "true");
hideGrid && url.searchParams.set("hide-grid", "true");
expandParametersPanel && url.searchParams.set("params", "true");
link = url.toString();
}

Expand Down Expand Up @@ -276,6 +278,15 @@ export function MakeLink() {
/>
<label htmlFor="hide-grid">Grid</label>
</span>
<span>
<input
id="expand-params"
type="checkbox"
checked={expandParametersPanel}
onChange={(e) => setExpandParametersPanel(e.target.checked)}
/>
<label htmlFor="expand-params">Parameters panel open</label>
</span>
</Options>

{link && (
Expand Down

0 comments on commit eedf78b

Please sign in to comment.