Commit f702274 1 parent 573188c commit f702274 Copy full SHA for f702274
File tree 1 file changed +19
-3
lines changed
MiniSpace.Web/src/Astravent.Web.Wasm/Pages/Posts/Components
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 1
1
@using Astravent .Web .Wasm .Pages .Reports .Dialogs
2
2
@inject NavigationManager NavigationManager
3
3
4
+ <!-- Post Card -->
4
5
<MudCard Class =" post-card mb-4" Elevation =" 2" >
5
6
<MudCardHeader >
6
7
<!-- Avatar with @onclick event to navigate to user profile -->
16
17
</MudCardHeader >
17
18
18
19
<MudCardContent >
20
+ <!-- Post Content -->
19
21
<MudMarkdown Value =" @Post.TextContent" />
20
22
21
- @if (Post .MediaFiles != null && Post .MediaFiles .Any () )
23
+ @if (Post .MediaFiles != null && Post .MediaFiles .Count () == 1 )
22
24
{
23
25
<MudImage Src =" @Post.MediaFiles.First()" Alt =" Post image" Class =" mt-2" Style =" width: 100%;" />
24
26
}
25
-
27
+ else if (Post .MediaFiles != null && Post .MediaFiles .Any ())
28
+ {
29
+ <MudCarousel Class =" mt-2" Style =" height:400px;" TData =" string" AutoCycle =" false" >
30
+ @foreach ( var image in Post .MediaFiles )
31
+ {
32
+ <MudCarouselItem Transition =" Transition.Custom" CustomTransitionEnter =" bounceIn" CustomTransitionExit =" bounceOut" >
33
+ <div class =" d-flex" style =" width :100% ;" >
34
+ <MudImage Src =" @image" Alt =" Post image" Style =" width: 100%; " />
35
+ </div >
36
+ </MudCarouselItem >
37
+ }
38
+ </MudCarousel >
39
+ }
40
+ <!-- Reactions Summary -->
26
41
@if (ReactionsSummaries .TryGetValue (Post .Id , out var reactionsSummary ))
27
42
{
28
43
<ReactionsSummary Summary =" @reactionsSummary" />
31
46
32
47
<MudDivider />
33
48
49
+ <!-- Card Actions -->
34
50
<MudCardActions Class =" d-flex justify-space-between" >
35
51
<MudButton Variant =" Variant.Text" Color =" Color.Primary" OnClick =" @(() => OnViewPost.InvokeAsync(Post.Id))" >
36
52
<MudIcon Icon =" @Icons.Material.Filled.Visibility" Class =" mr-1" /> View
72
88
</MudMenuItem >
73
89
</ChildContent >
74
90
</MudMenu >
75
-
76
91
</MudCardActions >
77
92
93
+ <!-- Comment Section -->
78
94
@if (isCommentSectionVisible )
79
95
{
80
96
<CommentSection Post =" Post" OnSubmitComment =" OnSubmitComment" />
You can’t perform that action at this time.
0 commit comments