@ludo.ninja/components 2.1.45 → 2.1.47
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.
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.GlobalLayout = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const envLine_1 = __importDefault(require("@ludo.ninja/ui/build/components/envLine"));
|
|
9
|
-
|
|
9
|
+
const initializer_1 = require("../components/sidebar/initializer");
|
|
10
10
|
const useAuthVerification_1 = require("../modules/user/auth/useAuthVerification");
|
|
11
11
|
const profileDataInitialization_1 = require("../modules/user/profileData/profileDataInitialization");
|
|
12
12
|
const env_1 = require("../store/env");
|
|
@@ -28,6 +28,6 @@ const GlobalLayout = ({ children }) => {
|
|
|
28
28
|
(0, useAuthVerification_1.useAuthVerification)();
|
|
29
29
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
30
30
|
const envValue = NEXT_PUBLIC_ENV_VALUE !== 'prod' ? NEXT_PUBLIC_ENV_VALUE : '';
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(profileDataInitialization_1.ProfileDataInitialization, {}), (0, jsx_runtime_1.jsx)(envLine_1.default, { isNeedToShow: envValue }), (0, jsx_runtime_1.jsx)(globalStyles_1.default, {}), children, (0, jsx_runtime_1.jsx)(CreatorNotifications_1.CreatorNotifications, {}), (0, jsx_runtime_1.jsx)(screen_1.InitializeAppHeight, {}), (0, jsx_runtime_1.jsx)(SubscriberNotifications_1.SubscriberNotification, {}), (0, jsx_runtime_1.jsx)(Overlay_1.default, {}), (0, jsx_runtime_1.jsx)(Alert_1.default, {}), (0, jsx_runtime_1.jsx)(Modal_1.default, {}), (0, jsx_runtime_1.jsx)(ModalSidebar_1.default, {}), (0, jsx_runtime_1.jsx)(CreatorModalSidebarPortal_1.CreatorModalSidebarPortal, {}), (0, jsx_runtime_1.jsx)(sessionScroll_1.DeleteScrollStateInterceptor, {})] }));
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(profileDataInitialization_1.ProfileDataInitialization, {}), (0, jsx_runtime_1.jsx)(envLine_1.default, { isNeedToShow: envValue }), (0, jsx_runtime_1.jsx)(globalStyles_1.default, {}), children, (0, jsx_runtime_1.jsx)(CreatorNotifications_1.CreatorNotifications, {}), (0, jsx_runtime_1.jsx)(screen_1.InitializeAppHeight, {}), (0, jsx_runtime_1.jsx)(SubscriberNotifications_1.SubscriberNotification, {}), (0, jsx_runtime_1.jsx)(Overlay_1.default, {}), (0, jsx_runtime_1.jsx)(initializer_1.SidebarInitializer, {}), (0, jsx_runtime_1.jsx)(Alert_1.default, {}), (0, jsx_runtime_1.jsx)(Modal_1.default, {}), (0, jsx_runtime_1.jsx)(ModalSidebar_1.default, {}), (0, jsx_runtime_1.jsx)(CreatorModalSidebarPortal_1.CreatorModalSidebarPortal, {}), (0, jsx_runtime_1.jsx)(sessionScroll_1.DeleteScrollStateInterceptor, {})] }));
|
|
32
32
|
};
|
|
33
33
|
exports.GlobalLayout = GlobalLayout;
|
|
@@ -137,11 +137,12 @@ const StyledCardContent = styled_components_1.default.div `
|
|
|
137
137
|
font-size: 12px;
|
|
138
138
|
line-height: 16px;
|
|
139
139
|
font-family: ${vars_1.poppinsFontVarCss.css};
|
|
140
|
-
margin-top:
|
|
140
|
+
margin-top: 12px;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
|
|
145
146
|
.date {
|
|
146
147
|
color: #b0b2c0;
|
|
147
148
|
font-size: 12px;
|
|
@@ -153,6 +154,11 @@ const StyledCardContent = styled_components_1.default.div `
|
|
|
153
154
|
height: auto;
|
|
154
155
|
padding: 12px;
|
|
155
156
|
}
|
|
157
|
+
@media (max-width: 1199px) {
|
|
158
|
+
.categoryFooter {
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
156
162
|
|
|
157
163
|
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
158
164
|
padding: ${(0, _4k_1.adaptiveValueCalc)(12)} ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
@@ -172,7 +178,7 @@ const StyledCardContent = styled_components_1.default.div `
|
|
|
172
178
|
.categoryName {
|
|
173
179
|
font-size: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
174
180
|
line-height: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
175
|
-
margin-top: ${(0, _4k_1.adaptiveValueCalc)(
|
|
181
|
+
margin-top: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
176
182
|
}
|
|
177
183
|
}
|
|
178
184
|
}
|
|
@@ -189,7 +195,7 @@ const SImage = styled_components_1.default.img `
|
|
|
189
195
|
object-fit: cover;
|
|
190
196
|
`;
|
|
191
197
|
const OpportunityImage = ({ src, alt }) => {
|
|
192
|
-
return ((0, jsx_runtime_1.jsx)(ImageInterceptor_1.ImageInterceptor, { className:
|
|
198
|
+
return ((0, jsx_runtime_1.jsx)(ImageInterceptor_1.ImageInterceptor, { className: "imgWrapper", children: (0, jsx_runtime_1.jsx)(SImage, { src: src, alt: alt, width: 252, height: 152 }) }));
|
|
193
199
|
};
|
|
194
200
|
const OpportunityLike = ({ isDefaultLiked, opportunityId, toolsForRemove, }) => {
|
|
195
201
|
const [isLiked, setIsLiked] = (0, react_1.useState)(isDefaultLiked);
|
|
@@ -201,7 +207,7 @@ const OpportunityLike = ({ isDefaultLiked, opportunityId, toolsForRemove, }) =>
|
|
|
201
207
|
try {
|
|
202
208
|
if (isLiked) {
|
|
203
209
|
await dislikeOpportunityAction({ opportunityId });
|
|
204
|
-
toolsForRemove?.(
|
|
210
|
+
toolsForRemove?.("opportunity");
|
|
205
211
|
setIsLiked(false);
|
|
206
212
|
}
|
|
207
213
|
else {
|
|
@@ -214,8 +220,8 @@ const OpportunityLike = ({ isDefaultLiked, opportunityId, toolsForRemove, }) =>
|
|
|
214
220
|
}
|
|
215
221
|
setIsLoadingMutation(false);
|
|
216
222
|
};
|
|
217
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLiked ?
|
|
218
|
-
pointerEvents: isLoadingMutation ?
|
|
223
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLiked ? "liked" : ""}`, onClick: handleLikeToggle, style: {
|
|
224
|
+
pointerEvents: isLoadingMutation ? "none" : "unset",
|
|
219
225
|
}, children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, {}) }));
|
|
220
226
|
};
|
|
221
227
|
const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
@@ -229,13 +235,13 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
|
229
235
|
}));
|
|
230
236
|
const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
|
|
231
237
|
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
232
|
-
return ((0, jsx_runtime_1.jsxs)(SWrapperLink, { href: opportunity.projectUrl || opportunity.shareLink ||
|
|
238
|
+
return ((0, jsx_runtime_1.jsxs)(SWrapperLink, { href: opportunity.projectUrl || opportunity.shareLink || "", target: "_blank", children: [(0, jsx_runtime_1.jsxs)(StyledCardHead, { children: [(0, jsx_runtime_1.jsx)(OpportunityImage, { alt: opportunity.name, src: opportunity.media
|
|
233
239
|
? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}`
|
|
234
|
-
:
|
|
240
|
+
: "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
|
|
235
241
|
e.stopPropagation();
|
|
236
242
|
e.preventDefault();
|
|
237
243
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: () => {
|
|
238
244
|
openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }));
|
|
239
|
-
}, children: (0, jsx_runtime_1.jsx)(ShareIcon_1.ShareIcon, {}) }), !isProd() && ((0, jsx_runtime_1.jsx)(OpportunityLike, { isDefaultLiked: !!(isSignedIn && opportunity.liked), opportunityId: opportunity.opportunityId, toolsForRemove: toolsForRemove }))] }) })] }), (0, jsx_runtime_1.jsxs)(StyledCardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContent", children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContentWrapper", children: [(0, jsx_runtime_1.jsx)("
|
|
245
|
+
}, children: (0, jsx_runtime_1.jsx)(ShareIcon_1.ShareIcon, {}) }), !isProd() && ((0, jsx_runtime_1.jsx)(OpportunityLike, { isDefaultLiked: !!(isSignedIn && opportunity.liked), opportunityId: opportunity.opportunityId, toolsForRemove: toolsForRemove }))] }) })] }), (0, jsx_runtime_1.jsxs)(StyledCardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContent", children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContentWrapper", children: [(0, jsx_runtime_1.jsx)("p", { className: `secondName`, children: opportunity.name }), (0, jsx_runtime_1.jsx)("p", { className: `mainName`, children: opportunity.description }), (0, jsx_runtime_1.jsx)("p", { className: `categoryName`, children: opportunity.categoryName })] }), (0, jsx_runtime_1.jsx)(OpportunityDropDown_1.OpportunityDropDown, { opportunity: opportunity })] }), (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", className: `categoryFooter`, children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: data_1.default.opportunity }), opportunity.activeUntil && ((0, jsx_runtime_1.jsx)("div", { className: "date", children: `till ${(0, moment_1.default)(opportunity.activeUntil).format("LL")}` }))] })] })] }));
|
|
240
246
|
};
|
|
241
247
|
exports.OpportunityCard = OpportunityCard;
|