-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBooks.razor
67 lines (59 loc) · 2.52 KB
/
MyBooks.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@page "/mybooks"
@using EveryoneReads.Backend
@inject NavigationManager NavMan
<h3 style="color:white">My Books</h3>
<style>
body {
background: linear-gradient(320deg, rgba(155,234,255,1) 0%, rgba(101,61,255,1) 0%, rgba(162,139,255,1) 100%);
}
</style>
<div class="row row-cols-1 row-cols-sm-4 g-2">
@foreach (var book in Util.MyBooks)
{
<div class="col">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-10"><span class="d-inline-block text-truncate" style="max-width: 310px">@book.Title</span></div>
<div class="col">
<button class="btn btn-primary-outline" style="color:red" @onclick="(e => Util.MyBooks.Remove(book))">X</button>
</div>
</div>
</div>
<div class="card-body">
<div class="container" style="height:200px">
<div class="row">
<div class="col-6">
<img @onclick="@(e => NavigateTo(@book.GoogleBooksID))" src="@book.CoverURL" class="card-img-top img-fluid" alt="@book.Title's cover" style="height:80%;width:auto;object-fit:fill;cursor:pointer">
</div>
<div class="col">
<p class="text-sm-start">
Publisher: @book.Publisher
<br>
Authors: @string.Join(",",@book.Authors)
<br>
Published: @book.PublishDate
</p>
</div>
</div>
</div>
</div>
<div class="card-footer text-muted">
<div class="container">
<div class="row">
<div class="col">
<button class="btn btn-primary" style="width:100%;background-color:mediumpurple; color:#FFF;border-color:#FFF">Sell this book</button>
</div>
</div>
</div>
</div>
</div>
</div>
}
</div>
@code {
private async Task NavigateTo(string googleBooksID)
{
NavMan.NavigateTo(NavMan.BaseUri + "book?google=" + googleBooksID);
}
}