Skip to content

Commit

Permalink
Fixes for country search.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Nov 29, 2024
1 parent 8925283 commit 9835262
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
7 changes: 3 additions & 4 deletions src/components/metrics/CitiesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import MetricsTable, { MetricsTableProps } from './MetricsTable';
import { emptyFilter } from 'lib/filters';
import FilterLink from 'components/common/FilterLink';

import TypeIcon from 'components/common/TypeIcon';
import { useLocale } from 'components/hooks';
import { useMessages } from 'components/hooks';
import { useFormat } from 'components/hooks';

Expand All @@ -16,7 +13,9 @@ export function CitiesTable(props: MetricsTableProps) {
<FilterLink id="city" value={city} label={formatCity(city, country)}>
{country && (
<img
src={`${process.env.basePath}/images/flags/${country?.toLowerCase() || 'xx'}.png`}
src={`${process.env.basePath || ''}/images/country/${
country?.toLowerCase() || 'xx'
}.png`}
alt={country}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion src/components/metrics/CountriesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function CountriesTable({ ...props }: MetricsTableProps) {
type="country"
metric={formatMessage(labels.visitors)}
renderLabel={renderLink}
onDataLoad={handleDataLoad}
searchFormattedValues={true}
/>
);
Expand Down
16 changes: 1 addition & 15 deletions src/components/metrics/MetricsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,8 @@ export function MetricsTable({

const { data, isLoading, isFetched, error } = useWebsiteMetrics(
websiteId,
{ type, limit, search, ...params },
{ type, limit, search: searchFormattedValues ? undefined : search, ...params },
{
type,
startAt: +startDate,
endAt: +endDate,
url,
referrer,
os,
title,
browser,
device,
country,
region,
city,
limit,
search: (searchFormattedValues) ? undefined : search,
retryDelay: delay || DEFAULT_ANIMATION_DURATION,
onDataLoad,
},
Expand Down

0 comments on commit 9835262

Please sign in to comment.