Skip to content

Commit

Permalink
Display magnifying glass for all items sizes
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sánchez García <[email protected]>
  • Loading branch information
cynthia-sg committed Nov 6, 2024
1 parent db8e5dd commit a534c16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
36 changes: 17 additions & 19 deletions ui/webapp/src/layout/explore/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import isEqual from 'lodash/isEqual';
import isUndefined from 'lodash/isUndefined';
import { createEffect, createSignal, For, on, Show } from 'solid-js';

import { GRID_SIZE, GUIDE_PATH, ZOOM_LEVELS } from '../../../data';
import { GUIDE_PATH, ZOOM_LEVELS } from '../../../data';
import { BaseItem, Item } from '../../../types';
import calculateGridItemsPerRow from '../../../utils/calculateGridItemsPerRow';
import getNormalizedName from '../../../utils/getNormalizedName';
Expand Down Expand Up @@ -110,7 +110,6 @@ export const ItemsList = (props: ItemsListProps) => {
};

const Grid = (props: Props) => {
const gridItemsSize = GRID_SIZE;
const zoom = useZoomLevel();
const updateActiveSection = useSetVisibleZoom();
const [grid, setGrid] = createSignal<GridCategoryLayout | undefined>();
Expand Down Expand Up @@ -184,24 +183,23 @@ const Grid = (props: Props) => {
</div>
</Show>

<Show when={isUndefined(gridItemsSize) || gridItemsSize !== 'large'}>
<div>
<button
onClick={() => {
updateActiveSection({
category: props.categoryName,
subcategory: subcat.subcategoryName,
bgColor: props.backgroundColor,
});
}}
class={`btn btn-link text-white ps-1 pe-2 ${styles.btnIcon}`}
aria-label={`Open ${subcat.subcategoryName} section on modal`}
>
<SVGIcon kind={SVGIconKind.MagnifyingGlass} />
</button>
</div>
</Show>
<div>
<button
onClick={() => {
updateActiveSection({
category: props.categoryName,
subcategory: subcat.subcategoryName,
bgColor: props.backgroundColor,
});
}}
class={`btn btn-link text-white ps-1 pe-2 ${styles.btnIcon}`}
aria-label={`Open ${subcat.subcategoryName} section on modal`}
>
<SVGIcon kind={SVGIconKind.MagnifyingGlass} />
</button>
</div>
</div>

<div class={`flex-grow-1 ${styles.itemsContainer}`}>
{/* Use ItemsList when subcategory has featured and no featured items */}
<Show
Expand Down
1 change: 0 additions & 1 deletion ui/webapp/src/layout/explore/grid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const Category = (props: CatProps) => {

createEffect(
() => {
console.log('isSafari ---->>>> ', props.isSafari);
if (!isUndefined(props.content)) {
const subcategoriesTmp: SubcategoryDetails[] = [];
Object.keys(props.content).forEach((subcat: string) => {
Expand Down

0 comments on commit a534c16

Please sign in to comment.