@stellar-expert/ui-framework 1.14.0 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,6 +73,7 @@
73
73
 
74
74
  tr {
75
75
  display: block;
76
+ padding: .4em;
76
77
  }
77
78
 
78
79
  td {
@@ -19,6 +19,17 @@ export const SystemDialog = React.memo(function SystemDialog() {
19
19
 
20
20
  useEffect(() => {
21
21
  window.alert = function (content, options = {title: defaultAlertTitle, icon: 'info'}) {
22
+ function close() {
23
+ setContent(undefined)
24
+ window.removeEventListener('keydown', keyHandler, true)
25
+ }
26
+
27
+ function keyHandler(e) {
28
+ if (e.keyCode === 27 || e.keyCode === 13) {
29
+ close()
30
+ }
31
+ }
32
+
22
33
  setContent(<>
23
34
  <h2>
24
35
  <i className={'inline-block icon-' + (options.icon || 'info')} style={{marginLeft: '-0.2em'}}/>{' '}
@@ -26,7 +37,8 @@ export const SystemDialog = React.memo(function SystemDialog() {
26
37
  </h2>
27
38
  <div className="space">{content}</div>
28
39
  </>)
29
- setButtons([null, <Button block autoFocus onClick={() => setContent(undefined)}>Ok</Button>])
40
+ setButtons([null, <Button block autoFocus onClick={close}>Ok</Button>])
41
+ window.addEventListener('keydown', keyHandler, true)
30
42
  }
31
43
  window.confirm = function (content, options = {
32
44
  title: defaultConfirmTitle,
@@ -38,6 +50,15 @@ export const SystemDialog = React.memo(function SystemDialog() {
38
50
  function setResult(result) {
39
51
  setContent(undefined)
40
52
  resolve(result)
53
+ window.removeEventListener('keydown', keyHandler, true)
54
+ }
55
+
56
+ function keyHandler(e) {
57
+ if (e.keyCode === 27) {
58
+ setResult(false)
59
+ } else if (e.keyCode === 13) {
60
+ setResult(true)
61
+ }
41
62
  }
42
63
 
43
64
  setContent(<>
@@ -50,6 +71,8 @@ export const SystemDialog = React.memo(function SystemDialog() {
50
71
  <Button block autoFocus onClick={() => setResult(true)}>{options.confirmTitle || defaultConfirmCaption}</Button>,
51
72
  <Button block outline onClick={() => setResult(false)}>{options.cancelTitle || defaultCancelCaption}</Button>
52
73
  ])
74
+
75
+ window.addEventListener('keydown', keyHandler, true)
53
76
  })
54
77
  }
55
78
  }, [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar-expert/ui-framework",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "StellarExpert shared UI components library",
5
5
  "main": "index.js",
6
6
  "module": "./index.js",
@@ -923,7 +923,7 @@ const typeMapping = {
923
923
  liquidityPoolDeposit: DepositLiquidityDescriptionView,
924
924
  liquidityPoolWithdraw: WithdrawLiquidityDescriptionView,
925
925
  invokeHostFunction: InvokeHostFunctionView,
926
- extendFootprintTTL: ExtendFootprintTTLView,
926
+ extendFootprintTtl: ExtendFootprintTTLView,
927
927
  restoreFootprint: RestoreFootprintView
928
928
  }
929
929
 
package/tx/op-icon.js CHANGED
@@ -44,7 +44,7 @@ const opIconMapping = {
44
44
  liquidityPoolDeposit: 'droplet',
45
45
  liquidityPoolWithdraw: 'droplet-half',
46
46
  invokeHostFunction: 'flash',
47
- bumpFootprintExpiration: 'upload',
47
+ extendFootprintTtl: 'upload',
48
48
  restoreFootprint: 'upload'
49
49
  }
50
50
 
@@ -186,7 +186,7 @@ export default class TxMatcher {
186
186
  case 'bumpSequence':
187
187
  case 'endSponsoringFutureReserves':
188
188
  case 'clawbackClaimableBalance':
189
- case 'bumpFootprintExpiration':
189
+ case 'extendFootprintTtl':
190
190
  case 'restoreFootprint':
191
191
  matchingProps.account = new Set()
192
192
  break