Skip to content

Latest commit

 

History

History
32 lines (16 loc) · 1.1 KB

ui.md

File metadata and controls

32 lines (16 loc) · 1.1 KB

UI

this extension has 3 kinds of ui page.

  • browser action popup page

    when user click the icon besides browser address bar, this page will show up.

  • notification page

    when dapp request user interaction. some like sign, connect, this page will show in a seperate window.

  • tab page

    when the extension needs more space to ensure user can get information easily, it will open a browser tab to disaply content.

these pages share the same code. in the start of ui show, the extension will try to execute getBackgroundWindow first.

all operations about wallet are mounted in the background window.wallet.

Route

the default route of ui is SortHat(SortHat.tsx), it will check the wallet status, and decide which view to display.

Approval

when dapp request something which needs user's permission, the approval job will be seted, and trigger the notification page open.

then page will check the approval job status in the SortHat view, and navigate to the Approval view.(views/Approval)

according to the approval job uiType, it will display different Approval component.