Skip to content

Commit

Permalink
Issue #612: fix is collapsable mobile filters
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzov96 committed Sep 28, 2023
1 parent 298ae9e commit 00e3a77
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
8 changes: 5 additions & 3 deletions js-packages/search-frontend/src/components/CalendarModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function CalendarMobile({
</div>
</div>
<button
className="openk9-calendar-modal-button-close"
className="openk9-calendar-modal-button-close"
css={css`
color: var(--openk9-grey-stone-600);
font-size: 16px;
Expand Down Expand Up @@ -295,6 +295,7 @@ export function CalendarMobile({
<div>
<input
readOnly
className="openk9-input-data openk9-first-input-for-data"
css={css`
border-radius: 50px;
height: 28px;
Expand All @@ -313,6 +314,7 @@ export function CalendarMobile({
<div>
<input
readOnly
className="openk9-input-data openk9-second-input-for-data"
css={css`
border-radius: 50px;
height: 28px;
Expand Down Expand Up @@ -347,7 +349,7 @@ export function CalendarMobile({
`}
>
<button
className="openk9-filter-horizontal-submit"
className="openk9-filter-horizontal-submit remove-filter remove-filter-data"
aria-label="rimuovi filtri"
css={css`
font-size: smaller;
Expand Down Expand Up @@ -399,7 +401,7 @@ export function CalendarMobile({
</div>
</button>
<button
className="openk9-filter-horizontal-submit"
className="openk9-filter-horizontal-submit filter-for-data"
aria-label={t("filter-for-data") || "filter for data"}
css={css`
font-size: smaller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function FiltersMobile<E>({
</div>
</div>
<button
className="openk9-button-close"
css={css`
color: var(--openk9-grey-stone-600);
font-size: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type FiltersMobileProps<E> = {
viewTabs?: boolean;
language: string;
sortAfterKey: string;
isCollapsable?: boolean;
};
function FiltersMobileLiveChange<E>({
dynamicFilters,
Expand All @@ -63,6 +64,7 @@ function FiltersMobileLiveChange<E>({
language,
viewTabs = false,
sortAfterKey,
isCollapsable = true,
}: FiltersMobileProps<E>) {
const results = useInfiniteResults<any>(
searchQuery,
Expand Down Expand Up @@ -123,7 +125,7 @@ function FiltersMobileLiveChange<E>({
</div>
</div>
<button
className="openk9-filters-list-button-close"
className="openk9-filters-list-button-close"
css={css`
color: var(--openk9-grey-stone-600);
font-size: 15px;
Expand Down Expand Up @@ -162,6 +164,7 @@ function FiltersMobileLiveChange<E>({
dynamicFilters={dynamicFilters}
language={language}
sortAfterKey={sortAfterKey}
isCollapsable={isCollapsable}
preFilters={
viewTabs ? (
<ViewAllTabs
Expand Down Expand Up @@ -297,13 +300,14 @@ function ViewAllTabs({
tabs,
onSelectedTabIndexChange,
selectedTabIndex,
isCollapsable = true,
}: {
tabs: Array<Tab>;
onSelectedTabIndexChange(index: number): void;
selectedTabIndex: number;
isCollapsable?: boolean;
}) {
const [isOpen, setIsOpen] = React.useState(true);
const isCollapsable = true;
const { t } = useTranslation();

return (
Expand Down
3 changes: 3 additions & 0 deletions js-packages/search-frontend/src/embeddable/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ export function Main({
selectedTabIndex={selectedTabIndex}
viewTabs={configuration.filtersMobileLiveChange?.viewTabs ?? false}
language={languageSelect}
isCollapsable={
configuration.filtersMobileLiveChange?.isCollapsable ?? true
}
/>
</I18nextProvider>,
configuration.filtersMobileLiveChange?.element !== undefined
Expand Down
1 change: 1 addition & 0 deletions js-packages/search-frontend/src/embeddable/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ type FiltersLiveMobileConfiguration = {
isVisible: boolean;
setIsVisible: React.Dispatch<React.SetStateAction<boolean>>;
viewTabs?: boolean | null;
isCollapsable?: boolean | null;
};

type SearchMobileConfiguration = {
Expand Down

0 comments on commit 00e3a77

Please sign in to comment.