Skip to content

Commit 735c26b

Browse files
committed
Refactor login UI for BootstrapBlazor integration
Updated `TransitionalLogin.razor` to replace SVG icons with Font Awesome icons, modified button labels and subtitles to reflect BootstrapBlazor accounts, and switched to `BootstrapInput` components for email and password fields. Retained error message logic. Adjusted CSS in `TransitionalLogin.razor.css` to use `::deep` selectors for scoped styles while maintaining button hover effects.
1 parent 38c46e0 commit 735c26b

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
<div class="header-row">
88
@if (isEmailEntered)
99
{
10-
<button @onclick="GoBack" type="button" id="back-button" data-testid="leftArrowIcon" aria-label="返回" class="back-button">
11-
<span class="fui-Button__icon rywnvv2 ___hix1za0 fe5j1ua fjamq6b f64fuq3 fbaiahx">
12-
<svg class="fui-Icon-regular ___12fm75w f1w7gpdv fez10in fg4l7m0" fill="var(--colorNeutralForeground3)" aria-hidden="true" width="24" height="24" viewBox="0 0 24 24">
13-
<path d="M10.3 19.72a1 1 0 0 0 1.4-1.43L6.33 13H20a1 1 0 0 0 0-2H6.33l5.37-5.28a1 1 0 0 0-1.4-1.42l-6.93 6.82c-.5.5-.5 1.3 0 1.78l6.92 6.83Z"></path>
14-
</svg>
10+
<button @onclick="GoBack" aria-label="返回" class="back-button">
11+
<span>
12+
<i class="fa-solid fa-arrow-left"></i>
1513
</span>
1614
</button>
1715
}
@@ -28,26 +26,26 @@
2826
@if (!isEmailEntered)
2927
{
3028
<h2>登录</h2>
31-
<p class="subtitle">使用你的 Microsoft 帐户。</p>
32-
<input type="email" class="input" placeholder="电子邮件或电话号码" @bind="email" />
29+
<p class="subtitle">使用你的 BootstrapBlazor 帐户。</p>
30+
<BootstrapInput type="email" class="input" placeholder="电子邮件或电话号码" @bind-Value="email" />
3331
<div class="error" hidden="@(!showEmailError)">请输入有效的电子邮件地址或电话号码</div>
34-
<button class="button" @onclick="OnEmailSubmit">下一个</button>
32+
<Button class="button" Color="Color.Primary" OnClick="OnEmailSubmit">下一步</Button>
3533
<div class="links">
3634
<a href="#">忘记用户名?</a>
3735
</div>
3836
<div class="small">
39-
不熟悉 Microsoft?<a href="#">创建帐户</a>
37+
不熟悉 BootstrapBlazor?<a href="#">去看文档</a>
4038
</div>
4139
}
4240
else
4341
{
4442
<h2>输入你的密码</h2>
4543
<p class="email-display">@email</p>
46-
<input type="password" class="input" placeholder="密码" />
44+
<BootstrapInput type="password" class="input" placeholder="密码" @bind-Value="password" />
4745
<div class="links">
4846
<a href="#">忘记了密码?</a>
4947
</div>
50-
<button class="button">下一个</button>
48+
<Button class="button" Color="Color.Primary">下一步</Button>
5149
<div class="links">
5250
<a href="#">其他登录方法</a>
5351
</div>
@@ -59,6 +57,7 @@
5957
@code {
6058
private bool isEmailEntered = false;
6159
private string email = "";
60+
private string password = "";
6261
private bool showEmailError = false;
6362

6463
private void OnEmailSubmit()

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
box-sizing: content-box !important;
2828
}
2929

30-
.input {
30+
::deep .input {
3131
width: 100%;
3232
padding: 10px;
3333
margin: 12px 0;
@@ -66,7 +66,7 @@
6666
height: 28px;
6767
}
6868

69-
.button {
69+
::deep .button {
7070
width: 100%;
7171
padding: 10px;
7272
background-color: #0078d4;
@@ -79,9 +79,9 @@
7979
transition: background-color 0.3s ease;
8080
}
8181

82-
.button:hover {
83-
background-color: #005a9e;
84-
}
82+
.button:hover {
83+
background-color: #005a9e;
84+
}
8585

8686
.links {
8787
margin-top: 10px;

0 commit comments

Comments
 (0)