-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(neuron-ui): add a toggle of skip-data-and-type
- Loading branch information
Showing
16 changed files
with
110 additions
and
16 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
27 changes: 20 additions & 7 deletions
27
packages/neuron-ui/src/components/GeneralSetting/index.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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { controllerMethodWrapper } from './controllerMethodWrapper' | ||
|
||
const CONTROLLER_NAME = 'skip-data-and-type' | ||
|
||
export const setSkipDataAndType = controllerMethodWrapper(CONTROLLER_NAME)( | ||
(controller: any) => (params: Controller.SetSkipAndTypeParam) => { | ||
return controller.update(params) | ||
} | ||
) | ||
|
||
export default { setSkipDataAndType } |
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
21 changes: 21 additions & 0 deletions
21
packages/neuron-ui/src/states/stateProvider/actionCreators/skipDataAndType.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,21 @@ | ||
import { setSkipDataAndType as setRemoteSkipDataAndType } from 'services/remote' | ||
import { failureResToNotification } from 'utils/formatters' | ||
import { StateDispatch, NeuronWalletActions } from '../reducer' | ||
import { addNotification } from './app' | ||
|
||
export const setSkipDataAndType = (skip: Controller.SetSkipAndTypeParam) => (dispatch: StateDispatch) => { | ||
setRemoteSkipDataAndType(skip).then(res => { | ||
if (res.status === 1) { | ||
dispatch({ | ||
type: NeuronWalletActions.UpdateSkipDataAndType, | ||
payload: res.result, | ||
}) | ||
} else { | ||
addNotification(failureResToNotification(res))(dispatch) | ||
} | ||
}) | ||
} | ||
|
||
export default { | ||
setSkipDataAndType, | ||
} |
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 |
---|---|---|
|
@@ -70,4 +70,5 @@ declare namespace Controller { | |
hash: string | ||
description: string | ||
} | ||
type SetSkipAndTypeParam = boolean | ||
} |
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