diff --git a/components/common/HamburgerButton.js b/components/common/HamburgerButton.js
index 77aaae75..a2d26779 100644
--- a/components/common/HamburgerButton.js
+++ b/components/common/HamburgerButton.js
@@ -13,18 +13,32 @@ export default function HamburgerButton() {
const menuItems = [
{
label: formatMessage(labels.dashboard),
- value: '/dashboard',
+ url: '/dashboard',
},
- { label: formatMessage(labels.realtime), value: '/realtime' },
+ { label: formatMessage(labels.realtime), url: '/realtime' },
!cloudMode && {
label: formatMessage(labels.settings),
- value: '/settings',
+ url: '/settings',
+ children: [
+ {
+ label: formatMessage(labels.websites),
+ url: '/settings/websites',
+ },
+ {
+ label: formatMessage(labels.teams),
+ url: '/settings/teams',
+ },
+ {
+ label: formatMessage(labels.users),
+ url: '/settings/users',
+ },
+ ],
},
{
label: formatMessage(labels.profile),
- value: '/settings/profile',
+ url: '/settings/profile',
},
- !cloudMode && { label: formatMessage(labels.logout), value: '/logout' },
+ !cloudMode && { label: formatMessage(labels.logout), url: '/logout' },
].filter(n => n);
const handleClick = () => setActive(state => !state);
diff --git a/components/common/MobileMenu.js b/components/common/MobileMenu.js
index aa737e7e..44c8da84 100644
--- a/components/common/MobileMenu.js
+++ b/components/common/MobileMenu.js
@@ -1,17 +1,36 @@
import classNames from 'classnames';
+import { useRouter } from 'next/router';
import Link from 'next/link';
import styles from './MobileMenu.module.css';
export default function MobileMenu({ items = [], onClose }) {
+ const { pathname } = useRouter();
+
+ const Items = ({ items, className }) => (
+
+ {items.map(({ label, url, children }) => {
+ const selected = pathname.startsWith(url);
+
+ return (
+ <>
+
+ {label}
+
+ {children && }
+ >
+ );
+ })}
+
+ );
+
return (
-
- {items.map(({ label, value }) => (
-
- {label}
-
- ))}
-
+
);
}
diff --git a/components/common/MobileMenu.module.css b/components/common/MobileMenu.module.css
index aa9aafd0..cfe6cf37 100644
--- a/components/common/MobileMenu.module.css
+++ b/components/common/MobileMenu.module.css
@@ -25,5 +25,15 @@
}
a.item {
+ color: var(--base600);
+}
+
+a.item.selected,
+.submenu a.item.selected {
color: var(--base900);
}
+
+.submenu a.item {
+ color: var(--base600);
+ margin-left: 40px;
+}
diff --git a/components/common/SettingsTable.js b/components/common/SettingsTable.js
new file mode 100644
index 00000000..ac29d54e
--- /dev/null
+++ b/components/common/SettingsTable.js
@@ -0,0 +1,36 @@
+import { Table, TableHeader, TableBody, TableRow, TableCell, TableColumn } from 'react-basics';
+import styles from './SettingsTable.module.css';
+
+export default function SettingsTable({ columns = [], data = [], children, cellRender }) {
+ return (
+
+
+ {(column, index) => {
+ return (
+
+ {column.label}
+
+ );
+ }}
+
+
+ {(row, keys, rowIndex) => {
+ row.action = children(row, keys, rowIndex);
+
+ return (
+
+ {(data, key, colIndex) => {
+ return (
+
+
+ {cellRender ? cellRender(row, data, key, colIndex) : data[key]}
+
+ );
+ }}
+
+ );
+ }}
+
+
+ );
+}
diff --git a/components/common/SettingsTable.module.css b/components/common/SettingsTable.module.css
new file mode 100644
index 00000000..fd6cddfa
--- /dev/null
+++ b/components/common/SettingsTable.module.css
@@ -0,0 +1,44 @@
+.cell {
+ align-items: center;
+}
+
+.row .cell:last-child {
+ gap: 10px;
+ justify-content: flex-end;
+}
+
+.label {
+ display: none;
+ font-weight: 700;
+}
+
+@media screen and (max-width: 992px) {
+ .header .cell {
+ display: none;
+ }
+
+ .label {
+ display: block;
+ min-width: 100px;
+ }
+
+ .row .cell {
+ padding-left: 0;
+ flex-basis: 100%;
+ }
+}
+
+@media screen and (max-width: 1200px) {
+ .row {
+ flex-wrap: wrap;
+ }
+
+ .header .cell:last-child {
+ display: none;
+ }
+
+ .row .cell:last-child {
+ padding-left: 0;
+ flex-basis: 100%;
+ }
+}
diff --git a/components/layout/NavBar.module.css b/components/layout/NavBar.module.css
index 6c2faaaf..05dce2af 100644
--- a/components/layout/NavBar.module.css
+++ b/components/layout/NavBar.module.css
@@ -49,6 +49,10 @@
border-bottom: 2px solid transparent;
}
+.links span {
+ white-space: nowrap;
+}
+
.links a:hover {
color: var(--font-color100);
border-bottom: 2px solid var(--primary400);
diff --git a/components/layout/PageHeader.js b/components/layout/PageHeader.js
index 0d014316..05c87f73 100644
--- a/components/layout/PageHeader.js
+++ b/components/layout/PageHeader.js
@@ -1,13 +1,9 @@
import React from 'react';
-import classNames from 'classnames';
-import { useBreakpoint } from 'react-basics';
import styles from './PageHeader.module.css';
export default function PageHeader({ title, children }) {
- const breakPoint = useBreakpoint();
-
return (
-
+
diff --git a/components/layout/PageHeader.module.css b/components/layout/PageHeader.module.css
index d5481727..5ea85b70 100644
--- a/components/layout/PageHeader.module.css
+++ b/components/layout/PageHeader.module.css
@@ -22,10 +22,25 @@
font-size: 24px;
font-weight: 700;
gap: 20px;
- line-height: 50px;
+ height: 60px;
}
-.xs .actions,
-.sm .actions {
- flex-basis: 100%;
+.actions {
+ display: flex;
+ justify-content: flex-end;
+}
+
+@media only screen and (max-width: 992px) {
+ .header {
+ margin-bottom: 10px;
+ }
+
+ .title {
+ font-size: 18px;
+ }
+
+ .actions {
+ flex-basis: 100%;
+ order: -1;
+ }
}
diff --git a/components/layout/SettingsLayout.js b/components/layout/SettingsLayout.js
index 2b98aca5..ea0456e0 100644
--- a/components/layout/SettingsLayout.js
+++ b/components/layout/SettingsLayout.js
@@ -20,16 +20,16 @@ export default function SettingsLayout({ children }) {
{ key: 'profile', label: formatMessage(labels.profile), url: '/settings/profile' },
].filter(n => n);
- const getKey = () => items.find(({ url }) => pathname.startsWith(url))?.key;
+ const getKey = () => items.find(({ url }) => pathname === url)?.key;
return (
-
+
{!cloudMode && (
-
+
)}
-
+
{children}
diff --git a/components/layout/SettingsLayout.module.css b/components/layout/SettingsLayout.module.css
index 068681f5..569b903b 100644
--- a/components/layout/SettingsLayout.module.css
+++ b/components/layout/SettingsLayout.module.css
@@ -8,6 +8,8 @@
min-height: 50vh;
}
-.hideMenu .content {
- margin: 0 auto;
+@media only screen and (max-width: 768px) {
+ .menu {
+ display: none;
+ }
}
diff --git a/components/layout/SideNav.module.css b/components/layout/SideNav.module.css
index 8b7d0d42..b664194d 100644
--- a/components/layout/SideNav.module.css
+++ b/components/layout/SideNav.module.css
@@ -13,10 +13,3 @@
padding: 0;
border-radius: var(--border-radius);
}
-
-@media only screen and (max-width: 768px) {
- .menu {
- flex-direction: row;
- flex-wrap: wrap;
- }
-}
diff --git a/components/metrics/RealtimeChart.js b/components/metrics/RealtimeChart.js
index 00bd0051..05da3cec 100644
--- a/components/metrics/RealtimeChart.js
+++ b/components/metrics/RealtimeChart.js
@@ -11,7 +11,7 @@ function mapData(data) {
data?.reduce((obj, { timestamp }) => {
const t = startOfMinute(new Date(timestamp));
if (t.getTime() > last) {
- obj = { t: format(t, 'yyyy-LL-dd HH:mm:00'), y: 1 };
+ obj = { x: format(t, 'yyyy-LL-dd HH:mm:00'), y: 1 };
arr.push(obj);
last = t.getTime();
} else {
diff --git a/components/pages/settings/profile/DateRangeSetting.js b/components/pages/settings/profile/DateRangeSetting.js
index 23921d31..2c2d70fc 100644
--- a/components/pages/settings/profile/DateRangeSetting.js
+++ b/components/pages/settings/profile/DateRangeSetting.js
@@ -12,7 +12,7 @@ export default function DateRangeSetting() {
const handleReset = () => setDateRange(DEFAULT_DATE_RANGE);
return (
-
+
diff --git a/components/pages/settings/profile/LanguageSetting.js b/components/pages/settings/profile/LanguageSetting.js
index 8130d33a..e5fc874d 100644
--- a/components/pages/settings/profile/LanguageSetting.js
+++ b/components/pages/settings/profile/LanguageSetting.js
@@ -14,7 +14,7 @@ export default function LanguageSetting() {
const renderValue = value => languages[value].label;
return (
-
+
saveTimezone(getTimezone());
return (
-
+
{item => - {item}
}
diff --git a/components/pages/settings/teams/TeamEditForm.js b/components/pages/settings/teams/TeamEditForm.js
index 1a9a8baa..a51d4735 100644
--- a/components/pages/settings/teams/TeamEditForm.js
+++ b/components/pages/settings/teams/TeamEditForm.js
@@ -41,7 +41,7 @@ export default function TeamEditForm({ teamId, data, onSave, readOnly }) {
};
return (
-