Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/others/buttonSelectNetwork/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ButtonSelectNetwork() {

return (
<div style={{ marginLeft: "10px" }}>
<Select options={selectOptions} placeholder={networkMap[chainId].shortname} onChange={switchAppChain} />
<Select options={selectOptions} placeholder={networkMap[chainId]?.shortname} onChange={switchAppChain} />
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default function ArbitrationDetails({ article }) {
<section className={styles.arbitrationDetails}>
<div className={styles.titleWrapper}>
<div className={styles.title}>Arbitration Details</div>
{networkMap[ethereumContext.chainId].shortname !== "Mainnet" && (
{networkMap[ethereumContext.chainId]?.shortname !== "Mainnet" && (
<CustomButton modifiers="small" disabled={buttonAdvanceStateDisabled} onClick={() => handleAdvanceState()}>
{mined ? `Advance state` : `Mining...`}
</CustomButton>
Expand Down
19 changes: 10 additions & 9 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ const router = createBrowserRouter(
<Route path="/">
<Route index element={<Home />} />
<Route element={<Layout />}>
<Route element={<RouteRedirect />}>
<Route element={<IndexRedirect />} />
{/* <Route element={<RouteRedirect />}> */}
<Route element={<IndexRedirect />} />

<Route path=":chain" element={<Browse />} loader={BrowseLoader} />
<Route path=":chain/:contract/:id" element={<Article />} loader={ArticleLoader} />
<Route path=":chain/:contract/court/:id" element={<Court />} loader={CourtLoader} />
<Route path=":chain" element={<Browse />} loader={BrowseLoader} />
<Route path=":chain/:contract/:id" element={<Article />} loader={ArticleLoader} />
<Route path=":chain/:contract/court/:id" element={<Court />} loader={CourtLoader} />

<Route element={<AuthRequired />}>
<Route path=":chain/account/:id" element={<Account />} loader={AccountLoader} />
<Route path=":chain/report" element={<Create />} />
</Route>
<Route element={<AuthRequired />}>
<Route path=":chain/account/:id" element={<Account />} loader={AccountLoader} />
<Route path=":chain/report" element={<Create />} />
</Route>
{/* </Route> */}
<Route path="faq" element={<FAQ />} />
<Route
path="*"
Expand All @@ -56,6 +56,7 @@ function App() {
const { pathname } = window.location;
const pathSegment = pathname.split("/")[1];
const chainId = pathSegment.startsWith("0x") ? pathSegment : undefined;
console.log({ chainId });
return (
<EthereumProvider chainId={chainId}>
<RouterProvider router={router} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function Home() {
left for reader is to enjoy distilled information.
</p>
</div>
<Link to="/0x1" className="button small" modifiers="">
<Link to="0x1" className="button small" modifiers="">
Explore The Truth Post
</Link>
</section>
Expand Down