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
Show 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';
...
@@ -5,6 +5,10 @@ import { useEffect, useRef } from 'preact/hooks';
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
Slider
from
'./Slider'
;
import
Slider
from
'./Slider'
;
/**
* @typedef {import('../icons').sidebarIcons} SidebarIcons
*/
/**
/**
* Render a clickable div that will toggle the expanded state of the
* Render a clickable div that will toggle the expanded state of the
* associated submenu via `onToggleSubmenu`.
* associated submenu via `onToggleSubmenu`.
...
@@ -61,11 +65,10 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
...
@@ -61,11 +65,10 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
* `onClick` callback should be supplied.
* `onClick` callback should be supplied.
* @prop {string} [iconAlt] - Alt text for icon.
* @prop {string} [iconAlt] - Alt text for icon.
* @prop {string} [icon] -
* @prop {string} [icon] -
* Name or URL of icon to display. If the value is a URL it is displayed using an `<img>`,
* 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
* if it is a non-URL string it is assumed to be the `name` of a registered icon.
* placeholder is displayed in place of an icon. If the property is falsey, no placeholder
* If the property is `"blank"` a blank placeholder is displayed in place of an icon.
* is displayed. The placeholder is useful to keep menu item labels aligned in a list if
* The placeholder is useful to keep menu item labels aligned.
* some items have icons and others do not.
* @prop {boolean} [isDisabled] -
* @prop {boolean} [isDisabled] -
* Dim the label to indicate that this item is not currently available. The `onClick`
* 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,
* callback will still be invoked when this item is clicked and the submenu, if any,
...
@@ -101,8 +104,8 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
...
@@ -101,8 +104,8 @@ function SubmenuToggle({ title, isExpanded, onToggleSubmenu }) {
* When clicked, menu items either open an external link, if the `href` prop
* When clicked, menu items either open an external link, if the `href` prop
* is provided, or perform a custom action via the `onClick` callback.
* 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
* The icon can either be an external SVG image, referenced by URL, or
the
*
icon rendered by an `SvgIcon`.
*
name of an icon registered in the application. @see {SidebarIcons}
*
*
* For items that have submenus, the `MenuItem` will call the `renderSubmenu`
* For items that have submenus, the `MenuItem` will call the `renderSubmenu`
* prop to render the content of the submenu, when the submenu is visible.
* 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';
...
@@ -56,8 +56,7 @@ import expandMenuIcon from '../images/icons/expand-menu.svg';
import
pointerIcon
from
'../images/icons/pointer.svg'
;
import
pointerIcon
from
'../images/icons/pointer.svg'
;
/**
/**
* Set of icons used by the sidebar application via the `SvgIcon`
* Set of icons used by the sidebar application
* component.
*/
*/
export
const
sidebarIcons
=
{
export
const
sidebarIcons
=
{
add
:
plus
,
add
:
plus
,
...
...
src/sidebar/test/bootstrap.js
View file @
230a38f4
...
@@ -13,9 +13,7 @@ import { Adapter } from 'enzyme-adapter-preact-pure';
...
@@ -13,9 +13,7 @@ import { Adapter } from 'enzyme-adapter-preact-pure';
configure
({
adapter
:
new
Adapter
()
});
configure
({
adapter
:
new
Adapter
()
});
// Make all the icons that are available for use with `SvgIcon` in the actual
// Make all the icons that are registered by the application available in tests.
// app available in the tests. This enables validation of icon names passed to
// `SvgIcon`.
import
{
sidebarIcons
}
from
'../icons'
;
import
{
sidebarIcons
}
from
'../icons'
;
import
{
annotatorIcons
}
from
'../../annotator/icons'
;
import
{
annotatorIcons
}
from
'../../annotator/icons'
;
import
{
registerIcons
}
from
'@hypothesis/frontend-shared'
;
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