@propbinder/mobile-design 0.2.47 → 0.2.48
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.
|
@@ -13732,6 +13732,8 @@ class DsMobilePostDetailModalComponent {
|
|
|
13732
13732
|
// State management inputs (passed to modal base)
|
|
13733
13733
|
loading = false;
|
|
13734
13734
|
error;
|
|
13735
|
+
// Callback for toggling like on the main post
|
|
13736
|
+
onTogglePostLike;
|
|
13735
13737
|
// Callback for submitting a new comment
|
|
13736
13738
|
onSubmitComment;
|
|
13737
13739
|
// Callback for liking/unliking a comment
|
|
@@ -13869,6 +13871,25 @@ class DsMobilePostDetailModalComponent {
|
|
|
13869
13871
|
}
|
|
13870
13872
|
}, 100);
|
|
13871
13873
|
}
|
|
13874
|
+
/**
|
|
13875
|
+
* Handle post like/unlike toggle
|
|
13876
|
+
*/
|
|
13877
|
+
handlePostLikeToggle(ev) {
|
|
13878
|
+
const currentPost = this.post();
|
|
13879
|
+
// Update local state immediately for responsiveness
|
|
13880
|
+
this.post.set({
|
|
13881
|
+
...currentPost,
|
|
13882
|
+
isLiked: ev.active,
|
|
13883
|
+
likeCount: ev.count
|
|
13884
|
+
});
|
|
13885
|
+
// Call the callback if provided
|
|
13886
|
+
if (this.onTogglePostLike) {
|
|
13887
|
+
this.onTogglePostLike({
|
|
13888
|
+
postId: currentPost.postId,
|
|
13889
|
+
active: ev.active
|
|
13890
|
+
});
|
|
13891
|
+
}
|
|
13892
|
+
}
|
|
13872
13893
|
/**
|
|
13873
13894
|
* Handle comment like/unlike toggle
|
|
13874
13895
|
* @param comment The comment being liked/unliked
|
|
@@ -14081,7 +14102,7 @@ class DsMobilePostDetailModalComponent {
|
|
|
14081
14102
|
}
|
|
14082
14103
|
}
|
|
14083
14104
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DsMobilePostDetailModalComponent, deps: [{ token: DsMobileLightboxService }, { token: DsMobileBottomSheetService }], target: i0.ɵɵFactoryTarget.Component });
|
|
14084
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DsMobilePostDetailModalComponent, isStandalone: true, selector: "ds-mobile-post-detail-modal", inputs: { postData: "postData", currentUserName: "currentUserName", currentUserInitialsInput: "currentUserInitialsInput", loading: "loading", error: "error", onSubmitComment: "onSubmitComment", onToggleCommentLike: "onToggleCommentLike", onEditComment: "onEditComment", onDeleteComment: "onDeleteComment" }, viewQueries: [{ propertyName: "commentInput", first: true, predicate: ["commentInput"], descendants: true }], ngImport: i0, template: `
|
|
14105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DsMobilePostDetailModalComponent, isStandalone: true, selector: "ds-mobile-post-detail-modal", inputs: { postData: "postData", currentUserName: "currentUserName", currentUserInitialsInput: "currentUserInitialsInput", loading: "loading", error: "error", onTogglePostLike: "onTogglePostLike", onSubmitComment: "onSubmitComment", onToggleCommentLike: "onToggleCommentLike", onEditComment: "onEditComment", onDeleteComment: "onDeleteComment" }, viewQueries: [{ propertyName: "commentInput", first: true, predicate: ["commentInput"], descendants: true }], ngImport: i0, template: `
|
|
14085
14106
|
<ds-mobile-modal-base
|
|
14086
14107
|
[loading]="loading"
|
|
14087
14108
|
[error]="error"
|
|
@@ -14109,7 +14130,11 @@ class DsMobilePostDetailModalComponent {
|
|
|
14109
14130
|
|
|
14110
14131
|
<!-- Post actions -->
|
|
14111
14132
|
<div class="post-actions">
|
|
14112
|
-
<action-like
|
|
14133
|
+
<action-like
|
|
14134
|
+
[active]="post().isLiked || false"
|
|
14135
|
+
[count]="post().likeCount || 0"
|
|
14136
|
+
(likeClick)="handlePostLikeToggle($event)"
|
|
14137
|
+
/>
|
|
14113
14138
|
<action-comment [count]="post().commentCount || 0" (commentClick)="focusCommentInput()" />
|
|
14114
14139
|
</div>
|
|
14115
14140
|
</ds-mobile-section>
|
|
@@ -14251,7 +14276,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
14251
14276
|
|
|
14252
14277
|
<!-- Post actions -->
|
|
14253
14278
|
<div class="post-actions">
|
|
14254
|
-
<action-like
|
|
14279
|
+
<action-like
|
|
14280
|
+
[active]="post().isLiked || false"
|
|
14281
|
+
[count]="post().likeCount || 0"
|
|
14282
|
+
(likeClick)="handlePostLikeToggle($event)"
|
|
14283
|
+
/>
|
|
14255
14284
|
<action-comment [count]="post().commentCount || 0" (commentClick)="focusCommentInput()" />
|
|
14256
14285
|
</div>
|
|
14257
14286
|
</ds-mobile-section>
|
|
@@ -14358,6 +14387,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
14358
14387
|
type: Input
|
|
14359
14388
|
}], error: [{
|
|
14360
14389
|
type: Input
|
|
14390
|
+
}], onTogglePostLike: [{
|
|
14391
|
+
type: Input
|
|
14361
14392
|
}], onSubmitComment: [{
|
|
14362
14393
|
type: Input
|
|
14363
14394
|
}], onToggleCommentLike: [{
|
|
@@ -14531,6 +14562,7 @@ class DsMobilePostDetailModalService extends BaseModalService {
|
|
|
14531
14562
|
postData: postData,
|
|
14532
14563
|
loading: options?.loading ?? false,
|
|
14533
14564
|
error: options?.error,
|
|
14565
|
+
onTogglePostLike: options?.onTogglePostLike,
|
|
14534
14566
|
onSubmitComment: options?.onSubmitComment,
|
|
14535
14567
|
onToggleCommentLike: options?.onToggleCommentLike,
|
|
14536
14568
|
currentUserName: options?.currentUserName ?? '',
|