Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default view mode from settings #574

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const SMALL_DEVICES_BREAKPOINTS: Breakpoint[] = [Breakpoint.XS, Breakpoin
export const DEFAULT_STICKY_MOBILE_NAVBAR_HEIGHT = 50;
export const DEFAULT_STICKY_NAVBAR_HEIGHT = 72;
export const DEFAULT_TAB = Tab.Explore;
export const DEFAULT_VIEW_MODE = ViewMode.Grid;
export const DEFAULT_VIEW_MODE: ViewMode = window.baseDS.view_mode || ViewMode.Grid;
export const DEFAULT_GRID_ITEMS_SIZE = GridItemsSize.Small;
export const DEFAULT_FINANCES_KIND = FinancesKind.Funding;
export const DEFAULT_CLASSIFY = ClassifyOption.Category;
Expand Down
6 changes: 3 additions & 3 deletions web/src/layout/navigation/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import isEmpty from 'lodash/isEmpty';
import isUndefined from 'lodash/isUndefined';
import { createMemo, Show } from 'solid-js';

import { ALL_OPTION, EXPLORE_PATH, GUIDE_PATH, SCREENSHOTS_PATH, STATS_PATH } from '../../data';
import { SVGIconKind, ViewMode } from '../../types';
import { ALL_OPTION, DEFAULT_VIEW_MODE, EXPLORE_PATH, GUIDE_PATH, SCREENSHOTS_PATH, STATS_PATH } from '../../data';
import { SVGIconKind } from '../../types';
import isExploreSection from '../../utils/isExploreSection';
import scrollToTop from '../../utils/scrollToTop';
import DownloadDropdown from '../common/DownloadDropdown';
Expand All @@ -30,7 +30,7 @@ const Header = () => {

const resetDefaultExploreValues = () => {
const groups = window.baseDS.groups;
setViewMode(ViewMode.Grid);
setViewMode(DEFAULT_VIEW_MODE);
setSelectedGroup(!isUndefined(groups) ? groups[0].normalized_name : ALL_OPTION);
};

Expand Down
1 change: 1 addition & 0 deletions web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface BaseData {
members_category?: string;
qr_code?: string;
upcoming_event?: Event;
view_mode?: ViewMode;
header?: HeaderContent;
footer?: FooterContent;
}
Expand Down