Skip to content

Commit bafb8d0

Browse files
committed
refactor: 重构模板名称
1 parent ab26bec commit bafb8d0

File tree

4 files changed

+78
-87
lines changed

4 files changed

+78
-87
lines changed

src/BootstrapBlazor.Server/Components/Layout/TutorialsNavMenu.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ protected override async Task OnInitializedAsync()
8585
},
8686
new()
8787
{
88-
Template = CreateDownloadButtonComponent("TransitionalLogin", _template5),
89-
Text = "TransitionalLogin",
90-
Url = "/tutorials/transitionallogin"
88+
Template = CreateDownloadButtonComponent("template5", _template5),
89+
Text = "Template 5",
90+
Url = "/tutorials/template5"
9191
}
9292
]
9393
},
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
@page "/tutorials/template5"
2+
@layout TutorialsLoginLayout
3+
4+
<div class="background-image">
5+
<div class="login-container">
6+
<div class="login-box animate-fade-in">
7+
<div class="header-row">
8+
@if (isEmailEntered)
9+
{
10+
<button @onclick="GoBack" aria-label="返回" class="back-button">
11+
<span>
12+
<i class="fa-solid fa-arrow-left"></i>
13+
</span>
14+
</button>
15+
}
16+
<div class="logo-container">
17+
<h1 class="blazor-text">BootstrapBlazor</h1>
18+
</div>
19+
</div>
20+
@if (!isEmailEntered)
21+
{
22+
<h2>登录</h2>
23+
<p class="subtitle">使用你的 BootstrapBlazor 帐户。</p>
24+
<BootstrapInput type="email" class="input" placeholder="电子邮件或电话号码" @bind-Value="email" />
25+
<div class="error" hidden="@(!showEmailError)">请输入有效的电子邮件地址或电话号码</div>
26+
<Button class="button" Color="Color.Primary" OnClick="OnEmailSubmit">下一步</Button>
27+
<div class="links">
28+
<a href="#">忘记用户名?</a>
29+
</div>
30+
<div class="small">
31+
不熟悉 BootstrapBlazor?<a href="/">去看文档</a>
32+
</div>
33+
}
34+
else
35+
{
36+
<h2>输入你的密码</h2>
37+
<p class="email-display">@email</p>
38+
<BootstrapInput type="password" class="input" placeholder="密码" @bind-Value="password" />
39+
<div class="links">
40+
<a href="#">忘记了密码?</a>
41+
</div>
42+
<Button class="button" Color="Color.Primary">下一步</Button>
43+
<div class="links">
44+
<a href="#">其他登录方法</a>
45+
</div>
46+
}
47+
</div>
48+
</div>
49+
</div>
50+
51+
@code {
52+
private bool isEmailEntered = false;
53+
private string email = "";
54+
private string password = "";
55+
private bool showEmailError = false;
56+
57+
private void OnEmailSubmit()
58+
{
59+
if (string.IsNullOrWhiteSpace(email))
60+
{
61+
showEmailError = true;
62+
}
63+
else
64+
{
65+
showEmailError = false;
66+
isEmailEntered = true;
67+
}
68+
}
69+
70+
private void GoBack()
71+
{
72+
isEmailEntered = false;
73+
}
74+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-

2-
.background-image {
1+
.background-image {
32
background-image: url('https://logincdn.msauth.net/shared/5/js/../images/fluent_web_light_57fee22710b04cebe1d5.svg');
43
background-repeat: no-repeat;
54
background-size: cover;

src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/TransitionalLogin.razor

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)