-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display notification on new transactions (#323)
* feat: add i8ln to the redux store * feat: display a notification when receiving new transactions * feat: update whats new modal * refactor: only update active account on polling
- Loading branch information
1 parent
ddc6c98
commit 4f0ecbc
Showing
28 changed files
with
326 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
src/extension/apps/main/utils/createRouter/createRouter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import React from 'react'; | ||
import { createHashRouter, Navigate } from 'react-router-dom'; | ||
|
||
// constants | ||
import { | ||
ACCOUNTS_ROUTE, | ||
ADD_ACCOUNT_ROUTE, | ||
ASSETS_ROUTE, | ||
NFTS_ROUTE, | ||
SETTINGS_ROUTE, | ||
TRANSACTIONS_ROUTE, | ||
} from '@extension/constants'; | ||
|
||
// containers | ||
import Root from '../../Root'; | ||
|
||
// features | ||
import { setSideBar } from '@extension/features/layout'; | ||
|
||
// pages | ||
import AccountPage from '@extension/pages/AccountPage'; | ||
import AssetPage from '@extension/pages/AssetPage'; | ||
import NFTPage from '@extension/pages/NFTPage'; | ||
import SettingsRouter from '@extension/routers/SettingsRouter'; | ||
import TransactionPage from '@extension/pages/TransactionPage'; | ||
|
||
// routers | ||
import AddAccountRouter from '@extension/routers/AddAccountMainRouter'; | ||
|
||
// types | ||
import type { IOptions } from './types'; | ||
|
||
const createRouter = ({ i18n, store }: IOptions) => { | ||
const { dispatch } = store; | ||
|
||
return createHashRouter([ | ||
{ | ||
children: [ | ||
{ | ||
element: <Navigate replace={true} to={ACCOUNTS_ROUTE} />, | ||
path: '/', | ||
}, | ||
{ | ||
element: <AccountPage />, | ||
loader: () => { | ||
dispatch(setSideBar(true)); | ||
|
||
return null; | ||
}, | ||
path: `${ACCOUNTS_ROUTE}/*`, | ||
}, | ||
{ | ||
element: <AddAccountRouter />, | ||
loader: () => { | ||
dispatch(setSideBar(false)); | ||
|
||
return null; | ||
}, | ||
path: `${ADD_ACCOUNT_ROUTE}/*`, | ||
}, | ||
{ | ||
element: <AssetPage />, | ||
loader: () => { | ||
dispatch(setSideBar(true)); | ||
|
||
return null; | ||
}, | ||
path: `${ASSETS_ROUTE}/:assetId`, | ||
}, | ||
{ | ||
element: <NFTPage />, | ||
loader: () => { | ||
dispatch(setSideBar(true)); | ||
|
||
return null; | ||
}, | ||
path: `${NFTS_ROUTE}/:appId/:tokenId`, | ||
}, | ||
{ | ||
element: <SettingsRouter />, | ||
loader: () => { | ||
dispatch(setSideBar(true)); | ||
|
||
return null; | ||
}, | ||
path: `${SETTINGS_ROUTE}/*`, | ||
}, | ||
{ | ||
element: <TransactionPage />, | ||
loader: () => { | ||
dispatch(setSideBar(true)); | ||
|
||
return null; | ||
}, | ||
path: `${TRANSACTIONS_ROUTE}/:transactionId`, | ||
}, | ||
], | ||
element: <Root i18n={i18n} />, | ||
path: '/', | ||
}, | ||
]); | ||
}; | ||
|
||
export default createRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './createRouter'; |
12 changes: 12 additions & 0 deletions
12
src/extension/apps/main/utils/createRouter/types/IOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { Store } from '@reduxjs/toolkit'; | ||
import type { i18n } from 'i18next'; | ||
|
||
// types | ||
import type { IMainRootState } from '@extension/types'; | ||
|
||
interface IOptions { | ||
i18n: i18n; | ||
store: Store<IMainRootState>; | ||
} | ||
|
||
export default IOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { default as IOptions } from './IOptions'; |
Oops, something went wrong.