Added website limit and show more button. Closes #592.

This commit is contained in:
Mike Cao 2022-03-01 23:03:50 -08:00
parent 7a3c1e9faa
commit 373dbf50ba
8 changed files with 87 additions and 26 deletions

View file

@ -1,10 +1,23 @@
import create from 'zustand';
import { DEFAULT_LOCALE, DEFAULT_THEME, LOCALE_CONFIG, THEME_CONFIG } from 'lib/constants';
import {
DASHBOARD_CONFIG,
DEFAULT_LOCALE,
DEFAULT_THEME,
LOCALE_CONFIG,
THEME_CONFIG,
DEFAULT_WEBSITE_LIMIT,
} from 'lib/constants';
import { getItem } from 'lib/web';
const defaultDashboardConfig = {
showCharts: true,
limit: DEFAULT_WEBSITE_LIMIT,
};
const initialState = {
locale: getItem(LOCALE_CONFIG) || DEFAULT_LOCALE,
theme: getItem(THEME_CONFIG) || DEFAULT_THEME,
dashboard: getItem(DASHBOARD_CONFIG) || defaultDashboardConfig,
shareToken: null,
user: null,
};
@ -27,4 +40,8 @@ export function setUser(user) {
store.setState({ user });
}
export function setDashboard(dashboard) {
store.setState({ dashboard });
}
export default store;