-
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.
Merge pull request #5 from paritytech/config-from-url
Sharable URLs for Online Clients
- Loading branch information
Showing
25 changed files
with
737 additions
and
269 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
import { useRouteData, useSearchParams } from "@solidjs/router"; | ||
import { JSX } from "solid-js"; | ||
|
||
export const DebugComponent = (): JSX.Element => { | ||
return <></>; | ||
const [searchParams, setSearchParams] = useSearchParams(); | ||
|
||
return ( | ||
<> | ||
<button | ||
onClick={() => { | ||
let searchParams = new URLSearchParams(window.location.search); | ||
searchParams.set("foo", Math.random().toString()); | ||
// setSearchParams({ hello: }); | ||
}} | ||
> | ||
Press | ||
</button> | ||
</> | ||
); | ||
}; |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Navigate, useLocation } from "@solidjs/router"; | ||
import { AppConfig, paramsToString } from "../state/app_config"; | ||
import { JSX } from "solid-js"; | ||
import { HomePageState } from "../pages/Home"; | ||
|
||
export function RedirectToHome(): JSX.Element { | ||
const location = useLocation(); | ||
let config = AppConfig.fromParams(location.query); | ||
let redirectUrl = `/?${config.toParamsString()}`; | ||
HomePageState.instance.setRedirectPath(location.pathname); | ||
return <Navigate href={redirectUrl} />; | ||
} |
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
Oops, something went wrong.