-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom submit endpoint option
- Loading branch information
1 parent
30324be
commit 573bdae
Showing
37 changed files
with
455 additions
and
50 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
apps/browser-extension-wallet/src/assets/icons/pause-icon.component.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions
14
apps/browser-extension-wallet/src/assets/icons/play-icon.component.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
26 changes: 26 additions & 0 deletions
26
apps/browser-extension-wallet/src/hooks/useCustomSubmitApi.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,26 @@ | ||
import { useLocalStorage } from '@hooks/useLocalStorage'; | ||
import { EnvironmentTypes } from '@stores'; | ||
import { CustomSubmitApiConfig } from '@types'; | ||
|
||
interface useCustomSubmitApiReturn { | ||
getCustomSubmitApiForNetwork: (network: EnvironmentTypes) => CustomSubmitApiConfig; | ||
updateCustomSubmitApi: (network: EnvironmentTypes, data: CustomSubmitApiConfig) => void; | ||
} | ||
|
||
export const useCustomSubmitApi = (): useCustomSubmitApiReturn => { | ||
const [isCustomSubmitApiEnabled, { updateLocalStorage: updateCustomSubmitApiEnabled }] = | ||
useLocalStorage('isCustomSubmitApiEnabled'); | ||
|
||
const getCustomSubmitApiForNetwork = (network: EnvironmentTypes) => { | ||
const networkConfig = isCustomSubmitApiEnabled?.[network]; | ||
const status = networkConfig?.status || false; | ||
const url = networkConfig?.url || ''; | ||
return { status, url }; | ||
}; | ||
|
||
const updateCustomSubmitApi = (network: EnvironmentTypes, data: CustomSubmitApiConfig) => { | ||
updateCustomSubmitApiEnabled({ ...isCustomSubmitApiEnabled, [network]: data }); | ||
}; | ||
|
||
return { getCustomSubmitApiForNetwork, updateCustomSubmitApi }; | ||
}; |
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
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
Oops, something went wrong.