Added All time date filter option.

This commit is contained in:
Mike Cao 2022-01-14 00:04:07 -08:00
parent 5f359b3cf1
commit a101d639d3
4 changed files with 34 additions and 14 deletions

View file

@ -12,7 +12,7 @@ import styles from './WebsiteList.module.css';
export default function WebsiteList({ userId }) {
const { data } = useFetch('/api/websites', { params: { user_id: userId } });
const [hideCharts, setHideCharts] = useState(false);
const [showCharts, setShowCharts] = useState(true);
if (!data) {
return null;
@ -43,7 +43,7 @@ export default function WebsiteList({ userId }) {
<Button
tooltip={<FormattedMessage id="message.toggle-charts" defaultMessage="Toggle charts" />}
icon={<Chart />}
onClick={() => setHideCharts(!hideCharts)}
onClick={() => setShowCharts(!showCharts)}
/>
</div>
{data.map(({ website_id, name, domain }) => (
@ -52,7 +52,7 @@ export default function WebsiteList({ userId }) {
websiteId={website_id}
title={name}
domain={domain}
hideChart={hideCharts}
showChart={showCharts}
showLink
/>
</div>