@antscorp/antsomi-ui 1.3.5-beta.562 → 1.3.5-beta.563

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.
@@ -8,7 +8,7 @@ interface RequestAccessProps {
8
8
  sentSubTitle?: string;
9
9
  requestText?: string;
10
10
  switchAccountText?: string;
11
- onRequest?: (message: string) => Promise<void>;
11
+ onRequest?: (message: string) => Promise<any>;
12
12
  onSwitchAccount?: () => void;
13
13
  }
14
14
  export declare const RequestAccess: React.FC<RequestAccessProps>;
@@ -5,6 +5,7 @@ import { RequestAccessStyled } from './styled';
5
5
  // Translate
6
6
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
7
7
  import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
8
+ import { BlockIcon } from '../../icons';
8
9
  const { t } = i18nInstance;
9
10
  export const RequestAccess = props => {
10
11
  const { className, placeholder = t(translations.requestAccess.placeholder), deniedTitle = t(translations.requestAccess.deniedTitle), deniedSubTitle = t(translations.requestAccess.deniedSubTitle), sentTitle = t(translations.requestAccess.sentTitle), sentSubTitle = t(translations.requestAccess.sentSubTitle), requestText = t(translations.requestAccess.requestText), switchAccountText = t(translations.requestAccess.switchAccountText), onRequest, onSwitchAccount, } = props;
@@ -18,10 +19,15 @@ export const RequestAccess = props => {
18
19
  try {
19
20
  setIsLoading(true);
20
21
  onRequest(message)
21
- .then(() => setIsSentRequest(true))
22
+ .then(data => {
23
+ if (data) {
24
+ setIsSentRequest(true);
25
+ }
26
+ })
22
27
  .finally(() => setIsLoading(false));
23
28
  }
24
29
  catch (error) {
30
+ // the onRequest(message) callback is called in try (have not call again)
25
31
  setIsSentRequest(true);
26
32
  }
27
33
  }
@@ -33,7 +39,9 @@ export const RequestAccess = props => {
33
39
  return (React.createElement(RequestAccessStyled, { className: `antsomi-request-access ${className || ''}` },
34
40
  React.createElement(Flex, { vertical: true, gap: 20 },
35
41
  React.createElement(Flex, { vertical: true, gap: 5 },
36
- React.createElement(Typography.Text, { className: "denied-title" }, isSentRequest ? sentTitle : deniedTitle),
42
+ React.createElement(Typography.Text, { className: "denied-title" }, isSentRequest ? (sentTitle) : (React.createElement(React.Fragment, null,
43
+ deniedTitle,
44
+ React.createElement(BlockIcon, null)))),
37
45
  React.createElement(Typography.Text, { className: "denied-sub-title" }, isSentRequest ? sentSubTitle : deniedSubTitle)),
38
46
  !isSentRequest ? (React.createElement(TextArea, { style: { resize: 'none' }, placeholder: placeholder, ref: messageRef })) : null,
39
47
  React.createElement(Flex, { className: "action-buttons", gap: 10 },
@@ -13,10 +13,17 @@ export const RequestAccessStyled = styled.div `
13
13
  width: 350px;
14
14
 
15
15
  .denied-title {
16
+ display: inline-flex;
17
+ gap: 5px;
18
+
16
19
  font-size: 20px;
17
20
  line-height: 24px;
18
21
  font-weight: 700;
19
22
  color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.orange6};
23
+
24
+ & > svg {
25
+ color: ${globalToken === null || globalToken === void 0 ? void 0 : globalToken.bw5};
26
+ }
20
27
  }
21
28
 
22
29
  .denied-sub-title {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.562",
3
+ "version": "1.3.5-beta.563",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",