diff --git a/assets/chart-bar.svg b/assets/chart-bar.svg
new file mode 100644
index 00000000..d1d72fdc
--- /dev/null
+++ b/assets/chart-bar.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/components/metrics/WebsiteChart.js b/components/metrics/WebsiteChart.js
index 0f4b48c3..fca6d541 100644
--- a/components/metrics/WebsiteChart.js
+++ b/components/metrics/WebsiteChart.js
@@ -23,6 +23,7 @@ export default function WebsiteChart({
domain,
stickyHeader = false,
showLink = false,
+ hideChart = false,
onDataLoad = () => {},
}) {
const shareToken = useShareToken();
@@ -91,13 +92,15 @@ export default function WebsiteChart({
{error &&
}
-
+ {!hideChart && (
+
+ )}
diff --git a/components/pages/WebsiteList.js b/components/pages/WebsiteList.js
index 03552470..f4c29979 100644
--- a/components/pages/WebsiteList.js
+++ b/components/pages/WebsiteList.js
@@ -1,28 +1,26 @@
-import React from 'react';
+import React, { useState } from 'react';
import { FormattedMessage } from 'react-intl';
import Link from 'components/common/Link';
import WebsiteChart from 'components/metrics/WebsiteChart';
import Page from 'components/layout/Page';
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
+import Button from 'components/common/Button';
import useFetch from 'hooks/useFetch';
import Arrow from 'assets/arrow-right.svg';
+import Chart from 'assets/chart-bar.svg';
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);
if (!data) {
return null;
}
- return (
-
- {data.map(({ website_id, name, domain }) => (
-
-
-
- ))}
- {data.length === 0 && (
+ if (data.length === 0) {
+ return (
+
- )}
+
+ );
+ }
+
+ return (
+
+
+ } onClick={() => setHideCharts(!hideCharts)} />
+
+ {data.map(({ website_id, name, domain }) => (
+
+
+
+ ))}
);
}
diff --git a/components/pages/WebsiteList.module.css b/components/pages/WebsiteList.module.css
index 816c5f36..4c2952d6 100644
--- a/components/pages/WebsiteList.module.css
+++ b/components/pages/WebsiteList.module.css
@@ -9,3 +9,10 @@
border-bottom: 0;
margin-bottom: 0;
}
+
+.menubar {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ padding-top: 10px;
+}