Skip to content

Commit

Permalink
automatic chores: linting [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-automatic-chores committed Feb 4, 2025
1 parent cf4d25e commit 6df77c6
Showing 1 changed file with 53 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,62 +42,61 @@ export function useToolbarItems(context: IPortfolioAggregationContext) {
)

const menuItems = useMemo<ListMenuItem[]>(
() =>
[
new ListMenuItem(null, strings.ExcelExportButtonLabel)
.setIcon('ExcelLogoInverse')
.setOnClick(exportToExcel)
.setDisabled(context.state.isChangingView)
.setStyle({ color: '#10793F' })
.setHidden(!context.props.showExcelExportButton),
new ListMenuItem(context.state.currentView?.title, strings.PortfolioViewsListName)
.setIcon(Icons.ContentView)
.setWidth('fit-content')
.setStyle({ minWidth: '145px' })
.setDisabled(context.state.isChangingView)
.setHidden(!context.props.showViewSelector)
.setItems(
[
new ListMenuItem(strings.ListViewText)
.setIcon(AppsListRegular)
.makeCheckable({
name: 'renderMode',
value: 'list'
})
.setOnClick(() => {
context.dispatch(TOGGLE_COMPACT())
}),
new ListMenuItem(strings.CompactViewText)
.setIcon(TextBulletListLtrRegular)
.makeCheckable({
name: 'renderMode',
value: 'compactList'
})
.setOnClick(() => {
context.dispatch(TOGGLE_COMPACT())
}),
ListMenuItemDivider,
...views,
ListMenuItemDivider,
new ListMenuItem(strings.NewViewText).setIcon(Icons.FormNew).setOnClick(() => {
context.dispatch(SET_VIEW_FORM_PANEL({ isOpen: true }))
() => [
new ListMenuItem(null, strings.ExcelExportButtonLabel)
.setIcon('ExcelLogoInverse')
.setOnClick(exportToExcel)
.setDisabled(context.state.isChangingView)
.setStyle({ color: '#10793F' })
.setHidden(!context.props.showExcelExportButton),
new ListMenuItem(context.state.currentView?.title, strings.PortfolioViewsListName)
.setIcon(Icons.ContentView)
.setWidth('fit-content')
.setStyle({ minWidth: '145px' })
.setDisabled(context.state.isChangingView)
.setHidden(!context.props.showViewSelector)
.setItems(
[
new ListMenuItem(strings.ListViewText)
.setIcon(AppsListRegular)
.makeCheckable({
name: 'renderMode',
value: 'list'
})
.setOnClick(() => {
context.dispatch(TOGGLE_COMPACT())
}),
new ListMenuItem(strings.EditViewText).setIcon(Icons.Edit).setOnClick(() => {
context.dispatch(
SET_VIEW_FORM_PANEL({ isOpen: true, view: context.state.currentView })
)
new ListMenuItem(strings.CompactViewText)
.setIcon(TextBulletListLtrRegular)
.makeCheckable({
name: 'renderMode',
value: 'compactList'
})
],
checkedValues
),
new ListMenuItem(null, strings.FilterText)
.setIcon('Filter')
.setOnClick(() => {
context.dispatch(TOGGLE_FILTER_PANEL())
})
.setDisabled(context.state.isChangingView)
.setHidden(!context.props.showFilters)
],
.setOnClick(() => {
context.dispatch(TOGGLE_COMPACT())
}),
ListMenuItemDivider,
...views,
ListMenuItemDivider,
new ListMenuItem(strings.NewViewText).setIcon(Icons.FormNew).setOnClick(() => {
context.dispatch(SET_VIEW_FORM_PANEL({ isOpen: true }))
}),
new ListMenuItem(strings.EditViewText).setIcon(Icons.Edit).setOnClick(() => {
context.dispatch(
SET_VIEW_FORM_PANEL({ isOpen: true, view: context.state.currentView })
)
})
],
checkedValues
),
new ListMenuItem(null, strings.FilterText)
.setIcon('Filter')
.setOnClick(() => {
context.dispatch(TOGGLE_FILTER_PANEL())
})
.setDisabled(context.state.isChangingView)
.setHidden(!context.props.showFilters)
],
[context.state, context.props]
)

Expand Down

0 comments on commit 6df77c6

Please sign in to comment.