diff --git a/components/common/Button.module.css b/components/common/Button.module.css index 2327db9e..b6edc60e 100644 --- a/components/common/Button.module.css +++ b/components/common/Button.module.css @@ -29,7 +29,7 @@ } .large { - font-size: var(--font-size-large); + font-size: var(--font-size-lg); } .small { diff --git a/components/common/Link.module.css b/components/common/Link.module.css index 93deda65..0476bd92 100644 --- a/components/common/Link.module.css +++ b/components/common/Link.module.css @@ -17,7 +17,7 @@ a.link:hover span { } a.link.large { - font-size: var(--font-size-large); + font-size: var(--font-size-lg); } a.link.small { diff --git a/components/common/MobileMenu.module.css b/components/common/MobileMenu.module.css index bdf95647..d1a6f19b 100644 --- a/components/common/MobileMenu.module.css +++ b/components/common/MobileMenu.module.css @@ -21,7 +21,7 @@ } .item { - font-size: var(--font-size-large); + font-size: var(--font-size-lg); } .item + .item { diff --git a/components/layout/GridRow.js b/components/layout/GridRow.js new file mode 100644 index 00000000..8f840a84 --- /dev/null +++ b/components/layout/GridRow.js @@ -0,0 +1,18 @@ +import { Row, cloneChildren } from 'react-basics'; +import styles from './GridRow.module.css'; +import classNames from 'classnames'; + +export default function GridRow(props) { + const { children, className, ...rowProps } = props; + return ( + + {breakpoint => + cloneChildren(children, () => { + return { + className: classNames(styles.column, styles[breakpoint]), + }; + }) + } + + ); +} diff --git a/components/layout/GridRow.module.css b/components/layout/GridRow.module.css new file mode 100644 index 00000000..dc1e31f8 --- /dev/null +++ b/components/layout/GridRow.module.css @@ -0,0 +1,21 @@ +.column { + padding: 20px; + border-top: 1px solid var(--base200); + border-left: 1px solid var(--base200); +} + +.column:first-child { + padding-left: 0; + border-left: 0; +} + +.column:last-child { + padding-right: 0; +} + +.column.xs, +.column.sm, +.column.md { + border-left: 0; + border-right: 0; +} diff --git a/components/layout/Header.js b/components/layout/Header.js index 13c3954e..a0063cfb 100644 --- a/components/layout/Header.js +++ b/components/layout/Header.js @@ -1,6 +1,6 @@ +import { Row, Column } from 'react-basics'; import { useRouter } from 'next/router'; import { FormattedMessage } from 'react-intl'; -import classNames from 'classnames'; import Link from 'components/common/Link'; import Icon from 'components/common/Icon'; import LanguageButton from 'components/settings/LanguageButton'; @@ -25,31 +25,33 @@ export default function Header() { return ( <> {allowUpdate && } -
-
- } size="large" className={styles.logo} /> - umami -
- - {user && !adminDisabled && ( -
- - - - - - - - - -
- )} -
- - - - {user && !adminDisabled && } -
+
+ + + } size="large" className={styles.logo} /> + umami + + + {user && !adminDisabled && ( +
+ + + + + + + + + +
+ )} + + + + + {user && !adminDisabled && } + +
); diff --git a/components/layout/Header.module.css b/components/layout/Header.module.css index 3c7d4bc0..44bac0c5 100644 --- a/components/layout/Header.module.css +++ b/components/layout/Header.module.css @@ -10,7 +10,7 @@ font-size: var(--font-size-lg); display: flex; align-items: center; - line-height: 1.4; + flex-direction: row; } .logo { @@ -33,6 +33,7 @@ .buttons { flex: 1; display: flex; + flex-direction: row; justify-content: flex-end; align-items: center; } diff --git a/components/metrics/WebsiteChart.js b/components/metrics/WebsiteChart.js index e4a7f527..a76e1f93 100644 --- a/components/metrics/WebsiteChart.js +++ b/components/metrics/WebsiteChart.js @@ -1,5 +1,5 @@ -import React, { useMemo } from 'react'; -import classNames from 'classnames'; +import { useMemo } from 'react'; +import { Row, Column } from 'react-basics'; import PageviewsChart from './PageviewsChart'; import MetricsBar from './MetricsBar'; import WebsiteHeader from './WebsiteHeader'; @@ -20,7 +20,6 @@ export default function WebsiteChart({ title, domain, stickyHeader = false, - showLink = false, showChart = true, onDataLoad = () => {}, }) { @@ -80,33 +79,34 @@ export default function WebsiteChart({ } return ( -
- -
- - -
+ <> + + + + + + -
-
+ + -
-
-
-
-
+ + + + + {error && } {showChart && ( )} -
-
-
+ + + ); } diff --git a/components/metrics/WebsiteChart.module.css b/components/metrics/WebsiteChart.module.css index 19562820..d108366e 100644 --- a/components/metrics/WebsiteChart.module.css +++ b/components/metrics/WebsiteChart.module.css @@ -7,10 +7,11 @@ .chart { position: relative; + padding-bottom: 20px; } .title { - font-size: var(--font-size-large); + font-size: var(--font-size-lg); line-height: 60px; font-weight: 600; } @@ -37,13 +38,5 @@ } .filter { - display: flex; - justify-content: flex-end; - align-items: center; -} - -@media only screen and (max-width: 992px) { - .filter { - display: block; - } + align-self: center; } diff --git a/components/metrics/WebsiteHeader.js b/components/metrics/WebsiteHeader.js index 47ac75f3..5d59b199 100644 --- a/components/metrics/WebsiteHeader.js +++ b/components/metrics/WebsiteHeader.js @@ -1,8 +1,6 @@ import { Row, Column } from 'react-basics'; import Favicon from 'components/common/Favicon'; import OverflowText from 'components/common/OverflowText'; -import RefreshButton from 'components/common/RefreshButton'; -import ButtonLayout from 'components/layout/ButtonLayout'; import PageHeader from 'components/layout/PageHeader'; import ActiveUsers from './ActiveUsers'; import styles from './WebsiteHeader.module.css'; @@ -11,18 +9,13 @@ export default function WebsiteHeader({ websiteId, title, domain }) { return ( - + {title} - + - - - - - ); diff --git a/components/pages/WebsiteDetails.js b/components/pages/WebsiteDetails.js index e317ee49..9f53c9b6 100644 --- a/components/pages/WebsiteDetails.js +++ b/components/pages/WebsiteDetails.js @@ -1,10 +1,11 @@ import { useState } from 'react'; -import { Row, Column } from 'react-basics'; +import { Column } from 'react-basics'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import classNames from 'classnames'; import WebsiteChart from 'components/metrics/WebsiteChart'; import WorldMap from 'components/common/WorldMap'; import Page from 'components/layout/Page'; +import GridRow from 'components/layout/GridRow'; import MenuLayout from 'components/layout/MenuLayout'; import Link from 'components/common/Link'; import Loading from 'components/common/Loading'; @@ -15,11 +16,8 @@ import OSTable from 'components/metrics/OSTable'; import DevicesTable from 'components/metrics/DevicesTable'; import CountriesTable from 'components/metrics/CountriesTable'; import LanguagesTable from 'components/metrics/LanguagesTable'; -import EventsTable from 'components/metrics/EventsTable'; -import EventsChart from 'components/metrics/EventsChart'; import ScreenTable from 'components/metrics/ScreenTable'; import QueryParametersTable from 'components/metrics/QueryParametersTable'; -import EventDataButton from 'components/common/EventDataButton'; import useFetch from 'hooks/useFetch'; import usePageQuery from 'hooks/usePageQuery'; import { DEFAULT_ANIMATION_DURATION } from 'lib/constants'; @@ -35,7 +33,6 @@ const messages = defineMessages({ devices: { id: 'metrics.devices', defaultMessage: 'Devices' }, countries: { id: 'metrics.countries', defaultMessage: 'Countries' }, languages: { id: 'metrics.languages', defaultMessage: 'Languages' }, - events: { id: 'metrics.events', defaultMessage: 'Events' }, query: { id: 'metrics.query-parameters', defaultMessage: 'Query parameters' }, }); @@ -48,7 +45,6 @@ const views = { screen: ScreenTable, country: CountriesTable, language: LanguagesTable, - event: EventsTable, query: QueryParametersTable, }; @@ -56,7 +52,6 @@ export default function WebsiteDetails({ websiteId }) { const { data } = useFetch(`/websites/${websiteId}`); const [chartLoaded, setChartLoaded] = useState(false); const [countryData, setCountryData] = useState(); - const [eventsData, setEventsData] = useState(); const { resolve, query: { view }, @@ -65,7 +60,7 @@ export default function WebsiteDetails({ websiteId }) { const BackButton = () => (
- } size="small"> + } sizes="small">
@@ -107,10 +102,6 @@ export default function WebsiteDetails({ websiteId }) { label: formatMessage(messages.screens), value: resolve({ view: 'screen' }), }, - { - label: formatMessage(messages.events), - value: resolve({ view: 'event' }), - }, { label: formatMessage(messages.query), value: resolve({ view: 'query' }), @@ -137,57 +128,44 @@ export default function WebsiteDetails({ websiteId }) { return ( - - - - {!chartLoaded && } - - + + {!chartLoaded && } {chartLoaded && !view && ( <> - - + + - + - - - + + + - + - + - - - + + + - + - - 0 })}> - - - - - - - - + )} {view && chartLoaded && ( diff --git a/components/pages/WebsiteDetails.module.css b/components/pages/WebsiteDetails.module.css index b6b93dd3..b0632be6 100644 --- a/components/pages/WebsiteDetails.module.css +++ b/components/pages/WebsiteDetails.module.css @@ -29,14 +29,3 @@ .hidden { display: none; } - -.eventschart { - padding-top: 30px; -} - -@media only screen and (max-width: 992px) { - .menu { - display: flex; - flex-direction: column; - } -}