-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(suite): general refactoring
- Loading branch information
1 parent
72a265f
commit 7a851c7
Showing
12 changed files
with
40 additions
and
28 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
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
export const ADD = '@contacts/add'; | ||
export const REMOVE = '@contacts/remove'; | ||
export const CONTACTS_MODULE_PREFIX = '@common/contacts'; |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
export * as contactsActions from './redux/contactsActions'; | ||
export type { ContactsAction } from './redux/contactsActions'; | ||
export { prepareContactsReducer } from './redux/contactsReducer'; | ||
export * from './redux/contactsActions'; | ||
export * from './redux/contactsReducer'; | ||
export * from './redux/contactsSelectors'; | ||
export * as CONTACTS from './constants'; | ||
export * from './constants'; | ||
export * from './types'; | ||
export * from './utils/findContact'; | ||
export * from './utils'; |
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 |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
import { Contact } from '../types'; | ||
import * as CONTACTS from '../constants'; | ||
import { CONTACTS_MODULE_PREFIX } from '../constants'; | ||
|
||
export const addContact = createAction(CONTACTS.ADD, (payload: Contact) => ({ payload })); | ||
export const addContact = createAction(`${CONTACTS_MODULE_PREFIX}/add`, (payload: Contact) => ({ | ||
payload, | ||
})); | ||
|
||
export const removeContact = createAction(CONTACTS.REMOVE, (payload: Contact) => ({ payload })); | ||
export const removeContact = createAction( | ||
`${CONTACTS_MODULE_PREFIX}/remove`, | ||
(payload: Contact) => ({ payload }), | ||
); | ||
|
||
export const contactsActions = { | ||
addContact, | ||
removeContact, | ||
}; | ||
|
||
export type ContactsAction = ReturnType<typeof addContact> | ReturnType<typeof removeContact>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { TrezorDevice } from '@suite-common/suite-types'; | ||
|
||
export * from './findContact'; | ||
|
||
export const getDeviceState = (device: TrezorDevice) => | ||
device.state?.staticSessionId?.split('@')?.[0]; |
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