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
|
// Search menu will be handled by Discourse's native component
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goToLogin = () => {
|
||||||
|
this.router.transitionTo("login");
|
||||||
|
};
|
||||||
|
|
||||||
|
goToSignup = () => {
|
||||||
|
this.router.transitionTo("signup");
|
||||||
|
};
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
{{#if this.shouldDisplay}}
|
{{#if this.shouldDisplay}}
|
||||||
{{#if settings.custom_css}}
|
{{#if settings.custom_css}}
|
||||||
|
|
@ -84,13 +92,13 @@ export default class WelcomeBanner extends Component {
|
||||||
{{#if this.isAnonymous}}
|
{{#if this.isAnonymous}}
|
||||||
<div class="hero-buttons">
|
<div class="hero-buttons">
|
||||||
<DButton
|
<DButton
|
||||||
@action={{this.router.transitionTo "login"}}
|
@action={{this.goToLogin}}
|
||||||
@label={{i18n "welcome_banner.buttons.login"}}
|
@translatedLabel={{i18n "welcome_banner.buttons.login"}}
|
||||||
class="btn-primary hero-login-btn"
|
class="btn-primary hero-login-btn"
|
||||||
/>
|
/>
|
||||||
<DButton
|
<DButton
|
||||||
@action={{this.router.transitionTo "signup"}}
|
@action={{this.goToSignup}}
|
||||||
@label={{i18n "welcome_banner.buttons.register"}}
|
@translatedLabel={{i18n "welcome_banner.buttons.register"}}
|
||||||
class="btn-default hero-register-btn"
|
class="btn-default hero-register-btn"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue