Commit 230a38f4 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Remove references to deprecated and unused `SvgIcon`

parent 988e9041
...@@ -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.
......
...@@ -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,
......
...@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment