Skip to content

Commit

Permalink
add button to close sidebar in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed May 11, 2024
1 parent ee85a59 commit e673de2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
2 changes: 2 additions & 0 deletions src/dashboard-refactor/header/search-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export default class SearchBar extends PureComponent<SearchBarProps, State> {
<TutorialBox
tutorialId="savePages"
getRootElement={this.props.getRootElement}
iconPadding={'6px'}
iconSize="22px"
/>
</ActionButtons>
{!this.props.inPageMode && <Placeholder />}
Expand Down
15 changes: 14 additions & 1 deletion src/dashboard-refactor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import CopyPaster from 'src/copy-paster/components/CopyPaster'
import { PageSearchCopyPaster } from 'src/copy-paster'
import BulkEditCopyPaster from 'src/copy-paster/BulkEditCopyPaster'
import { OverlayModals } from '@worldbrain/memex-common/lib/common-ui/components/overlay-modals'
import IconBox from '@worldbrain/memex-common/lib/common-ui/components/icon-box'

export type Props = DashboardDependencies & {
getRootElement: () => HTMLElement
Expand Down Expand Up @@ -526,7 +527,6 @@ export class DashboardContainer extends StatefulUIElement<
},
)
}
label={'Sync Status'}
size={'medium'}
icon={getSyncStatusIcon(syncStatusIconState)}
type={'tertiary'}
Expand All @@ -550,6 +550,16 @@ export class DashboardContainer extends StatefulUIElement<
filePath={icons.settings}
/>
{this.renderStatusMenu(syncStatusIconState)}
{this.state.isNoteSidebarShown && (
<Icon
icon="arrowRight"
heightAndWidth="22px"
padding="6px"
onClick={() =>
this.notesSidebarRef.current.hideSidebar()
}
/>
)}
</>
</RightHeader>
</HeaderContainer>
Expand Down Expand Up @@ -1949,6 +1959,7 @@ export class DashboardContainer extends StatefulUIElement<
)
}
onNotesSidebarClose={() => {
console.log('onnotes close')
this.processEvent('toggleNoteSidebarOff', null)
this.processEvent('setActivePage', {
activeDay: undefined,
Expand Down Expand Up @@ -1990,6 +2001,8 @@ export class DashboardContainer extends StatefulUIElement<
this.processEvent('toggleTheme', null)
}
getRootElement={this.props.getRootElement}
padding={'4px'}
iconSize="22px"
/>
{/* {this.state.listsSidebar.draggedListId != null ||
(this.state.searchResults.draggedPageId != null && ( */}
Expand Down
8 changes: 6 additions & 2 deletions src/overview/help-btn/components/help-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface Props {
theme: MemexThemeVariant
toggleTheme: () => void
getRootElement: () => HTMLElement
padding?: string
iconSize?: string
}
export interface State {
isOpen: boolean
Expand Down Expand Up @@ -194,21 +196,23 @@ export class HelpBtn extends React.PureComponent<Props, State> {
{this.renderMenu()}
{window.location.href.includes('/overview') && (
<Icon
heightAndWidth="24px"
heightAndWidth={this.props.iconSize || '24px'}
color={
this.props.theme === 'dark'
? 'greyScale5'
: 'greyScale4'
}
filePath={this.props.theme === 'dark' ? 'moon' : 'sun'}
onClick={() => this.props.toggleTheme()}
padding={this.props.padding}
/>
)}
<Icon
filePath={icons.helpIcon}
heightAndWidth={'24px'}
heightAndWidth={this.props.iconSize || '24px'}
onClick={this.handleClick}
containerRef={this.helpButtonRef}
padding={this.props.padding}
/>
</HelpIconPosition>
)
Expand Down

0 comments on commit e673de2

Please sign in to comment.