Skip to content

Commit 0bbb5cb

Browse files
committed
Commit Update
1 parent 7214da5 commit 0bbb5cb

File tree

8 files changed

+233
-210
lines changed

8 files changed

+233
-210
lines changed

Component/AppBar.razor

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,79 @@
11
@inject Data Datas
22
@inject NavigationManager Nav
33
@inject IJSRuntime JsRuntime
4-
<MudAppBar
5-
Color="Color.Secondary"
6-
Fixed="true"
7-
Dense="true"
8-
Elevation="0"
4+
<MudAppBar
5+
Color="Color.Secondary"
6+
Fixed="true"
7+
Dense="true"
8+
Elevation="0"
99
Class="">
10-
<MudIconButton
11-
Icon="@Icons.Material.Filled.Home"
12-
Color="Color.Inherit"
10+
<MudIconButton
11+
Icon="@Icons.Material.Filled.Home"
12+
Color="Color.Inherit"
1313
Edge="Edge.Start"
14-
OnClick="GoToHomePage"/>
15-
<MudSpacer/>
14+
OnClick="GoToHomePage" />
15+
<MudSpacer />
1616
<MudPaper Elevation="0" Class="mx-6">
1717
<div class="InputContainer">
1818
<input type="text"
1919
name="text"
20-
@bind-value="@_findData"
20+
@bind-value="@FindData"
2121
class="input" id="input"
22-
placeholder="Search">
22+
placeholder="Search" >
2323

2424
<label for="input" class="labelforsearch">
2525

2626
</label>
2727

2828
<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>
29+
<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>
3330
</button>
3431
</div>
3532
</MudPaper>
3633
</MudAppBar>
37-
38-
@code {
39-
private string _findData = string.Empty;
40-
34+
35+
@code {
36+
public string FindData = string.Empty;
37+
4138
void GoToHomePage()
42-
{
43-
Nav.NavigateTo("");
39+
{
40+
Nav.NavigateTo("");
4441
}
4542

46-
private void GoToPage()
43+
public void GoToPage()
4744
{
4845
Filter();
49-
if (!string.IsNullOrEmpty(_findData))
46+
if (!string.IsNullOrEmpty(FindData))
5047
{
51-
Nav.NavigateTo($"Search/{_findData}");
48+
Nav.NavigateTo($"Search/{FindData}");
5249
}
53-
}
54-
50+
}
5551
protected override async Task OnAfterRenderAsync(bool firstRender)
5652
{
5753
if (firstRender)
5854
{
5955
await JsRuntime.InvokeVoidAsync("blazorKeyPressed", DotNetObjectReference.Create(this));
6056
}
6157
}
62-
6358
[JSInvokable]
6459
public void OnArrowKeyPressed(string key)
6560
{
6661
Filter();
67-
if (key == "Enter" && !string.IsNullOrEmpty(_findData))
62+
if (key == "Enter" && !string.IsNullOrEmpty(FindData))
6863
{
69-
Nav.NavigateTo($"Search/{_findData}");
64+
Nav.NavigateTo($"Search/{FindData}");
7065
}
7166

7267
StateHasChanged();
73-
}
74-
68+
}
7569
void Filter()
7670
{
77-
Datas.FilteredData = Datas.VideosData.Where(x => x.Description != null && x.Description.Contains(_findData, StringComparison.OrdinalIgnoreCase))
78-
.ToList();
71+
Datas.FilteredData = Datas.VideosData.Where(x => x.Description != null && x.Description.Contains(FindData, StringComparison.OrdinalIgnoreCase))
72+
.ToList();
7973
}
80-
8174
}
82-

83-
75+

8476
@code{
85-
8677
protected override async Task OnInitializedAsync()
8778
{
8879
Datas.OnChange += StateHasChanged;
@@ -93,9 +84,7 @@
9384
{
9485
Datas.OnChange -= StateHasChanged;
9586
}
96-
9787
}
98-
9988
<style>
10089
.InputContainer {
10190
height: 40px;

Component/ErrorPage.razor

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,42 @@
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
25-
</MudButton>
26-
</DialogContent>
24+
Class="px-10 " FullWidth=true>Go Home</MudButton>
25+
</DialogContent>
2726
</MudDialog>
28-
2927
@code {
30-
private bool _visible = true;
28+
private bool _visible = true;
3129
private DialogOptions _dialogOptions = new() { FullWidth = true, ClassBackground = "my-custom-class" };
32-
3330
void Home()
3431
{
3532
_visible = false;
3633
Nav.NavigateTo($"");
3734
}
38-
3935
}
4036

4137
<style>
42-
.imageHight {
43-
height: 80%;
44-
width: 80%;
38+
.imageHight
39+
{
40+
height:80%;
41+
width:80%;
4542
}
4643
4744
.my-custom-class {

Component/Thumbnail.razor

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
@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
9-
Typo="Typo.h5">@string.Join(" ", VideoModel.Description.Split(".").Where(x => x != "mkv").Select(x => x))</MudText>
8+
<MudText Typo="Typo.h5">@string.Join(" ", VideoModel.Description.Split(".").Where(x=>x!="mkv").Select(x=>x))</MudText>
109
</MudCardContent>
1110
</MudCard>
1211
</MudPaper>
@@ -15,9 +14,8 @@
1514
@code
1615
{
1716
[Parameter] public Video VideoModel { get; set; } = new();
18-
1917
public void GoToPage()
2018
{
21-
Nav.NavigateTo($"playmedia/{VideoModel.VideoId}");
19+
Nav.NavigateTo($"playmedia/{VideoModel.Id}");
2220
}
2321
}

0 commit comments

Comments
 (0)