Skip to content

Commit

Permalink
Add redirects to app
Browse files Browse the repository at this point in the history
  • Loading branch information
itexpert120 committed Feb 1, 2024
1 parent 9b81e7d commit a6beed6
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
import React, { useCallback, useEffect, useState } from "react";
import "react-bootstrap-typeahead/css/Typeahead.bs5.css";
import "react-bootstrap-typeahead/css/Typeahead.css";
import { Link, Route, BrowserRouter as Router, Switch } from "react-router-dom";
import { Link, Route, BrowserRouter as Router, Switch, Redirect } from "react-router-dom";
import { BosLoaderBanner } from "./components/BosLoaderBanner";
import { Navbar } from "./components/navigation/Navbar";
import { useEthersProviderContext } from "./data/web3";
Expand Down Expand Up @@ -110,7 +110,7 @@ function App() {
if (props.to) {
props.to =
typeof props.to === "string" &&
isValidAttribute("a", "href", props.to)
isValidAttribute("a", "href", props.to)
? props.to
: "about:blank";
}
Expand Down Expand Up @@ -206,39 +206,36 @@ function App() {
<BosLoaderBanner />
<JoinPage {...passProps} />
</Route>
{/* I've added the below as the isolated route for rendering the app */}
<Route path={"/:path*"}>
<BosLoaderBanner />
<Viewer {...passProps} />
<Route path={"/library"}>
<Redirect to="buildhub.near/widget/app?page=library" />
</Route>
{/* Legacy: */}
<Route path={"/propose"}>
<ProposePage {...passProps} />
</Route>
<Route path={"/library"}>
<Navbar {...passProps} />
<LibraryPage {...passProps} />
<Redirect to="buildhub.near/widget/app?page=proposal" />
</Route>
<Route path={"/feed"}>
<Navbar {...passProps} />
<FeedPage {...passProps} />
<Redirect to="buildhub.near/widget/app?page=feed" />
</Route>
<Route path={"/resources"}>
<Navbar {...passProps} />
<ResourcesPage {...passProps} />
<Redirect to="buildhub.near/widget/app?page=resources" />
</Route>
{/* I've added the below as the isolated route for rendering the app */}
<Route path={"/:path*"}>
<BosLoaderBanner />
<Viewer {...passProps} />
</Route>
{/* Legacy: */}
<Route path={"/embed/:widgetSrc*"}>
<EmbedPage {...passProps} />
</Route>
<Route path={"/edit/:widgetSrc*"}>
<Navbar {...passProps} />
<EditorPage {...passProps} />
</Route>
<Route path={"/:widgetSrc*"}>
{/* <Route path={"/:widgetSrc*"}>
<BosLoaderBanner />
<Navbar {...passProps} />
<ViewPage {...passProps} />
</Route>
</Route> */}
</Switch>
</Router>
</EthersProviderContext.Provider>
Expand Down

0 comments on commit a6beed6

Please sign in to comment.