Skip to content

Commit 413af48

Browse files
authored
Inserting labels for the signin button (#23)
* Inserting labels for the signin button * assigning comments
1 parent b96446c commit 413af48

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/App.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class App extends React.Component {
6060
<Static
6161
signInStatus={this.state.signInStatus}
6262
signInTitle={this.state.signInTitle}
63+
signingInTitle={this.state.signingInTitle}
64+
signOutTitle={this.state.signOutTitle}
6365
welcomeToDynamoTitle={this.state.welcomeToDynamoTitle}
6466
launchTitle={this.state.launchTitle}
6567
showScreenAgainLabel={this.state.showScreenAgainLabel}
@@ -86,15 +88,17 @@ class App extends React.Component {
8688
launchTitle: labels.launchTitle,
8789
showScreenAgainLabel: labels.showScreenAgainLabel,
8890
importSettingsTitle: labels.importSettingsTitle,
89-
importSettingsTooltipDescription: labels.importSettingsTooltipDescription
91+
importSettingsTooltipDescription: labels.importSettingsTooltipDescription,
92+
signInTitle: labels.signInTitle,
93+
signingInTitle: labels.signingInTitle,
94+
signOutTitle: labels.signOutTitle
9095
});
9196
}
9297

9398
//Set the login status from Dynamo
9499
setSignInStatus(val) {
95-
this.setState({
96-
signInTitle: val.signInTitle,
97-
signInStatus: val.signInStatus === 'True',
100+
this.setState({
101+
signInStatus: val.signInStatus === 'True'
98102
});
99103
}
100104

src/Static.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,32 +108,31 @@ class Static extends React.Component {
108108
}
109109

110110
//Opens a page to signin
111-
//TODO: Localize strings by setting text as per what Dynamo sends in.
112111
signIn = async () => {
113112
if (chrome.webview !== undefined) {
114113
if (this.state.signInStatus) {
115114
let status = await chrome.webview.hostObjects.scriptObject.SignOut();
116115
this.setState({
117116
signInStatus: !status,
118-
signInTitle: 'Sign In'
117+
signInTitle: this.props.signInTitle
119118
});
120119
}
121120
else {
122121
let btn = document.getElementById('btnSignIn');
123122
btn.classList.add('disableButton');
124123
btn.disabled = true;
125124

126-
this.setState({ signInTitle: 'Signing In' });
125+
this.setState({ signInTitle: this.props.signingInTitle });
127126
let status = await chrome.webview.hostObjects.scriptObject.SignIn();
128127
this.setState({ signInStatus: status });
129128

130129
btn.classList.remove('disableButton');
131130
btn.disabled = false;
132131
if (status) {
133-
this.setState({ signInTitle: 'Sign Out' });
132+
this.setState({ signInTitle: this.props.signOutTitle });
134133
}
135134
else {
136-
this.setState({ signInTitle: 'Sign In' });
135+
this.setState({ signInTitle: this.props.signInTitle });
137136
}
138137
}
139138
}
@@ -171,7 +170,6 @@ class Static extends React.Component {
171170
});
172171
}
173172

174-
175173
setTotalLoadingTime(loadingTime) {
176174
this.setState({
177175
loadingTime: loadingTime
@@ -192,16 +190,19 @@ class Static extends React.Component {
192190
}
193191

194192
Static.defaultProps = {
195-
signInTitle: 'Sign in',
193+
signInTitle: 'Sign In',
194+
signingInTitle: 'Signing In',
195+
signOutTitle: 'Sign Out',
196196
launchTitle: 'Launch Dynamo',
197197
showScreenAgainLabel: 'Don\'t show this screen again',
198198
importSettingsTitle: 'Import Settings',
199-
importSettingsTooltipDescription: 'You can import custom settings here, which will overwrite your current settings. If you\'d like to preserve a copy of your current settings, export them before importing new settings. Settings not shown in the Preferences panel will be applied once Dynamo and any host program restarts.'
200-
199+
importSettingsTooltipDescription: 'You can import custom settings here, which will overwrite your current settings. If you\'d like to preserve a copy of your current settings, export them before importing new settings. Settings not shown in the Preferences panel will be applied once Dynamo and any host program restarts.'
201200
};
202201

203202
Static.propTypes = {
204203
signInTitle: PropTypes.string,
204+
signingInTitle: PropTypes.string,
205+
signOutTitle: PropTypes.string,
205206
launchTitle: PropTypes.string,
206207
showScreenAgainLabel: PropTypes.string,
207208
signInStatus: PropTypes.bool,

0 commit comments

Comments
 (0)