on master help sign in
Allow displaying arbitrary text on tx submission page
commitef67decc42ca56e16be3d617b470a31d46b77b16 authorFang <git@fang.io> dateThu 25 Apr 2019, 22:51 (8 years ago) parent836d5a6
2 files changed+20−4
src/bridge/components/StatelessTransaction.js+7−4 src/bridge/views/SentTransaction.js+13
src/bridge/components/StatelessTransaction.js+7−4
@@ -93,12 +93,15 @@ class StatelessTransaction extends React.Component {
9393 props.setTxnHashCursor(sent)
9494 props.popRoute()
9595
96+ let routeData = {};
9697 if (props.networkSeed) {
97− props.setNetworkSeedCache(props.networkSeed)
98− props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, {promptKeyfile: true})
99− } else {
100− props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
98+ props.setNetworkSeedCache(props.networkSeed);
99+ routeData.promptKeyfile = true;
100+ }
101+ if (props.promptText) {
102+ routeData.promptText = props.promptText;
101103 }
104+ props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION, routeData);
102105 })
103106 .catch(err => {
104107 if (err.map) {
src/bridge/views/SentTransaction.js+13
@@ -126,6 +126,7 @@ const SentTransaction = (props) => {
126126 const { setPointCursor, pointCursor } = props
127127
128128 const promptKeyfile = props.routeData && props.routeData.promptKeyfile
129+ const promptText = props.routeData && props.routeData.promptText
129130
130131 const w3 = web3.matchWith({
131132 Nothing: _ => { throw BRIDGE_ERROR.MISSING_WEB3 },
@@ -147,6 +148,17 @@ const SentTransaction = (props) => {
147148 />
148149 })
149150
151+ let text;
152+ if (promptText) {
153+ text = (
154+ <Row>
155+ <Col>
156+ <p>{promptText}</p>
157+ </Col>
158+ </Row>
159+ )
160+ }
161+
150162 const ok =
151163 <Row>
152164 <Col>
@@ -187,6 +199,7 @@ const SentTransaction = (props) => {
187199 return (
188200 <div>
189201 { body }
202+ { text }
190203 { ok }
191204 { keyfile }
192205 </div>