Skip to content

Commit

Permalink
InitialPath has been provided
Browse files Browse the repository at this point in the history
  • Loading branch information
sergesoroka committed Aug 29, 2024
1 parent 582160a commit 5c1547e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
16 changes: 12 additions & 4 deletions components/h5web/h5web.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import "@h5web/app/dist/styles.css";

import { App, HsdsProvider } from "@h5web/app";
import { useLocation, useSearchParams } from "react-router-dom";

// eslint-disable-next-line react/prop-types
export default function H5web({ domain, h5webParams }) {
console.log("h5web", domain);
console.log("h5webParams", h5webParams);
export default function H5web({ domain }) {

let [searchParams, setSearchParams] = useSearchParams();
const location = useLocation();

const queryParams = new URLSearchParams(location.search);
const h5webParams = queryParams.get("h5web");

const initialPathParams = searchParams.get("initialPath")


return (
<div>
Expand All @@ -16,7 +24,7 @@ export default function H5web({ domain, h5webParams }) {
password="system-public-user"
filepath={`${domain ? domain : h5webParams}`}
>
<App initialPath="/"/>
<App initialPath={initialPathParams} />
</HsdsProvider>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ h1 {

.shareBtn:hover {
background-color: #00ace1;
border: 1px solid #00ace1;
color: #fff;
}

Expand Down
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function App() {
<UnderDevelopent />
<div>
{h5webParams ? (
<H5web domain={domain} h5webParams={h5webParams}/>
<H5web domain={domain} />
) : (
<div>
<SearchComp setDomain={setDomain} />
Expand Down

0 comments on commit 5c1547e

Please sign in to comment.