Skip to content
Snippets Groups Projects
Commit 4ba1a065 authored by Christopher Willis-Ford's avatar Christopher Willis-Ford
Browse files

add CSS fade to settingWasUpdated message

parent 9636dd04
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,13 @@ $ui-gray: hsla(0, 0%, 95%, 1); ...@@ -116,7 +116,13 @@ $ui-gray: hsla(0, 0%, 95%, 1);
font-weight: bolder; font-weight: bolder;
} }
@keyframes fade-out {
0% {opacity: 1}
100% {opacity: 0}
}
.setting-was-updated { .setting-was-updated {
animation: fade-out 3s ease-out;
color: $extensions-primary; color: $extensions-primary;
} }
......
...@@ -80,6 +80,11 @@ class TelemetryModal extends React.PureComponent { ...@@ -80,6 +80,11 @@ class TelemetryModal extends React.PureComponent {
settingWasUpdatedTimer: null settingWasUpdatedTimer: null
}; };
} }
componentWillUnmount () {
if (this.state.settingWasUpdatedTimer) {
clearTimeout(this.state.settingWasUpdatedTimer);
}
}
handleCancel () { handleCancel () {
this.props.onRequestClose(); this.props.onRequestClose();
if (this.props.onCancel) { if (this.props.onCancel) {
...@@ -178,7 +183,10 @@ class TelemetryModal extends React.PureComponent { ...@@ -178,7 +183,10 @@ class TelemetryModal extends React.PureComponent {
</label> </label>
</Box> </Box>
<Box className={styles.buttonRow}> <Box className={styles.buttonRow}>
<span className={styles.settingWasUpdated}>{settingWasUpdated}</span> <span
className={styles.settingWasUpdated}
key={this.state.settingWasUpdatedTimer} // restart CSS fade when timer changes
>{settingWasUpdated}</span>
<button <button
className={styles.optIn} className={styles.optIn}
onClick={this.props.onRequestClose} onClick={this.props.onRequestClose}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment