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

@ -0,0 +1,27 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import MenuButton from 'components/common/MenuButton';
import Gear from 'assets/gear.svg';
import useStore, { setDashboard } from 'store/app';
const selector = state => state.dashboard;
export default function DashboardSettingsButton() {
const settings = useStore(selector);
const menuOptions = [
{
label: <FormattedMessage id="message.toggle-charts" defaultMessage="Toggle charts" />,
value: 'charts',
},
];
function handleSelect(value) {
if (value === 'charts') {
setDashboard({ showCharts: !settings.showCharts });
}
//setDashboard(value);
}
return <MenuButton icon={<Gear />} options={menuOptions} onSelect={handleSelect} hideLabel />;
}