GithubHelp home page GithubHelp logo

huseyindeniz / vite-react-dapp-template Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 5.0 1.29 MB

Vite React Template for dApp Frontend Development

Home Page: https://huseyindeniz.github.io/react-dapp-template-documentation/

License: MIT License

JavaScript 0.54% TypeScript 97.90% HTML 0.90% CSS 0.66%
chakra-ui dapp ethers ethersjs react redux-saga redux-toolkit template typechain typescript vite vite-react-template web3

vite-react-dapp-template's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @huseyindeniz
  • ๐Ÿ‘€ Iโ€™m interested in enterprise application development, blockchain and robotics
  • ๐ŸŒฑ Iโ€™m currently learning phaserjs, unreal engine, solidity
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on nft/blockchain, dotnet core, python, ros/ros2, pytorch, react, react native projects
  • ๐Ÿ“ซ How to reach me https://linkedin.com/in/huseyindenizkivrak/en-us
  • ๐Ÿ”— My E-Portfolio: https://huseyindeniz.net
  • ๐Ÿ”— My Web3 Profile: https://huseyindeniz.avax.sh

vite-react-dapp-template's People

Contributors

huseyindeniz avatar oehm-smith avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

vite-react-dapp-template's Issues

Disconnecting wallets doesn't work properly

Describe the bug

If you use the Disconnect button inside the Template's wallet, this seems to only disconnect it internally from the app. If you hit 'connect' again it will reconnect to the same account.

This is perfectly normal behavior.

To connect to a different account you need to disconnect using Metamask's > Connected Sites > disconnect.

Which works.

As soon as you do this, however the Metamask connect in the App pops up. It feels a bit intrusive and I think this should be prevented from happening.

The bug is that after disconnecting either way (App or MM), the EventChannel on listenAccountChange() in Wallet.ts (ethers 6 - I haven't tried 5) is not firing. Thus your app is not aware of the account disconnection.

I understand that you would most likely isProtected your page. But I don't think you should rely on that and I think the listener should be consistent and complete.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to account
  2. Go to metamask in browser and disconnect account from site
  3. In a Page that uses EventChannel on listenAccountChange(), the event doesnt fire so your page is unaware of the change.

Expected behavior
Your pages that use EventChannel on listenAccountChange() should fire when an account is disconnected either in App or via Metamask.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS 13.6.3
  • Browser [e.g. chrome, safari] Brave
  • Version [e.g. 22] v1.62.153

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] NA
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Automate versioning

Automate versioning.

Investigate/find/integrate a tool which supports semantic versioning and integrates with GitHub actions easily. Version should be set automatically when a PR is created.

Add Avvy Avatar Support

Avvy domains have avatar option and avatar url's are available via Avvy's ResolutionUtils contract.

Add Rabby Wallet Support

Rabby wallet is getting more popular. It needs to be added to Supported Web3 Wallets list.

Note: I added Rabby support at the beginning but Avalanche's Core wallet hijacks/overrides ethers BrowserProvider object properties aggressively which causes a problem when Rabby, MM and Core installed at the same time.

Find a way to identify all wallets correctly when MM, Rabby and Core wallet installed at the same time on user's browser.

Integrate a11y

If it's possible, integrate a11y in both eslint and storybook

Integrate Viem

If it's possible integrate Viem as an alternate to Ethers

Save access token in wallet store when backend signature activated.

IWalletAccountApi sign method doesn't return anything. When backend login needed, in most cases, this sign method probably will get access token from backend server. This token needs to be saved in wallet store.

  • return token in sign method
  • save token in signin saga

Refactor IWalletApi for supporting more Web3 Wallets

Currently, IWalletAPI implementation is searching/using Metamask only. Refactor loadProvider to support other web3 wallets.
After refactoring it, the following wallets might be integrated as a first iteration in this task.

  • Core
  • Coinbase

Also add Other Wallets option to support more Web3 wallets.

`path` required for Pages

Describe the bug

Really nice template thanks. However some teething issues. This one is for the documentation.

The documentation at https://huseyindeniz.github.io/react-dapp-template-documentation/docs/tutorial-basics/create-a-page says:

// Home Route
const MyNewPageRoute: PageType = {
  index: true,
  element: <MyNewPage />,
  menuLabel: t("My New Page", { ns: "Menu" }),
  isShownInMainMenu: false,
  isShownInSecondaryMenu: false,
  isProtected: false,
};

But you also need to add path to get the new page to work. For example:

const EventsPageRoute: PageType = {
    index: true,
    path: 'events',
    element: <EventsPage />,
    menuLabel: t('Events', { ns: 'Menu' }),
    isShownInMainMenu: false,
    isShownInSecondaryMenu: true,
    isProtected: false,
  };

It also wouldn't hurt to add some more details to this page. For example:

  • isProtected is if Wallet authentication is required
  • isShownInXMenu - at least one of these must be true

Network logo should be lazy loaded.

Currently, the NetworkLogo component under the wallet feature loads all supported network logos. It should load only the connected network logo.

  • Investigate if there is a lightweight, stable external React package for image lazy loading.
  • a proper package exists.
    ย  - install and use it in all image imports.
  • package does not exist.
    ย  - Find a way to lazy load network logos in the NetworkLogo component.
    ย  - Investigate other places if multiple unnecessary sync image loads exist, and if so, fix them as well.
    ย  - Consider if the custom solution to this issue could be a shared component under the UI feature. If so, create it and use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.