Fix button labels and click handlers for login/register
- Add goToLogin and goToSignup action methods - Use @translatedLabel instead of @label for proper i18n rendering - Fix @action to reference proper component methods - Buttons now display correct translated text and navigate properly
This commit is contained in:
parent
7b050f4a3a
commit
59859747f6
1 changed files with 12 additions and 4 deletions
|
|
@ -65,6 +65,14 @@ export default class WelcomeBanner extends Component {
|
|||
// Search menu will be handled by Discourse's native component
|
||||
}
|
||||
|
||||
goToLogin = () => {
|
||||
this.router.transitionTo("login");
|
||||
};
|
||||
|
||||
goToSignup = () => {
|
||||
this.router.transitionTo("signup");
|
||||
};
|
||||
|
||||
<template>
|
||||
{{#if this.shouldDisplay}}
|
||||
{{#if settings.custom_css}}
|
||||
|
|
@ -84,13 +92,13 @@ export default class WelcomeBanner extends Component {
|
|||
{{#if this.isAnonymous}}
|
||||
<div class="hero-buttons">
|
||||
<DButton
|
||||
@action={{this.router.transitionTo "login"}}
|
||||
@label={{i18n "welcome_banner.buttons.login"}}
|
||||
@action={{this.goToLogin}}
|
||||
@translatedLabel={{i18n "welcome_banner.buttons.login"}}
|
||||
class="btn-primary hero-login-btn"
|
||||
/>
|
||||
<DButton
|
||||
@action={{this.router.transitionTo "signup"}}
|
||||
@label={{i18n "welcome_banner.buttons.register"}}
|
||||
@action={{this.goToSignup}}
|
||||
@translatedLabel={{i18n "welcome_banner.buttons.register"}}
|
||||
class="btn-default hero-register-btn"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue