Unverified Commit 809f9ab3 authored by Lyza Gardner's avatar Lyza Gardner Committed by GitHub

Merge pull request #2128 from hypothesis/show-sidebar-label

Change show/hide sidebar button label depending on state
parents 9403c5a1 5471223e
...@@ -66,7 +66,7 @@ describe('Toolbar', () => { ...@@ -66,7 +66,7 @@ describe('Toolbar', () => {
assert.calledWith(toggleSidebar); assert.calledWith(toggleSidebar);
wrapper.setProps({ isSidebarOpen: true }); wrapper.setProps({ isSidebarOpen: true });
findButton(wrapper, 'Show annotation sidebar').simulate('click'); findButton(wrapper, 'Hide annotation sidebar').simulate('click');
assert.calledWith(toggleSidebar); assert.calledWith(toggleSidebar);
}); });
......
...@@ -69,9 +69,12 @@ export default function Toolbar({ ...@@ -69,9 +69,12 @@ export default function Toolbar({
<ToolbarButton <ToolbarButton
extraClasses="annotator-frame-button--sidebar_toggle" extraClasses="annotator-frame-button--sidebar_toggle"
buttonRef={toggleSidebarRef} buttonRef={toggleSidebarRef}
label="Show annotation sidebar" label={
isSidebarOpen
? 'Hide annotation sidebar'
: 'Show annotation sidebar'
}
icon={isSidebarOpen ? 'h-icon-chevron-right' : 'h-icon-chevron-left'} icon={isSidebarOpen ? 'h-icon-chevron-right' : 'h-icon-chevron-left'}
selected={isSidebarOpen}
onClick={toggleSidebar} onClick={toggleSidebar}
/> />
)} )}
......
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