Commit 8d393848 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Update `SidebarPanel` to use updated shared Panel component

parent 26c4f7e1
import { Button, CardActions } from '@hypothesis/frontend-shared/lib/next'; import {
Button,
CardActions,
RestrictedIcon,
} from '@hypothesis/frontend-shared/lib/next';
import { useSidebarStore } from '../store'; import { useSidebarStore } from '../store';
...@@ -23,7 +27,7 @@ export default function LoginPromptPanel({ ...@@ -23,7 +27,7 @@ export default function LoginPromptPanel({
} }
return ( return (
<SidebarPanel <SidebarPanel
icon="restricted" icon={RestrictedIcon}
title="Login needed" title="Login needed"
panelName="loginPrompt" panelName="loginPrompt"
> >
......
import { Panel } from '@hypothesis/frontend-shared'; import { Panel } from '@hypothesis/frontend-shared/lib/next';
import type { IconComponent } from '@hypothesis/frontend-shared/lib/types';
import type { ComponentChildren } from 'preact'; import type { ComponentChildren } from 'preact';
import { useCallback, useEffect, useRef } from 'preact/hooks'; import { useCallback, useEffect, useRef } from 'preact/hooks';
import scrollIntoView from 'scroll-into-view'; import scrollIntoView from 'scroll-into-view';
...@@ -11,7 +12,7 @@ import Slider from './Slider'; ...@@ -11,7 +12,7 @@ import Slider from './Slider';
export type SidebarPanelProps = { export type SidebarPanelProps = {
children: ComponentChildren; children: ComponentChildren;
/** An optional icon name for display next to the panel's title */ /** An optional icon name for display next to the panel's title */
icon?: string; icon?: IconComponent;
/** /**
* A string identifying this panel. Only one `panelName` may be active at any * A string identifying this panel. Only one `panelName` may be active at any
* time. Multiple panels with the same `panelName` would be "in sync", opening * time. Multiple panels with the same `panelName` would be "in sync", opening
...@@ -29,7 +30,7 @@ export type SidebarPanelProps = { ...@@ -29,7 +30,7 @@ export type SidebarPanelProps = {
*/ */
export default function SidebarPanel({ export default function SidebarPanel({
children, children,
icon = '', icon,
panelName, panelName,
title, title,
onActiveChanged, onActiveChanged,
......
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