Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
mat-flat-button
[color]="buttonColor ? null : 'primary'"
[disabled]="(selectGetOtpInProcess$ | async) || (isOtpSent && !canResendOtp)"
[class.has-hover-color]="!!buttonHoverColor"
[style.--btn-hover-color]="buttonHoverColor"
[ngStyle]="
buttonColor
? {
Expand Down Expand Up @@ -236,6 +238,8 @@
#submitBtn
mat-flat-button
[color]="buttonColor ? null : 'primary'"
[class.has-hover-color]="!!buttonHoverColor"
[style.--btn-hover-color]="buttonHoverColor"
[ngStyle]="
buttonColor
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,14 @@ input[matinput]::-webkit-inner-spin-button {
}
}
}

// Custom button hover color applied via --btn-hover-color CSS property.
// .has-hover-color is only added when buttonHoverColor is truthy.
.has-hover-color:hover:not([disabled]) {
background-color: var(--btn-hover-color) !important;

.mdc-button__ripple::before,
.mat-mdc-button-ripple::before {
opacity: 0 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ export class RegisterComponent extends BaseComponent implements AfterViewInit, O
return this.uiPreferences?.button_color || null;
}

public get buttonHoverColor(): string | null {
if (this.version !== 'v2') return null;
return this.uiPreferences?.button_hover_color || null;
}

public get buttonTextColor(): string | null {
if (this.version !== 'v2') return null;
return this.uiPreferences?.button_text_color || null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<ng-container *ngIf="loginStep === 1 && widgetDataArray?.length && isCreateAccountLink">
<p class="create-account" [ngStyle]="primaryColor ? { color: primaryColor } : {}">
Are you a new User?
<a href="javascript:void(0)" (click)="showRegistration()"> Create an account</a>
<a href="javascript:void(0)" (click)="showRegistration()">{{ signUpButtonText }}</a>
</p>
</ng-container>

Expand Down Expand Up @@ -221,6 +221,8 @@
(click)="login()"
[disabled]="isLoginLoading$ | async"
class="w-100"
[class.has-hover-color]="!!buttonHoverColor"
[style.--btn-hover-color]="buttonHoverColor"
[ngStyle]="
buttonColor
? {
Expand All @@ -235,7 +237,7 @@
>
<div class="loader">
<mat-spinner matPrefix diameter="20" *ngIf="isLoginLoading$ | async"></mat-spinner>
Login
Sign in
</div>
</button>
</div>
Expand Down Expand Up @@ -287,6 +289,8 @@
(click)="sendResetPasswordOtp()"
[disabled]="isLoginLoading$ | async"
class="w-100"
[class.has-hover-color]="!!buttonHoverColor"
[style.--btn-hover-color]="buttonHoverColor"
[ngStyle]="
buttonColor
? {
Expand Down Expand Up @@ -423,6 +427,8 @@
(click)="verifyResetPasswordOtp()"
[disabled]="isLoginLoading$ | async"
class="w-100"
[class.has-hover-color]="!!buttonHoverColor"
[style.--btn-hover-color]="buttonHoverColor"
[ngStyle]="
buttonColor
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,16 @@ p {
background-color: transparent !important;
border-color: #ffffff !important;
}

// Custom button hover color applied via --btn-hover-color CSS property.
// The .has-hover-color class is only added when buttonHoverColor is truthy,
// so this rule is a no-op when the preference is not configured.
.has-hover-color:hover:not([disabled]) {
background-color: var(--btn-hover-color) !important;

// Suppress Material's default state-layer ripple so it doesn't wash over the custom color
.mdc-button__ripple::before,
.mat-mdc-button-ripple::before {
opacity: 0 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,10 @@ export class SendOtpCenterComponent extends BaseComponent implements OnInit, OnD
return this.theme === 'dark';
}

public get signUpButtonText(): string {
return this.uiPreferences?.sign_up_button_text || 'Create an account';
}

private startResetPasswordTimer(): void {
this.remainingSeconds = 15;
this.resetPasswordTimerSubscription = interval(1000).subscribe(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/proxy-auth/src/app/otp/send-otp/send-otp.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2568,7 +2568,7 @@ export class SendOtpComponent extends BaseComponent implements OnInit, OnDestroy

// Set the text content
paragraph.innerHTML = 'Are you a new user? ';
link.textContent = 'Create an account';
link.textContent = selectWidgetTheme?.ui_preferences?.sign_up_button_text || 'Create an account';

// Add click event to the link
link.addEventListener('click', (event) => {
Expand Down
Loading