@@ -24,6 +24,9 @@ export const ReviewTxProvider = ({
24
24
cborChanged : ( cbor : ReviewTxState [ 'cbor' ] ) => dispatch ( { type : ReviewTxActionType . CborChanged , cbor} ) ,
25
25
operationsChanged : ( operations : ReviewTxState [ 'operations' ] ) =>
26
26
dispatch ( { type : ReviewTxActionType . OperationsChanged , operations} ) ,
27
+ customReceiverTitleChanged : ( customReceiverTitle : ReviewTxState [ 'customReceiverTitle' ] ) =>
28
+ dispatch ( { type : ReviewTxActionType . CustomReceiverTitleChanged , customReceiverTitle} ) ,
29
+ detailsChanged : ( details : ReviewTxState [ 'details' ] ) => dispatch ( { type : ReviewTxActionType . DetailsChanged , details} ) ,
27
30
onSuccessChanged : ( onSuccess : ReviewTxState [ 'onSuccess' ] ) =>
28
31
dispatch ( { type : ReviewTxActionType . OnSuccessChanged , onSuccess} ) ,
29
32
onErrorChanged : ( onError : ReviewTxState [ 'onError' ] ) => dispatch ( { type : ReviewTxActionType . OnErrorChanged , onError} ) ,
@@ -55,6 +58,14 @@ const reviewTxReducer = (state: ReviewTxState, action: ReviewTxAction) => {
55
58
draft . operations = action . operations
56
59
break
57
60
61
+ case ReviewTxActionType . CustomReceiverTitleChanged :
62
+ draft . customReceiverTitle = action . customReceiverTitle
63
+ break
64
+
65
+ case ReviewTxActionType . DetailsChanged :
66
+ draft . details = action . details
67
+ break
68
+
58
69
case ReviewTxActionType . OnSuccessChanged :
59
70
draft . onSuccess = action . onSuccess
60
71
break
@@ -82,6 +93,14 @@ type ReviewTxAction =
82
93
type : ReviewTxActionType . OperationsChanged
83
94
operations : ReviewTxState [ 'operations' ]
84
95
}
96
+ | {
97
+ type : ReviewTxActionType . CustomReceiverTitleChanged
98
+ customReceiverTitle : ReviewTxState [ 'customReceiverTitle' ]
99
+ }
100
+ | {
101
+ type : ReviewTxActionType . DetailsChanged
102
+ details : ReviewTxState [ 'details' ]
103
+ }
85
104
| {
86
105
type : ReviewTxActionType . OnSuccessChanged
87
106
onSuccess : ReviewTxState [ 'onSuccess' ]
@@ -95,6 +114,8 @@ export type ReviewTxState = {
95
114
unsignedTx : YoroiUnsignedTx | null
96
115
cbor : string | null
97
116
operations : Array < React . ReactNode > | null
117
+ customReceiverTitle : React . ReactNode | null
118
+ details : { title : string ; component : React . ReactNode } | null
98
119
onSuccess : ( ( signedTx : YoroiSignedTx ) => void ) | null
99
120
onError : ( ( ) => void ) | null
100
121
}
@@ -103,6 +124,8 @@ type ReviewTxActions = {
103
124
unsignedTxChanged : ( unsignedTx : ReviewTxState [ 'unsignedTx' ] ) => void
104
125
cborChanged : ( cbor : ReviewTxState [ 'cbor' ] ) => void
105
126
operationsChanged : ( operations : ReviewTxState [ 'operations' ] ) => void
127
+ customReceiverTitleChanged : ( customReceiverTitle : ReviewTxState [ 'customReceiverTitle' ] ) => void
128
+ detailsChanged : ( details : ReviewTxState [ 'details' ] ) => void
106
129
onSuccessChanged : ( onSuccess : ReviewTxState [ 'onSuccess' ] ) => void
107
130
onErrorChanged : ( onError : ReviewTxState [ 'onError' ] ) => void
108
131
}
@@ -111,6 +134,8 @@ const defaultState: ReviewTxState = Object.freeze({
111
134
unsignedTx : null ,
112
135
cbor : null ,
113
136
operations : null ,
137
+ customReceiverTitle : null ,
138
+ details : null ,
114
139
onSuccess : null ,
115
140
onError : null ,
116
141
} )
@@ -124,6 +149,8 @@ const initialReviewTxContext: ReviewTxContext = {
124
149
unsignedTxChanged : missingInit ,
125
150
cborChanged : missingInit ,
126
151
operationsChanged : missingInit ,
152
+ customReceiverTitleChanged : missingInit ,
153
+ detailsChanged : missingInit ,
127
154
onSuccessChanged : missingInit ,
128
155
onErrorChanged : missingInit ,
129
156
}
@@ -132,6 +159,8 @@ enum ReviewTxActionType {
132
159
UnsignedTxChanged = 'unsignedTxChanged' ,
133
160
CborChanged = 'cborChanged' ,
134
161
OperationsChanged = 'operationsChanged' ,
162
+ CustomReceiverTitleChanged = 'customReceiverTitleChanged' ,
163
+ DetailsChanged = 'detailsChanged' ,
135
164
OnSuccessChanged = 'onSuccessChanged' ,
136
165
OnErrorChanged = 'onErrorChanged' ,
137
166
}
0 commit comments