Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
refactor(sn-filter-pane): show filterpane border depending on compone…
Browse files Browse the repository at this point in the history
…nt and theme only (#389)
  • Loading branch information
johanlahti authored Dec 4, 2023
1 parent d82bd60 commit 28e26a3
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 10 deletions.
3 changes: 1 addition & 2 deletions packages/sn-filter-pane/src/components/ListboxContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const ListboxContainer = ({
options,
renderTracker,
env,
styles,
directQueryEnabled,
fpLayout,
} = stores.store.getState();
Expand All @@ -51,7 +50,7 @@ const ListboxContainer = ({
directQueryEnabled, layout, listBoxModel: model, constraints,
});

const showBorder = !sense || inSelection || styles?.stardustTheme?.getStyle('', '', '_cards');
const showBorder = !sense || inSelection;

const [key] = useState(uid());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IListLayout, IListboxResource } from '../../hooks/types';
import {
COLLAPSED_HEIGHT, COLUMN_MIN_WIDTH, COLUMN_SPACING, EXPANDED_HEADER_HEIGHT, ITEM_SPACING, LIST_ROW_HEIGHT, DENSE_ROW_HEIGHT, GRID_ROW_HEIGHT, ITEM_MIN_WIDTH, REMOVE_TICK_LIMIT, ITEM_MAX_WIDTH, TICK_WIDTH, FREQUENCY_ADD_WIDTH, CHAR_WIDTH, CHECKBOX_ADD_WIDTH, SCROLL_BAR_WIDTH,
COLLAPSED_HEIGHT, COLUMN_MIN_WIDTH, COLUMN_SPACING, EXPANDED_HEADER_HEIGHT, ITEM_SPACING, LIST_ROW_HEIGHT, DENSE_ROW_HEIGHT, GRID_ROW_HEIGHT, ITEM_MIN_WIDTH, REMOVE_TICK_LIMIT, ITEM_MAX_WIDTH, TICK_WIDTH, FREQUENCY_ADD_WIDTH, CHAR_WIDTH, CHECKBOX_ADD_WIDTH,
} from './grid-constants';
import { ExpandProps, IColumn, ISize } from './interfaces';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe('use styling', () => {
fontFamily: 'ComponentFontFamily',
fontWeight: 'bold',
},
stardustTheme: {},
});
});
});
3 changes: 0 additions & 3 deletions packages/sn-filter-pane/src/hooks/types/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Theme as StardustTheme } from '@nebula.js/stardust';

export type ISizing = 'originalSize' | 'alwaysFit' | 'fitWidth' | 'fitHeight' | 'stretchFit' | 'alwaysFill';

export type IColor = {
Expand Down Expand Up @@ -86,5 +84,4 @@ export interface IStyles {
popover: {
backgroundColor?: string; // TODO: should we allow customisable background image in popover mode
};
stardustTheme: StardustTheme;
}
3 changes: 0 additions & 3 deletions packages/sn-filter-pane/src/hooks/use-styling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ export default function useStyling({ app, components = [] }: ICreateStylingArgs)
textDecoration: headerFontStyle.underline ? 'underline' : 'initial',
fontStyle: (headerFontStyle.italic && 'italic') || (headerFontStyle.italic === false && 'normal') || getListboxStyle('title.main', 'fontStyle') || 'initial',
},
// The theme is only exposed here temporarilly. The idea is to not expose any theme directly,
// but instead let them populate the merged style. Remove when possible.
stardustTheme,
};

return mergedStyle;
Expand Down

0 comments on commit 28e26a3

Please sign in to comment.