Skip to content

Commit 6a9a64d

Browse files
authored
DYN-6628 Update sign in button tool tip on sign in/sign out (#50)
1 parent e0006e1 commit 6a9a64d

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dynamods/splash-screen",
3-
"version": "1.0.16",
3+
"version": "1.0.17",
44
"description": "Splash Screen maintained by Dynamo Team@Autodesk",
55
"author": "Autodesk Inc.",
66
"license": "MIT",

src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class App extends React.Component {
3131

3232
handleCheckedChange = (checked) => {
3333
this.setState({isChecked: checked});
34-
}
34+
};
3535

3636
setBackgroundImage() {
3737
let backgroundImage = '#base64BackgroundImage';
@@ -139,4 +139,5 @@ class App extends React.Component {
139139
}
140140
}
141141
}
142+
142143
export default App;

src/Static.js

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Static extends React.Component {
3535
window.setTotalLoadingTime = this.setTotalLoadingTime.bind(this);
3636
window.setEnableSignInButton = this.setEnableSignInButton.bind(this);
3737
window.handleSignInStateChange = this.handleSignInStateChange.bind(this);
38-
this.handleChange = this.handleChange.bind(this)
38+
this.handleChange = this.handleChange.bind(this);
3939
}
4040

4141
componentDidMount() {
@@ -45,7 +45,7 @@ class Static extends React.Component {
4545
//Every time the checkbox is clicked, this method is called
4646
handleChange() {
4747
checked = !checked;
48-
this.props.onCheckedChange(checked);
48+
this.props.onCheckedChange(checked);
4949
}
5050

5151
render() {
@@ -132,7 +132,8 @@ class Static extends React.Component {
132132
let status = await chrome.webview.hostObjects.scriptObject.SignOut();
133133
this.setState({
134134
signInStatus: !status,
135-
signInTitle: this.props.signInTitle
135+
signInTitle: this.props.signInTitle,
136+
signInTooltip: this.props.signInTooltip
136137
});
137138
}
138139
else {
@@ -147,10 +148,16 @@ class Static extends React.Component {
147148
btn.classList.remove('disableButton');
148149
btn.disabled = false;
149150
if (status) {
150-
this.setState({ signInTitle: this.props.signOutTitle });
151+
this.setState({
152+
signInTitle: this.props.signOutTitle,
153+
signInTooltip: this.props.signOutTooltip
154+
});
151155
}
152156
else {
153-
this.setState({ signInTitle: this.props.signInTitle });
157+
this.setState({
158+
signInTitle: this.props.signInTitle,
159+
signInTooltip: this.props.signInTooltip
160+
});
154161
}
155162
}
156163
}
@@ -208,16 +215,21 @@ class Static extends React.Component {
208215

209216
//Handles changes to auth status on splash screen
210217
handleSignInStateChange(auth) {
211-
let btn = document.getElementById('btnSignIn');
212-
213218
this.setState({
214219
signInStatus: auth.status === 'True'
215220
});
216221

217222
if (auth.status === 'True') {
218-
btn.innerHTML = this.props.signOutTitle;
219-
} else {
220-
btn.innerHTML = this.props.signInTitle;
223+
this.setState({
224+
signInTitle: this.props.signOutTitle,
225+
signInTooltip: this.props.signOutTooltip
226+
});
227+
}
228+
else {
229+
this.setState({
230+
signInTitle: this.props.signInTitle,
231+
signInTooltip: this.props.signInTooltip
232+
});
221233
}
222234
}
223235

@@ -253,7 +265,8 @@ Static.propTypes = {
253265
showScreenAgainLabel: PropTypes.string,
254266
signInStatus: PropTypes.bool,
255267
importSettingsTitle: PropTypes.string,
256-
importSettingsTooltipDescription: PropTypes.string
268+
importSettingsTooltipDescription: PropTypes.string,
269+
onCheckedChange: PropTypes.func
257270
};
258271

259272
export default Static;

0 commit comments

Comments
 (0)