@broxus/evm-connect 1.6.0 → 1.7.1

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.
@@ -86,6 +86,18 @@
86
86
  color: var(--close-hover-color, #383838);
87
87
  }
88
88
 
89
+ .evm-modal-page {
90
+ box-sizing: border-box;
91
+ overflow-y: clip;
92
+ padding-right: var(--global-scroll-width, 17px);
93
+ }
94
+
95
+ .tvm-modal-page body {
96
+ overflow: hidden;
97
+ overflow: clip;
98
+ width: 100%;
99
+ }
100
+
89
101
  /* WalletConnect Modal */
90
102
  .wcm-overlay {
91
103
  --wcm-z-index: calc(var(--modal-z-index) + 20);
@@ -1,5 +1,5 @@
1
1
  import { Close } from '@broxus/react-components';
2
- import { Component, Drawer, Modal, Text } from '@broxus/react-uikit';
2
+ import { Component, Drawer, Modal, Text, addModalMode, removeModalMode } from '@broxus/react-uikit';
3
3
  import classNames from 'classnames';
4
4
  import { observer } from 'mobx-react-lite';
5
5
  import * as React from 'react';
@@ -12,11 +12,18 @@ export const EvmConnectDialog = observer(({ className, open, type, onClose }) =>
12
12
  const intl = useIntl();
13
13
  const walletProviders = useEvmWalletProviders();
14
14
  const onClosed = () => {
15
+ removeModalMode('evm-modal-page');
15
16
  walletProviders.reset();
16
17
  };
17
18
  const close = () => {
18
19
  onClose?.();
19
20
  };
21
+ React.useEffect(() => {
22
+ if (open) {
23
+ addModalMode('evm-modal-page');
24
+ }
25
+ }, [open]);
26
+ React.useEffect(() => () => onClosed(), []);
20
27
  if (type === 'drawer') {
21
28
  return (React.createElement(Drawer, { className: className, destroyOnClose: true, keyboard: !walletProviders.connectingProvider, maskClosable: !walletProviders.connectingProvider, motion: {
22
29
  motionLeave: true,
@@ -2,10 +2,10 @@ import * as React from 'react';
2
2
  import { EvmWalletService, type EvmWalletServiceCtorParams } from '../services';
3
3
  export declare const EvmWalletServiceContext: React.Context<EvmWalletService | null>;
4
4
  export declare function useEvmWalletService(): EvmWalletService;
5
- type EvmWalletProviderProps = React.PropsWithChildren<{
5
+ interface EvmWalletProviderProps {
6
6
  agreementsNote?: React.ReactNode;
7
7
  params?: EvmWalletServiceCtorParams;
8
8
  wallet?: EvmWalletService;
9
- }>;
10
- export declare function EvmWalletServiceProvider({ agreementsNote, children, params, wallet, }: EvmWalletProviderProps): React.JSX.Element;
9
+ }
10
+ export declare function EvmWalletServiceProvider({ agreementsNote, children, params, wallet, }: React.PropsWithChildren<EvmWalletProviderProps>): React.JSX.Element;
11
11
  export {};