Skip to content

Commit 78688b1

Browse files
committed
Add prep mode presentation (#33)
1 parent f07a4bb commit 78688b1

26 files changed

Lines changed: 155 additions & 4 deletions

src/PrompterOne.Shared/AppShell/Layout/MainLayout.razor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ private void SyncShellStateWithCurrentRoute(string uri)
286286
Shell.ShowEditor(ShellState.Title, currentScriptId);
287287
break;
288288
case AppRoutes.Learn:
289+
case AppRoutes.Prep:
289290
Shell.ShowLearn(ShellState.Title, ShellState.Subtitle, ShellState.WpmLabel, currentScriptId);
290291
break;
291292
case AppRoutes.Teleprompter:

src/PrompterOne.Shared/AppShell/Services/AppShellService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ private static bool IsSettingsRoute(string route) =>
275275
AppRoutes.Library => true,
276276
AppRoutes.Editor => true,
277277
AppRoutes.Learn => true,
278+
AppRoutes.Prep => true,
278279
AppRoutes.Teleprompter => true,
279280
AppRoutes.GoLive => true,
280281
AppRoutes.Settings => true,

src/PrompterOne.Shared/Contracts/AppRoutes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public static class AppRoutes
99
public const string Library = "/library";
1010
public const string Editor = "/editor";
1111
public const string Learn = "/learn";
12+
public const string Prep = "/prep";
1213
public const string Teleprompter = "/teleprompter";
1314
public const string GoLive = "/go-live";
1415
public const string Settings = "/settings";
@@ -20,6 +21,8 @@ public static class AppRoutes
2021

2122
public static string LearnWithId(string scriptId) => BuildScoped(Learn, scriptId);
2223

24+
public static string PrepWithId(string scriptId) => BuildScoped(Prep, scriptId);
25+
2326
public static string TeleprompterWithId(string scriptId) => BuildScoped(Teleprompter, scriptId);
2427

2528
public static string GoLiveWithId(string scriptId) => BuildScoped(GoLive, scriptId);

src/PrompterOne.Shared/Contracts/UiTestIds.Library.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public static class Library
4646

4747
public static string CardLearn(string scriptId) => $"library-card-learn-{scriptId}";
4848

49+
public static string CardPrep(string scriptId) => $"library-card-prep-{scriptId}";
50+
4951
public static string CardFavorite(string scriptId) => $"library-card-favorite-{scriptId}";
5052

5153
public static string CardMenu(string scriptId) => $"library-card-menu-{scriptId}";

src/PrompterOne.Shared/Learn/Pages/LearnPage.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@page "/learn"
2+
@page "/prep"
23
@namespace PrompterOne.Shared.Pages
34
@using PrompterOne.Shared.Components
45
@using PrompterOne.Shared.Contracts

src/PrompterOne.Shared/Library/Components/LibraryCardsGrid.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
OnDeleteScript="@(() => HandleDeleteScriptAsync(card.Id))"
1717
OnDuplicateScript="@(() => HandleDuplicateScriptAsync(card.Id))"
1818
OnLearnScript="@(() => OnLearnScript.InvokeAsync(card.Id))"
19+
OnPrepScript="@(() => OnPrepScript.InvokeAsync(card.Id))"
1920
OnMoveScript="@(folderId => HandleMoveScriptAsync(card.Id, folderId))"
2021
OnOpenScript="@(() => HandleOpenScriptAsync(card.Id))"
2122
OnReadScript="@(() => OnReadScript.InvokeAsync(card.Id))"
@@ -77,6 +78,8 @@
7778

7879
[Parameter, EditorRequired] public EventCallback<string> OnLearnScript { get; set; }
7980

81+
[Parameter, EditorRequired] public EventCallback<string> OnPrepScript { get; set; }
82+
8083
[Parameter, EditorRequired] public EventCallback<string> OnReadScript { get; set; }
8184

8285
[Parameter, EditorRequired] public EventCallback OnCreateScript { get; set; }

src/PrompterOne.Shared/Library/Components/LibraryScriptCard.razor

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,14 @@
141141
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />
142142
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
143143
</svg>
144-
@Text(UiTextKey.LibraryCardLearn)
144+
<span class="dcard-act-label">@Text(UiTextKey.LibraryCardLearn)</span>
145+
</button>
146+
<button class="dcard-act dcard-act-prep"
147+
@onclick:stopPropagation="true"
148+
@onclick="HandlePrepScriptAsync"
149+
data-test="@UiTestIds.Library.CardPrep(Card.Id)">
150+
<UiIcon Kind="UiIconKind.TextLines" Size="14" />
151+
<span class="dcard-act-label">@Text(UiTextKey.LibraryCardPrep)</span>
145152
</button>
146153
<button class="dcard-act dcard-act-go"
147154
@onclick:stopPropagation="true"
@@ -150,7 +157,7 @@
150157
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
151158
<polygon points="5,3 19,12 5,21" />
152159
</svg>
153-
@Text(UiTextKey.LibraryCardRead)
160+
<span class="dcard-act-label">@Text(UiTextKey.LibraryCardRead)</span>
154161
</button>
155162
</div>
156163
</div>
@@ -184,6 +191,7 @@
184191
[Parameter] public EventCallback OnDeleteScript { get; set; }
185192
[Parameter] public EventCallback OnDuplicateScript { get; set; }
186193
[Parameter] public EventCallback OnLearnScript { get; set; }
194+
[Parameter] public EventCallback OnPrepScript { get; set; }
187195
[Parameter] public EventCallback<string?> OnMoveScript { get; set; }
188196
[Parameter] public EventCallback OnOpenScript { get; set; }
189197
[Parameter] public EventCallback OnReadScript { get; set; }
@@ -205,6 +213,8 @@
205213

206214
private Task HandleLearnScriptAsync() => OnLearnScript.InvokeAsync();
207215

216+
private Task HandlePrepScriptAsync() => OnPrepScript.InvokeAsync();
217+
208218
private Task HandleMoveScriptAsync(string? folderId) => OnMoveScript.InvokeAsync(folderId);
209219

210220
private Task HandleOpenScriptAsync() => OnOpenScript.InvokeAsync();

src/PrompterOne.Shared/Library/Pages/LibraryPage.ScriptActions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ private Task LearnScriptAsync(string id)
4040
return Task.CompletedTask;
4141
}
4242

43+
private Task PrepScriptAsync(string id)
44+
{
45+
Navigation.NavigateTo(AppRoutes.PrepWithId(id));
46+
return Task.CompletedTask;
47+
}
48+
4349
private Task ReadScriptAsync(string id)
4450
{
4551
Navigation.NavigateTo(AppRoutes.TeleprompterWithId(id));

src/PrompterOne.Shared/Library/Pages/LibraryPage.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
OnToggleFavorite="ToggleFavoriteAsync"
6767
OnDeleteScript="DeleteScriptAsync"
6868
OnLearnScript="LearnScriptAsync"
69+
OnPrepScript="PrepScriptAsync"
6970
OnReadScript="ReadScriptAsync"
7071
OnCreateScript="CreateScriptAsync"
7172
OnStartCreateFolder="StartCreateFolder" />

src/PrompterOne.Shared/Localization/SharedResource.de.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@
192192
<data name="HeaderLearn" xml:space="preserve">
193193
<value>Lernen</value>
194194
</data>
195+
<data name="HeaderPrep" xml:space="preserve">
196+
<value>Vorbereitung</value>
197+
</data>
195198
<data name="HeaderRead" xml:space="preserve">
196199
<value>Lesen</value>
197200
</data>
@@ -1716,6 +1719,9 @@
17161719
<data name="LibraryCardLearn" xml:space="preserve">
17171720
<value>Üben</value>
17181721
</data>
1722+
<data name="LibraryCardPrep" xml:space="preserve">
1723+
<value>Vorbereiten</value>
1724+
</data>
17191725
<data name="LibraryCardRead" xml:space="preserve">
17201726
<value>Teleprompter</value>
17211727
</data>

0 commit comments

Comments
 (0)