Skip to content

Commit 4c49c80

Browse files
committed
CleanUp
1 parent e74fd1e commit 4c49c80

File tree

10 files changed

+216
-182
lines changed

10 files changed

+216
-182
lines changed

Component/AppBar.razor

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,46 @@
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"
2020
@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"><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>
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>
3033
</button>
3134
</div>
3235
</MudPaper>
3336
</MudAppBar>
34-
35-
@code {
37+
38+
@code {
3639
public string FindData = string.Empty;
37-
40+
3841
void GoToHomePage()
39-
{
40-
nav.NavigateTo("");
42+
{
43+
nav.NavigateTo("");
4144
}
4245

4346
public void GoTOPage()
@@ -47,14 +50,16 @@
4750
{
4851
nav.NavigateTo($"Search/{FindData}");
4952
}
50-
}
53+
}
54+
5155
protected override async Task OnAfterRenderAsync(bool firstRender)
5256
{
5357
if (firstRender)
5458
{
5559
await JSRuntime.InvokeVoidAsync("blazorKeyPressed", DotNetObjectReference.Create(this));
5660
}
5761
}
62+
5863
[JSInvokable]
5964
public void OnArrowKeyPressed(string key)
6065
{
@@ -65,15 +70,20 @@
6570
}
6671

6772
StateHasChanged();
68-
}
73+
}
74+
6975
void Filter()
7076
{
7177
Datas.FilteredData = Datas.VideosData.Where(x => x.Description != null && x.Description.Contains(FindData, StringComparison.OrdinalIgnoreCase))
72-
.ToList();
78+
.ToList();
7379
}
80+
7481
}
75-

82+

83+
84+
7685
@code{
86+
7787
protected override async Task OnInitializedAsync()
7888
{
7989
Datas.OnChange += StateHasChanged;
@@ -84,7 +94,9 @@
8494
{
8595
Datas.OnChange -= StateHasChanged;
8696
}
97+
8798
}
99+
88100
<style>
89101
.InputContainer {
90102
height: 40px;

Component/ErrorPage.razor

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,45 @@
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;
30+
private bool _visible = true;
2931
private DialogOptions _dialogOptions = new() { FullWidth = true, ClassBackground = "my-custom-class" };
32+
3033
void Home()
3134
{
3235
_visible = false;
3336
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/Thumbnail.razor

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
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 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,6 +15,7 @@
1415
@code
1516
{
1617
[Parameter] public Video VideoModel { get; set; } = new();
18+
1719
public void GoToPage()
1820
{
1921
Nav.NavigateTo($"playmedia/{VideoModel.Id}");

0 commit comments

Comments
 (0)