@ludo.ninja/components 2.3.84 → 2.3.85
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
|
-
|
|
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, "
|
|
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
|
};
|
|
@@ -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:
|
|
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
|
|
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:
|
|
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:
|
|
31
|
+
caption: err.cause?.message || error.message,
|
|
31
32
|
} : {
|
|
32
33
|
type: type_1.alertVariants.error,
|
|
33
34
|
caption: 'Internal server error',
|