Skip to content

Commit eca9044

Browse files
committed
Adjust usage of new shared icon
1 parent cadccc1 commit eca9044

File tree

9 files changed

+29
-25
lines changed

9 files changed

+29
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@babel/preset-react": "^7.0.0",
1515
"@babel/preset-typescript": "^7.16.7",
1616
"@hypothesis/frontend-build": "^3.0.0",
17-
"@hypothesis/frontend-shared": "^8.16.0",
17+
"@hypothesis/frontend-shared": "^9.0.0",
1818
"@hypothesis/frontend-testing": "^1.3.1",
1919
"@npmcli/arborist": "^9.0.0",
2020
"@octokit/rest": "^21.0.0",

src/sidebar/components/Annotation/AnnotationHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
LinkButton,
33
HighlightIcon,
4-
LockIcon,
4+
LockFilledIcon,
55
} from '@hypothesis/frontend-shared';
66
import { useMemo } from 'preact/hooks';
77

@@ -115,7 +115,7 @@ function AnnotationHeader({
115115
<header>
116116
<div className="flex gap-x-1 items-center flex-wrap-reverse">
117117
{isPrivate(annotation.permissions) && !isEditing && (
118-
<LockIcon
118+
<LockFilledIcon
119119
className="w-[12px] h-[12px]"
120120
title="This annotation is visible only to you"
121121
/>

src/sidebar/components/Annotation/AnnotationPublishControl.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
CancelIcon,
44
GlobeIcon,
55
GroupsIcon,
6-
LockIcon,
6+
LockFilledIcon,
77
MenuExpandIcon,
88
} from '@hypothesis/frontend-shared';
99
import classnames from 'classnames';
@@ -116,7 +116,7 @@ function AnnotationPublishControl({
116116
onClick={() => onSetPrivate(false)}
117117
/>
118118
<MenuItem
119-
icon={LockIcon}
119+
icon={LockFilledIcon}
120120
label="Only Me"
121121
isSelected={isPrivate}
122122
onClick={() => onSetPrivate(true)}

src/sidebar/components/Annotation/test/AnnotationHeader-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ describe('AnnotationHeader', () => {
104104

105105
const wrapper = createAnnotationHeader();
106106

107-
assert.isTrue(wrapper.find('LockIcon').exists());
107+
assert.isTrue(wrapper.find('LockFilledIcon').exists());
108108
});
109109

110110
it('should not render an "Only Me" icon if the annotation is being edited', () => {
111111
fakeIsPrivate.returns(true);
112112

113113
const wrapper = createAnnotationHeader({ isEditing: true });
114114

115-
assert.isFalse(wrapper.find('LockIcon').exists());
115+
assert.isFalse(wrapper.find('LockFilledIcon').exists());
116116
});
117117

118118
it('should not render an "Only Me" icon if the annotation is not private', () => {

src/sidebar/components/Annotation/test/AnnotationPublishControl-test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { GlobeIcon, GroupsIcon, LockIcon } from '@hypothesis/frontend-shared';
1+
import {
2+
GlobeIcon,
3+
GroupsIcon,
4+
LockFilledIcon,
5+
} from '@hypothesis/frontend-shared';
26
import {
37
checkAccessibility,
48
mockImportedComponents,
@@ -175,7 +179,7 @@ describe('AnnotationPublishControl', () => {
175179
const wrapper = createAnnotationPublishControl();
176180
const privateMenuItem = wrapper.find('MenuItem').at(1);
177181

178-
assert.equal(privateMenuItem.prop('icon'), LockIcon);
182+
assert.equal(privateMenuItem.prop('icon'), LockFilledIcon);
179183
});
180184

181185
it('should have an "Only me" label', () => {

src/sidebar/components/GroupList/GroupListItem.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import {
22
confirm,
33
CopyIcon,
44
ExternalIcon,
5-
GlobeAltIcon,
6-
GlobeAltLockIcon,
5+
GlobeIcon,
6+
GlobeLockIcon,
77
LeaveIcon,
8-
LockIcon,
8+
LockFilledIcon,
99
} from '@hypothesis/frontend-shared';
1010
import classnames from 'classnames';
1111

@@ -32,9 +32,9 @@ function GroupIcon({ type }: { type: GroupType }) {
3232
title={title}
3333
data-testid="group-icon"
3434
>
35-
{type === 'open' && <GlobeAltIcon />}
36-
{type === 'restricted' && <GlobeAltLockIcon />}
37-
{type === 'private' && <LockIcon />}
35+
{type === 'open' && <GlobeIcon />}
36+
{type === 'restricted' && <GlobeLockIcon />}
37+
{type === 'private' && <LockFilledIcon />}
3838
</div>
3939
);
4040
}

src/sidebar/components/GroupList/test/GroupListItem-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,17 @@ describe('GroupListItem', () => {
381381
[
382382
{
383383
type: 'private',
384-
expectedIcon: 'LockIcon',
384+
expectedIcon: 'LockFilledIcon',
385385
expectedTitle: 'Private group',
386386
},
387387
{
388388
type: 'restricted',
389-
expectedIcon: 'GlobeAltLockIcon',
389+
expectedIcon: 'GlobeLockIcon',
390390
expectedTitle: 'Restricted group',
391391
},
392392
{
393393
type: 'open',
394-
expectedIcon: 'GlobeAltIcon',
394+
expectedIcon: 'GlobeIcon',
395395
expectedTitle: 'Public group',
396396
},
397397
].forEach(({ type, expectedIcon, expectedTitle }) => {

src/sidebar/components/ShareDialog/ShareAnnotations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
Input,
44
InputGroup,
55
IconButton,
6-
LockIcon,
6+
LockFilledIcon,
77
} from '@hypothesis/frontend-shared';
88
import { useCallback } from 'preact/hooks';
99

@@ -94,7 +94,7 @@ function ShareAnnotations({ toastMessenger }: ShareAnnotationsProps) {
9494
)}{' '}
9595
<span>
9696
Private (
97-
<LockIcon className="inline w-[14px] h-[14px] -mt-0.5" />{' '}
97+
<LockFilledIcon className="inline w-[14px] h-[14px] -mt-0.5" />{' '}
9898
<em>Only Me</em>) annotations are only visible to you.
9999
</span>
100100
</p>

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,15 +2282,15 @@ __metadata:
22822282
languageName: node
22832283
linkType: hard
22842284

2285-
"@hypothesis/frontend-shared@npm:^8.16.0":
2286-
version: 8.16.1
2287-
resolution: "@hypothesis/frontend-shared@npm:8.16.1"
2285+
"@hypothesis/frontend-shared@npm:^9.0.0":
2286+
version: 9.0.0
2287+
resolution: "@hypothesis/frontend-shared@npm:9.0.0"
22882288
dependencies:
22892289
highlight.js: ^11.6.0
22902290
wouter-preact: ^3.0.0
22912291
peerDependencies:
22922292
preact: ^10.25.1
2293-
checksum: 9c1037d4e8f10ad8423e244a75d1f5c1000433b0f519fc87c43dff51cf570d6dc702838dc188cd63c5a3f7a821e0d95ef2114eb2788fded2d30813a915228628
2293+
checksum: 203f8562d9d0dd5fc6e26cd2e56d0264ea3129ed8e54673d13a15646f501221139f12c9a092b82e15a0c60f476821937617a7db9c9e5715b03aeebe082b0f986
22942294
languageName: node
22952295
linkType: hard
22962296

@@ -8787,7 +8787,7 @@ __metadata:
87878787
"@babel/preset-react": ^7.0.0
87888788
"@babel/preset-typescript": ^7.16.7
87898789
"@hypothesis/frontend-build": ^3.0.0
8790-
"@hypothesis/frontend-shared": ^8.16.0
8790+
"@hypothesis/frontend-shared": ^9.0.0
87918791
"@hypothesis/frontend-testing": ^1.3.1
87928792
"@npmcli/arborist": ^9.0.0
87938793
"@octokit/rest": ^21.0.0

0 commit comments

Comments
 (0)