on master help sign in
Allow displaying arbitrary text on tx submission page
ef67decFang
src/bridge/components/StatelessTransaction.js+7−4
@@ -93,12 +93,15 @@ class StatelessTransaction extends React.Component {
93 props.setTxnHashCursor(sent)
93 props.setTxnHashCursor(sent)
94 props.popRoute()
94 props.popRoute()
95
95
96+ let routeData = {};
96 if (props.networkSeed) {
97 if (props.networkSeed) {
97− props.setNetworkSeedCache(props.networkSeed)
98+ props.setNetworkSeedCache(props.networkSeed);
98− props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99+ routeData.promptKeyfile = true;
99− } else {
100+ }
100− props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
101+ if (props.promptText) {
102+ routeData.promptText = props.promptText;
101 }
103 }
104+ props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, routeData);
102 })
105 })
103 .catch(err => {
106 .catch(err => {
104 if (err.map) {
107 if (err.map) {
src/bridge/views/SentTransaction.js+13
@@ -126,6 +126,7 @@ const SentTransaction = (props) => {
126 const { setPointCursor, pointCursor } = props
126 const { setPointCursor, pointCursor } = props
127
127
128 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
128 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
129+ const promptText = props.routeData && props.routeData.promptText
129
130
130 const w3 = web3.matchWith({
131 const w3 = web3.matchWith({
131 Nothing: _ => { throw BRIDGE_ERROR.MISSING_WEB3 },
132 Nothing: _ => { throw BRIDGE_ERROR.MISSING_WEB3 },
@@ -147,6 +148,17 @@ const SentTransaction = (props) => {
147 />
148 />
148 })
149 })
149
150
151+ let text;
152+ if (promptText) {
153+ text = (
154+ <Row>
155+ <Col>
156+ <p>{promptText}</p>
157+ </Col>
158+ </Row>
159+ )
160+ }
161+
150 const ok =
162 const ok =
151 <Row>
163 <Row>
152 <Col>
164 <Col>
@@ -187,6 +199,7 @@ const SentTransaction = (props) => {
187 return (
199 return (
188 <div>
200 <div>
189 { body }
201 { body }
202+ { text }
190 { ok }
203 { ok }
191 { keyfile }
204 { keyfile }
192 </div>
205 </div>