hopefully this works

pull/885/head
Nisarg 2021-10-11 12:30:14 -07:00
parent db5af2a140
commit de70b00f42
3 changed files with 44 additions and 4 deletions

View File

@ -0,0 +1,15 @@
import React from 'react';
import MetricsTable from './MetricsTable';
import { FormattedMessage } from 'react-intl';
export default function CityTable({ websiteId, ...props }) {
return (
<MetricsTable
{...props}
title={<FormattedMessage id="metrics.city" defaultMessage="City" />}
type="city"
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
websiteId={websiteId}
/>
);
}

View File

@ -0,0 +1,15 @@
import React from 'react';
import MetricsTable from './MetricsTable';
import { FormattedMessage } from 'react-intl';
export default function RegionTable({ websiteId, ...props }) {
return (
<MetricsTable
{...props}
title={<FormattedMessage id="metrics.region" defaultMessage="Region" />}
type="region"
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
websiteId={websiteId}
/>
);
}

View File

@ -16,6 +16,8 @@ import BrowsersTable from '../metrics/BrowsersTable';
import OSTable from '../metrics/OSTable';
import DevicesTable from '../metrics/DevicesTable';
import CountriesTable from '../metrics/CountriesTable';
import RegionTable from '../metrics/RegionTable';
import CityTable from '../metrics/CityTable';
import EventsTable from '../metrics/EventsTable';
import EventsChart from '../metrics/EventsChart';
import useFetch from 'hooks/useFetch';
@ -151,12 +153,20 @@ export default function WebsiteDetails({ websiteId }) {
</GridColumn>
</GridRow>
<GridRow>
<GridColumn xs={12} md={12} lg={8}>
<WorldMap data={countryData} />
</GridColumn>
<GridColumn xs={12} md={12} lg={4}>
<GridColumn md={12} lg={4}>
<CountriesTable {...tableProps} onDataLoad={setCountryData} />
</GridColumn>
<GridColumn md={12} lg={4}>
<RegionTable {...tableProps} />
</GridColumn>
<GridColumn md={12} lg={4}>
<CityTable {...tableProps} />
</GridColumn>
</GridRow>
<GridRow>
<GridColumn xs={12} md={12} lg={12}>
<WorldMap data={countryData} />
</GridColumn>
</GridRow>
<GridRow className={classNames({ [styles.hidden]: !eventsData?.length > 0 })}>
<GridColumn xs={12} md={12} lg={4}>