Skip to content

Commit

Permalink
ENG-3716 fix(portal): fix navigation on error page (#809)
Browse files Browse the repository at this point in the history
## Affected Packages

Apps

- [x] portal

Packages

- [ ] 1ui
- [ ] api
- [ ] protocol
- [ ] sdk

Tools

- [ ] tools

## Overview

The navigation buttons on the error page weren't properly refreshing or
navigating when used. Modified them slightly so that they should work
appropriately.

## Screen Captures

If applicable, add screenshots or screen captures of your changes.

## Declaration

- [x] I hereby declare that I have abided by the rules and regulations
as outlined in the
[CONTRIBUTING.md](https://github.com/0xIntuition/intuition-ts/blob/main/CONTRIBUTING.md)

 
 **PR Summary by Typo**
------------

 **Summary:**
Replaced a NavigationButton with a Button for non-root error pages and
updated the props for the home button.

**Key Points:**
- Replaced `NavigationButton` with a `Button` for non-root error pages.
- Updated home button props to use `PATHS.ROOT` and a click event for
`window.location.reload()` instead of `to=""` and `reloadDocument` prop.

**Categories:**
**Components:** error-page.tsx
- Replaced `NavigationButton` with `Button`.
- Updated home button props.

**Changes:**
- Used a `Button` instead of `NavigationButton`.
- Changed home button props to `PATHS.ROOT` and
`window.location.reload()` event.

<h6>To turn off PR summary, please visit <a
href="https://app.typoapp.io/settings/dev-analytics/notification?tab=codeHealth">Notification
settings</a>.</h6>
  • Loading branch information
Vitalsine85 authored Aug 30, 2024
1 parent e0e2366 commit f7d2321
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions apps/portal/app/components/error-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,24 @@ export const ErrorPage = ({
))}
</div>
<div className="flex gap-6 mt-5 max-sm:flex-col max-sm:w-full">
<NavigationButton
reloadDocument={!isAtRoot}
variant="primary"
size="lg"
to={isAtRoot ? PATHS.ROOT : ''}
>
{isAtRoot ? 'Back to home' : 'Refresh'}
</NavigationButton>
{isAtRoot ? (
<NavigationButton
reloadDocument={!isAtRoot}
variant="primary"
size="lg"
to={PATHS.ROOT}
>
Back to home
</NavigationButton>
) : (
<Button
variant="primary"
size="lg"
onClick={() => window.location.reload()}
>
Refresh
</Button>
)}
<Link
to="https://discord.com/channels/909531430881746974/1151564740255043604"
target="_blank"
Expand Down

0 comments on commit f7d2321

Please sign in to comment.