Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/improve paths #460

Merged
merged 11 commits into from
Jun 18, 2024
Merged

Chore/improve paths #460

merged 11 commits into from
Jun 18, 2024

Conversation

Sharqiewicz
Copy link
Collaborator

@Sharqiewicz Sharqiewicz commented May 24, 2024

What:

The paths in the app are just strings that can cause many problems, such as misspelling, pointing to a non-existent page (after renaming).

How:

✅ Change the paths to be included in the PATHS enum. Enum is used for redirection throughout the application.
✅ Remove unused Stats page
✅ Fixed error appearing in the paths that only has the network name like:
portal.pendulumchain.org/amplitude portal.pendulumchain.org/pendulum portal.pendulumchain.org/foucoco - now it's redirecting to the dashboard

@Sharqiewicz Sharqiewicz requested a review from ebma May 24, 2024 09:03
Copy link

netlify bot commented May 24, 2024

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit b838454
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/667165f13ebfaf0008406a28
😎 Deploy Preview https://deploy-preview-460--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes 👍 The app seems broken though. If you open the deploy preview, you are not able to close the ToC dialog because the app is unresponsive, see the following error.

image

src/app.tsx Outdated Show resolved Hide resolved
src/pages/bridge/Issue/index.tsx Show resolved Hide resolved
@Sharqiewicz
Copy link
Collaborator Author

@ebma I have implemented dynamic imports with dynamic paths using const pages = import.meta.glob('./pages/**/index.tsx'); from ViteJS ⚡ . This approach detects and registers all the files that match the specified pattern without fetching them immediately.

✨ Key Improvements:

  • ✨ The directory structure for paths has been reorganized, making it more intuitive to create new page directories.
  • ✨ The directories now match the paths configuration in app.tsx. For instance, the path :network:/spacewalk/transactions corresponds to /pages/spacewalk/transactions/index.tsx, which is automatically detected by import.meta.glob from ViteJS.
  • ✨ All links in the app have been updated to use the PATHS enum from app.tsx, minimizing the risk of misspellings.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I like it 👌

src/components/Layout/links.tsx Outdated Show resolved Hide resolved
@Sharqiewicz
Copy link
Collaborator Author

@ebma changed ✅

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sharqiewicz Sharqiewicz merged commit 736ac12 into main Jun 18, 2024
5 checks passed
@Sharqiewicz Sharqiewicz deleted the chore/improve-paths branch June 18, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants