-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getting stuck on the implementation of editing an app...
- Loading branch information
1 parent
dca50e0
commit 681d99d
Showing
19 changed files
with
474 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useExtensionState } from "./useExtensionState"; | ||
|
||
import type { RetoolApp } from "../types"; | ||
|
||
export function useAppUrl(app: RetoolApp) { | ||
const domain = useExtensionState((s) => s.domain); | ||
|
||
const base = `https://${domain}.retool.com/`; | ||
const path = `${app.public ? "p" : "app"}/${app.name}`; | ||
const url = new URL(path, base); | ||
|
||
app.query.forEach((q) => url.searchParams.append(q.param, q.value)); | ||
|
||
if (app.hash.length === 0) { | ||
return `${url.toString()}`; | ||
} | ||
|
||
const hashParams = new URLSearchParams( | ||
app.hash.map((h) => [h.param, h.value]) | ||
); | ||
|
||
return `${url.toString()}#${hashParams.toString()}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.