Skip to content

Commit 7214da5

Browse files
committed
Error Removed
1 parent 8a133b5 commit 7214da5

33 files changed

+26370
-8312
lines changed

App.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Router AppAssembly="@typeof(App).Assembly">
22
<Found Context="routeData">
3-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4-
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
55
</Found>
66
<NotFound>
77
<PageTitle>Not found</PageTitle>

Component/AppBar.razor

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,88 @@
11
@inject Data Datas
2-
@inject NavigationManager nav
3-
@inject IJSRuntime JSRuntime
4-
@inject Data Datas
5-
<MudAppBar
6-
Color="Color.Secondary"
7-
Fixed="true"
8-
Dense="true"
9-
Elevation="0"
2+
@inject NavigationManager Nav
3+
@inject IJSRuntime JsRuntime
4+
<MudAppBar
5+
Color="Color.Secondary"
6+
Fixed="true"
7+
Dense="true"
8+
Elevation="0"
109
Class="">
11-
<MudIconButton
12-
Icon="@Icons.Material.Filled.Home"
13-
Color="Color.Inherit"
10+
<MudIconButton
11+
Icon="@Icons.Material.Filled.Home"
12+
Color="Color.Inherit"
1413
Edge="Edge.Start"
15-
OnClick="GoToHomePage" />
16-
<MudSpacer />
14+
OnClick="GoToHomePage"/>
15+
<MudSpacer/>
1716
<MudPaper Elevation="0" Class="mx-6">
1817
<div class="InputContainer">
1918
<input type="text"
2019
name="text"
21-
@bind-value="@FindData"
20+
@bind-value="@_findData"
2221
class="input" id="input"
23-
placeholder="Search" >
22+
placeholder="Search">
2423

2524
<label for="input" class="labelforsearch">
2625

2726
</label>
2827

29-
<button class="micButton" @onclick="GoTOPage">
30-
<svg viewBox="0 0 512 512" class="searchIcon"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"></path></svg>
28+
<button class="micButton" @onclick="GoToPage">
29+
<svg viewBox="0 0 512 512" class="searchIcon">
30+
<path
31+
d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"></path>
32+
</svg>
3133
</button>
3234
</div>
3335
</MudPaper>
3436
</MudAppBar>
35-
36-
@code {
37-
public string FindData = string.Empty;
38-
37+
38+
@code {
39+
private string _findData = string.Empty;
40+
3941
void GoToHomePage()
40-
{
41-
nav.NavigateTo("");
42+
{
43+
Nav.NavigateTo("");
4244
}
4345

44-
public void GoTOPage()
46+
private void GoToPage()
4547
{
4648
Filter();
47-
if (!string.IsNullOrEmpty(FindData))
49+
if (!string.IsNullOrEmpty(_findData))
4850
{
49-
nav.NavigateTo($"Search/{FindData}");
51+
Nav.NavigateTo($"Search/{_findData}");
5052
}
51-
}
53+
}
54+
5255
protected override async Task OnAfterRenderAsync(bool firstRender)
5356
{
5457
if (firstRender)
5558
{
56-
await JSRuntime.InvokeVoidAsync("blazorKeyPressed", DotNetObjectReference.Create(this));
59+
await JsRuntime.InvokeVoidAsync("blazorKeyPressed", DotNetObjectReference.Create(this));
5760
}
5861
}
62+
5963
[JSInvokable]
6064
public void OnArrowKeyPressed(string key)
6165
{
6266
Filter();
63-
if (key == "Enter" && !string.IsNullOrEmpty(FindData))
67+
if (key == "Enter" && !string.IsNullOrEmpty(_findData))
6468
{
65-
nav.NavigateTo($"Search/{FindData}");
69+
Nav.NavigateTo($"Search/{_findData}");
6670
}
6771

6872
StateHasChanged();
69-
}
73+
}
74+
7075
void Filter()
7176
{
72-
Datas.FilteredData = Datas.VideosData.Where(x => x.Description != null && x.Description.Contains(FindData, StringComparison.OrdinalIgnoreCase))
73-
.ToList();
77+
Datas.FilteredData = Datas.VideosData.Where(x => x.Description != null && x.Description.Contains(_findData, StringComparison.OrdinalIgnoreCase))
78+
.ToList();
7479
}
80+
7581
}
76-

82+

83+
7784
@code{
85+
7886
protected override async Task OnInitializedAsync()
7987
{
8088
Datas.OnChange += StateHasChanged;
@@ -85,7 +93,9 @@
8593
{
8694
Datas.OnChange -= StateHasChanged;
8795
}
96+
8897
}
98+
8999
<style>
90100
.InputContainer {
91101
height: 40px;

Component/ErrorPage.razor

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
1-
@inject NavigationManager nav
1+
@inject NavigationManager Nav
22
@inject IDialogService DialogService
33
<MudPaper Class="d-flex flex-wrap justify-center "
44
Style="background-color:transparent"
55
Elevation="0"
6-
Width="100%">
7-
<MudImage
8-
Src="Tom.png"
9-
Alt="404 Error page"
10-
Class="rounded-lg imageHight"
11-
@onclick="Home"
12-
/>
13-
</MudPaper>
14-
<MudDialog @bind-IsVisible="visible" Options="dialogOptions">
15-
<DialogContent>
6+
Width="100%">
7+
<MudImage
8+
Src="Tom.png"
9+
Alt="404 Error page"
10+
Class="rounded-lg imageHight"
11+
@onclick="Home"
12+
/>
13+
</MudPaper>
14+
<MudDialog @bind-IsVisible="_visible" Options="_dialogOptions">
15+
<DialogContent>
1616
<MudImage Src="Tom.png"
1717
Alt="404 Error page"
1818
Class="rounded-lg"
19-
Fluid=true
20-
@onclick="Home" />
21-
<MudButton Variant="Variant.Outlined"
22-
Color="Color.Secondary"
19+
Fluid="true"
20+
@onclick="Home"/>
21+
<MudButton Variant="Variant.Outlined"
22+
Color="Color.Secondary"
2323
OnClick="Home"
24-
Class="px-10 " FullWidth=true>Go Home</MudButton>
25-
</DialogContent>
24+
Class="px-10 " FullWidth="true">Go Home
25+
</MudButton>
26+
</DialogContent>
2627
</MudDialog>
28+
2729
@code {
28-
private bool visible = true;
29-
private DialogOptions dialogOptions = new() { FullWidth = true, ClassBackground = "my-custom-class" };
30+
private bool _visible = true;
31+
private DialogOptions _dialogOptions = new() { FullWidth = true, ClassBackground = "my-custom-class" };
32+
3033
void Home()
3134
{
32-
visible = false;
33-
nav.NavigateTo($"");
35+
_visible = false;
36+
Nav.NavigateTo($"");
3437
}
38+
3539
}
3640

3741
<style>
38-
.imageHight
39-
{
40-
height:80%;
41-
width:80%;
42+
.imageHight {
43+
height: 80%;
44+
width: 80%;
4245
}
4346
4447
.my-custom-class {

Component/Giscus.razor

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111

1212
#region Parameter
1313

14-
[Parameter]
15-
public string InputPosition { get; set; } = "top";
16-
[Parameter]
17-
public string Term { get; set; } = "ChapterOne";
18-
[Parameter]
19-
public string Repo { get; set; } = "TomJerry1940/Comment";
20-
[Parameter]
21-
public string RepoId { get; set; } = "R_kgDOMEw5Ng";
14+
[Parameter] public string InputPosition { get; set; } = "top";
15+
[Parameter] public string Term { get; set; } = "ChapterOne";
16+
[Parameter] public string Repo { get; set; } = "TomJerry1940/Comment";
17+
[Parameter] public string RepoId { get; set; } = "R_kgDOMEw5Ng";
18+
2219
#endregion
2320

2421

@@ -39,26 +36,27 @@
3936
Script = new RenderFragment(b =>
4037
{
4138
b.OpenElement(0, "script");
42-
b.AddMultipleAttributes(1, new List<KeyValuePair<string, object>>()
43-
{
44-
new KeyValuePair<string, object>("src", "https://giscus.app/client.js"),
45-
new KeyValuePair<string, object>("data-repo", Repo),
46-
new KeyValuePair<string, object>("data-repo-id", RepoId),
47-
new KeyValuePair<string, object>("data-category", Category),
48-
new KeyValuePair<string, object>("data-category-id", CategoryId),
49-
new KeyValuePair<string, object>("data-mapping", Mapping),
50-
new KeyValuePair<string, object>("data-term", Term),
51-
new KeyValuePair<string, object>("data-strict", Strict),
52-
new KeyValuePair<string, object>("data-reactions-enabled", ReactionsEnabled ? "1" : "0"),
53-
new KeyValuePair<string, object>("data-emit-metadata", EmitMetadata),
54-
new KeyValuePair<string, object>("data-input-position", InputPosition),
55-
new KeyValuePair<string, object>("data-theme", Theme),
56-
new KeyValuePair<string, object>("data-lang", Language),
57-
new KeyValuePair<string, object>("data-loading", Loading),
58-
new KeyValuePair<string, object>("crossorigin", "anonymous"),
59-
new KeyValuePair<string, object>("async", true),
60-
});
39+
b.AddMultipleAttributes(1, new List<KeyValuePair<string, object>>
40+
{
41+
new("src", "https://giscus.app/client.js"),
42+
new("data-repo", Repo),
43+
new("data-repo-id", RepoId),
44+
new("data-category", Category),
45+
new("data-category-id", CategoryId),
46+
new("data-mapping", Mapping),
47+
new("data-term", Term),
48+
new("data-strict", Strict),
49+
new("data-reactions-enabled", ReactionsEnabled ? "1" : "0"),
50+
new("data-emit-metadata", EmitMetadata),
51+
new("data-input-position", InputPosition),
52+
new("data-theme", Theme),
53+
new("data-lang", Language),
54+
new("data-loading", Loading),
55+
new("crossorigin", "anonymous"),
56+
new("async", true)
57+
});
6158
b.CloseElement();
6259
});
6360
}
61+
6462
}

Component/Thumbnail.razor

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
@inject NavigationManager nav
1+
@inject NavigationManager Nav
22

33

4-
<MudPaper Width="400px" MaxHeight="480px" Class="mx-1 my-2" Style="background-color:transparent" >
4+
<MudPaper Width="400px" MaxHeight="480px" Class="mx-1 my-2" Style="background-color:transparent">
55
<MudCard>
6-
<MudCardMedia Image="@VideoModel.Thumbnail" Height="300" />
6+
<MudCardMedia Image="@VideoModel.Thumbnail" Height="300"/>
77
<MudCardContent>
8-
<MudText Typo="Typo.h5">@string.Join(" ", VideoModel.Description.Split(".").Where(x=>x!="mkv").Select(x=>x))</MudText>
8+
<MudText
9+
Typo="Typo.h5">@string.Join(" ", VideoModel.Description.Split(".").Where(x => x != "mkv").Select(x => x))</MudText>
910
</MudCardContent>
1011
</MudCard>
1112
</MudPaper>
@@ -14,8 +15,9 @@
1415
@code
1516
{
1617
[Parameter] public Video VideoModel { get; set; } = new();
17-
public void GoTOPage()
18+
19+
public void GoToPage()
1820
{
19-
nav.NavigateTo($"playmedia/{VideoModel.VideoId}");
21+
Nav.NavigateTo($"playmedia/{VideoModel.VideoId}");
2022
}
2123
}

0 commit comments

Comments
 (0)