Skip to content

Commit 88fb580

Browse files
committed
refactor: login popup strings
1 parent 59ed7c1 commit 88fb580

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

src/nls/root/strings.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,5 +1580,8 @@ define({
15801580
"VALIDATION_CODE_MESSAGE": "Please use this Verification code to sign in to your {APP_NAME} account:",
15811581
"COPY_VALIDATION_CODE": "Copy Code",
15821582
"VALIDATION_CODE_COPIED": "Copied",
1583-
"OPEN_SIGN_IN_URL": "Open Sign In Page"
1583+
"OPEN_SIGN_IN_URL": "Open Sign In Page",
1584+
"PROFILE_POP_TITLE": "{APP_NAME} Account",
1585+
"PROFILE_SIGN_IN": "Sign in to your account",
1586+
"CONTACT_SUPPORT": "Contact support"
15841587
});

src/services/html/login-popup.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<div class="profile-popup">
22
<div class="popup-header">
3-
<h1 class="popup-title">{{welcomeTitle}}</h1>
3+
<h1 class="popup-title">{{Strings.PROFILE_POP_TITLE}}</h1>
44
</div>
55
<div class="popup-body">
66
<button id="phoenix-signin-btn" class="btn dialog-button primary">
77
<i class="fa fa-sign-in-alt"></i>
8-
{{signInBtnText}}
8+
{{Strings.PROFILE_SIGN_IN}}
99
</button>
1010
<div class="support-link">
1111
<button id="phoenix-support-btn" class="text-link">
1212
<i class="fa fa-question-circle"></i>
13-
{{supportBtnText}}
13+
{{Strings.CONTACT_SUPPORT}}
1414
</button>
1515
</div>
1616
</div>

src/services/profile-menu.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,19 @@ define(function (require, exports, module) {
153153

154154
/**
155155
* Shows the sign-in popup when the user is not logged in
156-
* @param {Object} loginData - Data to populate the template (optional)
157156
*/
158-
function showLoginPopup(loginData) {
157+
function showLoginPopup() {
159158
// If popup is already visible, just close it
160159
if (isPopupVisible) {
161160
closePopup();
162161
return;
163162
}
164163

165-
// Merge provided data with defaults
166-
const templateData = $.extend({}, defaultLoginData, loginData || {});
167-
168164
// create the popup element
169165
closePopup(); // close any existing popup first
170166

171167
// Render template with data
172-
const renderedTemplate = Mustache.render(loginTemplate, templateData);
168+
const renderedTemplate = Mustache.render(loginTemplate, {Strings});
173169
$popup = $(renderedTemplate);
174170

175171
$("body").append($popup);
@@ -272,7 +268,7 @@ define(function (require, exports, module) {
272268
if (KernalModeTrust.loginService.isLoggedIn()) {
273269
showProfilePopup(data);
274270
} else {
275-
showLoginPopup(data);
271+
showLoginPopup();
276272
}
277273
}
278274

src/styles/brackets.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@import "Extn-TabBar.less";
4545
@import "Extn-DisplayShortcuts.less";
4646
@import "Extn-CSSColorPreview.less";
47-
@import "Extn-UserProfile.less";
47+
@import "UserProfile.less";
4848

4949
/* Overall layout */
5050

0 commit comments

Comments
 (0)