Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
230a38f4
Commit
230a38f4
authored
May 19, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
May 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove references to deprecated and unused `SvgIcon`
parent
988e9041
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
MenuItem.js
src/sidebar/components/MenuItem.js
+10
-7
icons.js
src/sidebar/icons.js
+1
-2
bootstrap.js
src/sidebar/test/bootstrap.js
+1
-3
No files found.
src/sidebar/components/MenuItem.js
View file @
230a38f4
...
...
@@ -5,6 +5,10 @@ import { useEffect, useRef } from 'preact/hooks';
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
Slider
from
'./Slider'
;
/**
* @typedef {import('../icons').sidebarIcons} SidebarIcons
*/
/**
* Render a clickable div that will toggle the expanded state of the
* associated submenu via `onToggleSubmenu`.
...
...
@@ -61,11 +65,10 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
* `onClick` callback should be supplied.
* @prop {string} [iconAlt] - Alt text for icon.
* @prop {string} [icon] -
* Name or URL of icon to display. If the value is a URL it is displayed using an `<img>`,
* if it is a name it is displayed using `SvgIcon`. If the property is `"blank"` a blank
* placeholder is displayed in place of an icon. If the property is falsey, no placeholder
* is displayed. The placeholder is useful to keep menu item labels aligned in a list if
* some items have icons and others do not.
* Name or URL of icon to display. If the value is a URL it is displayed using an `<img>`;
* if it is a non-URL string it is assumed to be the `name` of a registered icon.
* If the property is `"blank"` a blank placeholder is displayed in place of an icon.
* The placeholder is useful to keep menu item labels aligned.
* @prop {boolean} [isDisabled] -
* Dim the label to indicate that this item is not currently available. The `onClick`
* callback will still be invoked when this item is clicked and the submenu, if any,
...
...
@@ -101,8 +104,8 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
* When clicked, menu items either open an external link, if the `href` prop
* is provided, or perform a custom action via the `onClick` callback.
*
* The icon can either be an external SVG image, referenced by URL, or
a named
*
icon rendered by an `SvgIcon`.
* The icon can either be an external SVG image, referenced by URL, or
the
*
name of an icon registered in the application. @see {SidebarIcons}
*
* For items that have submenus, the `MenuItem` will call the `renderSubmenu`
* prop to render the content of the submenu, when the submenu is visible.
...
...
src/sidebar/icons.js
View file @
230a38f4
...
...
@@ -56,8 +56,7 @@ import expandMenuIcon from '../images/icons/expand-menu.svg';
import
pointerIcon
from
'../images/icons/pointer.svg'
;
/**
* Set of icons used by the sidebar application via the `SvgIcon`
* component.
* Set of icons used by the sidebar application
*/
export
const
sidebarIcons
=
{
add
:
plus
,
...
...
src/sidebar/test/bootstrap.js
View file @
230a38f4
...
...
@@ -13,9 +13,7 @@ import { Adapter } from 'enzyme-adapter-preact-pure';
configure
({
adapter
:
new
Adapter
()
});
// Make all the icons that are available for use with `SvgIcon` in the actual
// app available in the tests. This enables validation of icon names passed to
// `SvgIcon`.
// Make all the icons that are registered by the application available in tests.
import
{
sidebarIcons
}
from
'../icons'
;
import
{
annotatorIcons
}
from
'../../annotator/icons'
;
import
{
registerIcons
}
from
'@hypothesis/frontend-shared'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment