@ludo.ninja/components 2.3.84 → 2.3.86

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.
@@ -34,7 +34,8 @@ const useFetchMyActivityStreak = () => {
34
34
  });
35
35
  },
36
36
  onError: (err) => {
37
- if (err.cause?.extensions?.classification !== 'NOT_FOUND') {
37
+ const error = err;
38
+ if (error.cause?.extensions?.classification !== 'NOT_FOUND') {
38
39
  openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
39
40
  }
40
41
  resetUserStreak();
@@ -1,4 +1,4 @@
1
1
  export declare const useGetOpportunities: (availableProfileId: string) => {
2
- opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "name" | "views" | "createdAt" | "shareLink" | "blockchain" | "description" | "collection" | "liked" | "opportunityId" | "projectId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "projectBlockchain" | "projectContract" | "projectName" | "projectSlug" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "blockchains" | "minWalletValue" | "maxWalletValue" | "geolocations" | "subscribed" | "participantsLimit" | "availablePlacesForAirdrop" | "slug">>[];
2
+ opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "views" | "createdAt" | "shareLink" | "blockchain" | "name" | "description" | "collection" | "liked" | "opportunityId" | "projectId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "projectBlockchain" | "projectContract" | "projectName" | "projectSlug" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "blockchains" | "minWalletValue" | "maxWalletValue" | "geolocations" | "subscribed" | "participantsLimit" | "availablePlacesForAirdrop" | "slug">>[];
3
3
  isLoadingOpportunities: boolean;
4
4
  };
@@ -11,6 +11,7 @@ interface Props {
11
11
  isNeedShowError: boolean;
12
12
  message: string | undefined;
13
13
  };
14
+ disabled?: boolean;
14
15
  }
15
16
  declare const Input: React.FC<Props>;
16
17
  export default Input;
@@ -13,60 +13,51 @@ const colors_2 = require("../../../styles/colors");
13
13
  const typography_1 = require("../../../styles/typography");
14
14
  const ErrorLabel_1 = __importDefault(require("../ErrorLabel"));
15
15
  const vars_1 = require("../../../fonts/vars");
16
- // Styles
17
16
  exports.StyledInput = styled_components_1.default.input `
18
- font-family: ${vars_1.dmsansFontVarCss.css};
19
- ${typography_1.MainText};
20
- width: 100%;
21
- height: 46px;
22
- border-radius: 6px;
23
- border: 1px solid
17
+ font-family: ${vars_1.dmsansFontVarCss.css};
18
+ ${typography_1.MainText};
19
+ width: 100%;
20
+ height: 46px;
21
+ border-radius: 6px;
22
+ border: 1px solid
24
23
  ${(props) => (props.status ? colors_2.ProgressColorMinimum : colors_2.BorderColorLight)};
25
- background: ${colors_2.WhiteColor};
26
- color: ${colors_2.BlackColor};
27
- outline: none;
28
- padding: 12px;
24
+ background: ${colors_2.WhiteColor};
25
+ color: ${colors_2.BlackColor};
26
+ outline: none;
27
+ padding: 12px;
29
28
 
30
- ::placeholder {
31
- color: ${colors_2.TextGrayColor};
32
- opacity: 1;
33
- }
29
+ ::placeholder {
30
+ color: ${colors_2.TextGrayColor};
31
+ opacity: 1;
32
+ }
34
33
 
35
- :-ms-input-placeholder {
36
- color: ${colors_2.TextGrayColor};
37
- }
34
+ :-ms-input-placeholder {
35
+ color: ${colors_2.TextGrayColor};
36
+ }
38
37
 
39
- ::-ms-input-placeholder {
40
- color: ${colors_2.TextGrayColor};
41
- }
38
+ ::-ms-input-placeholder {
39
+ color: ${colors_2.TextGrayColor};
40
+ }
42
41
 
43
- :disabled {
44
- background: ${colors_1.DisabledLightGrayColor};
45
- color: ${colors_1.DisabledGrayColor};
46
- }
42
+ :disabled {
43
+ background: ${colors_1.DisabledLightGrayColor};
44
+ color: ${colors_1.DisabledGrayColor};
45
+ }
47
46
 
48
- // :focus {
49
- // transition: border-color 0.3s ease-in-out;
50
- // border: 2px solid ${(props) => (props.status ? '#F4205F' : '#C1C8DE')};
51
- // }
52
- // :hover {
53
- // transition: border-color 0.3s ease-in-out;
54
- // border: 2px solid ${(props) => (props.status ? '#F4205F' : '#C1C8DE')};
55
- // }
56
- ${ScreenWidth_1.mediaQuery.minWidthFourK} {
57
- height: ${(0, _4k_1.adaptiveValueCalc)(46)};
58
- border-radius: ${(0, _4k_1.adaptiveValueCalc)(6)};
59
- border: ${(0, _4k_1.adaptiveValueCalc)(1)} solid
60
- ${(props) => (props.status ? colors_2.ProgressColorMinimum : colors_2.BorderColorLight)};
61
- padding: ${(0, _4k_1.adaptiveValueCalc)(12)};
62
- }
47
+ ${ScreenWidth_1.mediaQuery.minWidthFourK} {
48
+ height: ${(0, _4k_1.adaptiveValueCalc)(46)};
49
+ border-radius: ${(0, _4k_1.adaptiveValueCalc)(6)};
50
+ border: ${(0, _4k_1.adaptiveValueCalc)(1)} solid
51
+ ${(props) => (props.status ? colors_2.ProgressColorMinimum : colors_2.BorderColorLight)};
52
+ padding: ${(0, _4k_1.adaptiveValueCalc)(12)};
53
+ }
63
54
  `;
64
- const Input = ({ data, register, error }) => {
55
+ const Input = ({ data, register, error, disabled }) => {
65
56
  const renderError = () => {
66
57
  if (error.isNeedShowError) {
67
58
  return (0, jsx_runtime_1.jsx)(ErrorLabel_1.default, { children: error.message });
68
59
  }
69
60
  };
70
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.StyledInput, { ref: register.ref, onChange: register.onChange, onBlur: register.onBlur, name: register.name, id: data.name, autoComplete: "off", placeholder: data.placeHolder, status: error.isNeedShowError }), renderError()] }));
61
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.StyledInput, { ref: register.ref, onChange: register.onChange, onBlur: register.onBlur, name: register.name, id: data.name, autoComplete: "off", placeholder: data.placeHolder, status: error.isNeedShowError, disabled: disabled }), renderError()] }));
71
62
  };
72
63
  exports.default = Input;
@@ -8,7 +8,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
9
  const ScreenWidth_1 = require("../../styles/ScreenWidth");
10
10
  const colors_1 = require("../../styles/colors");
11
- const scale_1 = require("../adaptive/scale");
12
11
  const screen_1 = require("../screen");
13
12
  const styled_components_1 = __importDefault(require("styled-components"));
14
13
  const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
@@ -22,6 +21,8 @@ const SWrapperIcon = styled_components_1.default.div `
22
21
  display: flex;
23
22
  align-items: center;
24
23
  justify-content: center;
24
+ width: 20px;
25
+ height: 20px;
25
26
 
26
27
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
27
28
  margin-left: ${(0, _4k_1.adaptiveValueCalc)(5)};
@@ -41,6 +42,6 @@ const CopyButton = ({ value, style, children, }) => {
41
42
  const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
42
43
  if (!value)
43
44
  return (0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.BlackColor, children: "Unknown" });
44
- return ((0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "center", onClick: handleCopy, style: style, children: [children, (0, jsx_runtime_1.jsx)(SWrapperIcon, { children: !isCopied ? ((0, jsx_runtime_1.jsx)(copy_icon_new_svg_1.default, { width: 20, height: 20, style: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }) })) : ((0, jsx_runtime_1.jsx)(copied_svg_1.default, { width: 20, height: 20, style: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }) })) })] }));
45
+ return ((0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "center", onClick: handleCopy, style: style, children: [children, (0, jsx_runtime_1.jsx)(SWrapperIcon, { children: !isCopied ? ((0, jsx_runtime_1.jsx)(copy_icon_new_svg_1.default, { width: '100%', height: '100%' })) : ((0, jsx_runtime_1.jsx)(copied_svg_1.default, { width: '100%', height: '100%' })) })] }));
45
46
  };
46
47
  exports.CopyButton = CopyButton;
@@ -13,7 +13,8 @@ var ServerErrorType;
13
13
  ServerErrorType["INTERNAL_ERROR"] = "INTERNAL_ERROR";
14
14
  })(ServerErrorType || (exports.ServerErrorType = ServerErrorType = {}));
15
15
  const getErrorAlertProps = (error) => {
16
- const errorExtensions = error.cause?.extensions;
16
+ const err = error;
17
+ const errorExtensions = err.cause?.extensions;
17
18
  switch (errorExtensions?.classification) {
18
19
  case ServerErrorType.BAD_REQUEST:
19
20
  case ServerErrorType.UNAUTHORIZED:
@@ -21,13 +22,13 @@ const getErrorAlertProps = (error) => {
21
22
  case ServerErrorType.NOT_FOUND:
22
23
  return {
23
24
  type: type_1.alertVariants.warning,
24
- caption: error.cause?.message || error.message,
25
+ caption: err.cause?.message || error.message,
25
26
  };
26
27
  case ServerErrorType.INTERNAL_ERROR:
27
28
  default:
28
29
  return !(0, env_1.isProdFromEnvForServer)() ? {
29
30
  type: type_1.alertVariants.error,
30
- caption: error.cause?.message || error.message,
31
+ caption: err.cause?.message || error.message,
31
32
  } : {
32
33
  type: type_1.alertVariants.error,
33
34
  caption: 'Internal server error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.84",
3
+ "version": "2.3.86",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",