Files
pos-system/microservices/packages/blazor-ui/Components/Auth/SocialLogin.razor
Ho Ngoc Hai 76d75c753b Migrate
2026-05-23 18:37:02 +07:00

62 lines
3.8 KiB
Plaintext

@*
EN: Social login buttons — Google, Apple, Zalo with divider.
VI: Nút đăng nhập bên thứ ba — Google, Apple, Zalo với divider.
*@
<div class="auth-divider">@DividerText</div>
<div class="auth-social-group">
@* EN: Google — official multi-color "G" logo *@
<button type="button" class="auth-social-btn auth-social-btn--google" title="Google" @onclick="OnGoogleClick">
<svg width="20" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/>
<path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/>
<path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A11.96 11.96 0 0 0 1 12c0 1.94.46 3.77 1.18 4.93l3.66-2.84z" fill="#FBBC05"/>
<path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/>
</svg>
</button>
@* EN: Apple — official Apple logo *@
<button type="button" class="auth-social-btn auth-social-btn--apple" title="Apple" @onclick="OnAppleClick">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.52-3.23 0-1.44.62-2.2.44-3.06-.4C3.79 16.17 4.36 9.53 8.76 9.28c1.25.07 2.12.72 2.88.76.99-.2 1.94-.78 3-.84 1.42-.1 2.5.42 3.2 1.33-2.92 1.69-2.23 5.42.53 6.46-.62 1.6-1.42 3.19-2.95 3.29h-.37zM12 9.22c-.12-2.24 1.73-4.25 3.87-4.22.32 2.36-2.12 4.38-3.87 4.22z"/>
</svg>
</button>
@* EN: Facebook — official F logo *@
<button type="button" class="auth-social-btn auth-social-btn--facebook" title="Facebook" @onclick="OnFacebookClick">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
</svg>
</button>
@if (ShowZalo)
{
@* EN: Zalo — Z letter in brand blue *@
<button type="button" class="auth-social-btn auth-social-btn--zalo" title="Zalo" @onclick="OnZaloClick">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0C5.373 0 0 4.925 0 11s5.373 11 12 11c1.125 0 2.215-.152 3.253-.437l3.694 1.327a.75.75 0 0 0 .966-.932l-1.152-3.572C22.018 16.037 24 13.696 24 11 24 4.925 18.627 0 12 0zm-3.2 14.4H5.6V13h2.08l-2.48-3.76V8h3.6v1.4H7.12l2.48 3.76v1.24zm5.4-.8c0 .44-.36.8-.8.8h-2.8c-.44 0-.8-.36-.8-.8V8.8c0-.44.36-.8.8-.8h2.8c.44 0 .8.36.8.8v4.8zm3.2.8h-1.6V8h1.6v6.4z"/>
</svg>
</button>
}
</div>
@code {
/// <summary>
/// EN: Divider text between form and social buttons.
/// VI: Text divider giữa form và social buttons.
/// </summary>
[Parameter] public string DividerText { get; set; } = "Hoặc đăng nhập bằng";
/// <summary>
/// EN: Whether to show Zalo button (Vietnam market).
/// VI: Có hiển thị nút Zalo không (thị trường VN).
/// </summary>
[Parameter] public bool ShowZalo { get; set; } = true;
[Parameter] public EventCallback OnGoogleClick { get; set; }
[Parameter] public EventCallback OnAppleClick { get; set; }
[Parameter] public EventCallback OnFacebookClick { get; set; }
[Parameter] public EventCallback OnZaloClick { get; set; }
}