Skip to content

Commit aacf356

Browse files
committed
Layout improvements
1 parent 162665f commit aacf356

10 files changed

Lines changed: 44 additions & 25 deletions

File tree

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Home/Components/EventData.razor

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,29 @@
1010
@foreach(var timeSlot in State.Value.EventMetaData)
1111
{
1212
<MudListSubheader Class="pb-0 pl-1 border-b border-solid mud-border-primary">
13-
<h2>@timeSlot.From.ToString("h:mm") @timeSlot.From.ToString("tt").ToLowerInvariant()</h2>
13+
<MudText Typo="Typo.h6">
14+
@timeSlot.From.ToString("h:mm")
15+
@timeSlot.From.ToString("tt").ToLowerInvariant()
16+
</MudText>
1417
</MudListSubheader>
1518
@if(timeSlot.Info is not null)
1619
{
17-
<MudListItem Class="ml-1">
18-
<h2>@timeSlot.Info</h2>
20+
<MudListItem Class="ml-6">
21+
<MudText Typo="Typo.h5">@timeSlot.Info</MudText>
1922
</MudListItem>
2023
}
2124
@foreach(var sessionItem in timeSlot.Sessions.Select((session, index) => (session, index)))
2225
{
2326
<MudListItem
24-
Class="ml-1"
25-
Icon="@sessionItem.session.BookmarkIconIfBookmarked"
2627
OnClick="() => ViewSession(sessionItem.session.Id)">
27-
<h2>@sessionItem.session.Title</h2>
28-
<h3>@sessionItem.session.SpeakerName</h3>
29-
<h3>@sessionItem.session.TrackName (@sessionItem.session.RoomName)</h3>
28+
<MudPaper Class="pa-4">
29+
<MudText Typo="Typo.subtitle1">
30+
@WhenBookmarkedShowIcon(sessionItem.session)
31+
@sessionItem.session.Title
32+
</MudText>
33+
<MudText Typo="Typo.subtitle2">@sessionItem.session.SpeakerName</MudText>
34+
<MudText Typo="Typo.subtitle2">@sessionItem.session.TrackName (@sessionItem.session.RoomName)</MudText>
35+
</MudPaper>
3036
</MudListItem>
3137

3238
@if (sessionItem.index != timeSlot.Sessions.Count -1)
@@ -38,7 +44,12 @@
3844

3945
</MudList>
4046

41-
@*@JsonSerializer.Serialize(State.Value)*@
47+
@code{
48+
RenderFragment? WhenBookmarkedShowIcon(Features.Home.Store.Session session) =>
49+
session.IsBookmarked
50+
? @<MudIcon Icon="@Icons.Material.Filled.Bookmark" Title="Bookmarked" />
51+
: null;
52+
}
4253

4354
@code {
4455
void ViewSession(int sessionId) => Dispatcher.Dispatch(new ViewSessionAction(sessionId));

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Session/Components/Session.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
@if (State.Value.Session is not null)
1515
{
16-
<MudCard>
16+
<MudCard Class="ma-3">
1717
<MudCardHeader>
1818
<CardHeaderContent>
1919
<MudText Typo="Typo.h5">@State.Value.Session.Title</MudText>

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/SessionFeedback/Components/SessionFeedback.razor

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
<TitleContent><MudText Typo="Typo.h6" Align="Align.Center">Session Feedback</MudText></TitleContent>
1010
<DialogContent>
1111

12+
<MudCard>
13+
<MudCardHeader>
14+
<CardHeaderContent>
15+
<MudText Typo="Typo.h5">@State.Value.SessionTitle</MudText>
16+
<MudText Typo="Typo.h6">@State.Value.SpeakerName</MudText>
17+
</CardHeaderContent>
18+
</MudCardHeader>
19+
</MudCard>
20+
1221
@WhenFeedbackAlreadySubmittedShowWarning()
1322

1423
<MudCard Class="mt-3">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace PocketDDD.BlazorClient.Features.SessionFeedback.Store;
22

33
public record FetchExistingSessionFeedbackAction(int SessionId);
4+
public record SetSessionDetailsAction(string SessionTitle, string SpeakerName);
45
public record SetTimeSlotAlreadyHasFeedbackAction();
56
public record SetSessionFeedbackAction(Models.SessionFeedback Feedback);
67
public record SubmitSessionFeedbackAction(Models.SessionFeedback Feedback);

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/SessionFeedback/Store/SessionFeedbackEffects.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ public EventFeedbackEffects(IState<SessionFeedbackState> state, IDispatcher disp
2121
[EffectMethod]
2222
public async Task OnFetchExistingSessionFeedback(FetchExistingSessionFeedbackAction action, IDispatcher dispatcher)
2323
{
24+
var eventData = await _localStorage.EventData.GetAsync();
25+
var session = eventData!.Sessions.Single(x => x.Id == action.SessionId);
26+
27+
dispatcher.Dispatch(new SetSessionDetailsAction(session.Title, session.Speaker));
28+
2429
var feedbackItems = await _localStorage.SessionFeedbacks.GetOrDefaultAsync();
2530
var feedback = feedbackItems.FirstOrDefault(x => x.SessionId == action.SessionId);
2631
int? timeSlotId = feedback?.TimeSlotId;
2732

2833
if (feedback is not null)
29-
{
3034
dispatcher.Dispatch(new SetSessionFeedbackAction(feedback));
31-
}
3235

3336
if (timeSlotId is null)
34-
{
35-
var eventData = await _localStorage.EventData.GetAsync();
3637
timeSlotId = eventData!.Sessions.Single(x => x.Id == action.SessionId).TimeSlotId;
37-
}
3838

3939
if (feedbackItems.Any(x => x.SessionId != action.SessionId &&
4040
x.TimeSlotId == timeSlotId))

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/SessionFeedback/Store/SessionFeedbackReducer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ namespace PocketDDD.BlazorClient.Features.SessionFeedback.Store;
66
public static class SessionFeedbackReducer
77
{
88
[ReducerMethod]
9-
public static SessionFeedbackState OnFetchExistingSessionFeedback(SessionFeedbackState state, FetchExistingSessionFeedbackAction action) =>
9+
public static SessionFeedbackState OnSetSessionDetails(SessionFeedbackState state, SetSessionDetailsAction action) =>
1010
state with
1111
{
12-
SessionId = action.SessionId,
12+
SessionTitle = action.SessionTitle,
13+
SpeakerName = action.SpeakerName,
1314
TimeSlotAlreadyHasFeedback = false
1415
};
1516

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/SessionFeedback/Store/SessionFeedbackState.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace PocketDDD.BlazorClient.Features.SessionFeedback.Store;
55
[FeatureState]
66
public record SessionFeedbackState
77
{
8-
public int SessionId { get; init; }
8+
public string SessionTitle { get; set; } = string.Empty;
9+
public string SpeakerName { get; set; } = string.Empty;
910
public bool TimeSlotAlreadyHasFeedback { get; init; } = false;
1011
}

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Features/Sync/Components/SyncStatus.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
@code {
5757
RenderFragment WhenSyncingShowSyncAlert() =>
5858
State.Value.IsSyncing
59-
? @<MudAlert Class="mt-2" Severity="Severity.Info"> Syncing...</MudAlert>
59+
? @<MudAlert Class="mt-2" Severity="Severity.Info" Icon="@Icons.Material.Filled.CloudSync"> Syncing...</MudAlert>
6060
: null;
6161
}
6262

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Shared/MainLayout.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<MudLayout>
1313
<HeaderBar />
14-
<MudMainContent>
14+
<MudMainContent Class="">
1515
@Body
1616
</MudMainContent>
1717
</MudLayout>
@@ -25,6 +25,7 @@
2525
if (firstRender)
2626
{
2727
_isDarkMode = await _mudThemeProvider.GetSystemPreference();
28+
//_isDarkMode = false;
2829
StateHasChanged();
2930
}
3031
}

PocketDDD.BlazorClient/PocketDDD.BlazorClient/Shared/NavMenu.razor

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)