Skip to content

Commit 29fe650

Browse files
Add tooltip to restore deleted tags to make action more clear (#2899)
Fixes #2889 With the new restore deleted tags option in the note history revision selector, there was some confusion around what the action would do. This adds a tooltip with more information explaining what will take place.
1 parent b1f7007 commit 29fe650

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

lib/icons/help-small.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
export default function SmallHelpIcon() {
4+
return (
5+
<svg
6+
className="icon-help-small"
7+
xmlns="http://www.w3.org/2000/svg"
8+
viewBox="0 0 16 16"
9+
>
10+
<rect x="0" fill="none" width="16" height="16" />
11+
<path d="M8 0C3.582 0 0 3.582 0 8s3.582 8 8 8 8-3.582 8-8S12.418 0 8 0zM8 13c-0.552 0-1-0.448-1-1 0-0.552 0.448-1 1-1s1 0.448 1 1C9 12.552 8.552 13 8 13zM9 8.816V9v1H7V9 8c0-0.552 0.448-1 1-1s1-0.448 1-1c0-0.552-0.448-1-1-1S7 5.448 7 6H5c0-1.657 1.343-3 3-3s3 1.343 3 3C11 7.304 10.163 8.403 9 8.816z" />
12+
</svg>
13+
);
14+
}

lib/revision-selector/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { connect } from 'react-redux';
33
import FocusTrap from 'focus-trap-react';
44
import format from 'date-fns/format';
55
import classNames from 'classnames';
6+
import IconButton from '../icon-button';
7+
import SmallHelpIcon from '../icons/help-small';
68
import Slider from '../components/slider';
79
import CheckboxControl from '../controls/checkbox';
810
import actions from '../state/actions';
@@ -162,6 +164,12 @@ export class RevisionSelector extends Component<Props> {
162164
<span className="revision-deleted-tags-text">
163165
Restore deleted tags
164166
</span>
167+
<span>
168+
<IconButton
169+
icon={<SmallHelpIcon />}
170+
title="Any deleted tags associated with the restored version of this note will be re-added to your list of tags."
171+
/>
172+
</span>
165173
</label>
166174
<div className="revision-buttons">
167175
<button

lib/revision-selector/style.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@
4545
border: 0;
4646
}
4747
}
48+
49+
.icon-button {
50+
color: inherit;
51+
52+
svg {
53+
position: relative;
54+
bottom: 2px;
55+
}
56+
}
4857
}
4958

5059
.button-primary {

scss/_general.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ optgroup {
8585
}
8686
}
8787

88+
.MuiTooltip-tooltip.icon-button__tooltip {
89+
background-color: $studio-gray-50;
90+
}
91+
8892
body[data-theme='dark'] .search-match {
8993
background-color: rgba($studio-simplenote-blue-50, 0.4);
9094
color: $studio-white;

0 commit comments

Comments
 (0)