Added website limit and show more button. Closes #592.
This commit is contained in:
27
components/settings/DashboardSettingsButton.js
Normal file
27
components/settings/DashboardSettingsButton.js
Normal 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 />;
|
||||
}
|
||||
Reference in New Issue
Block a user