Messages for devices so they can be localized.
This commit is contained in:
@@ -54,13 +54,6 @@ export const DESKTOP_OS = [
|
||||
|
||||
export const MOBILE_OS = ['iOS', 'Android OS', 'BlackBerry OS', 'Windows Mobile', 'Amazon OS'];
|
||||
|
||||
export const DEVICES = {
|
||||
desktop: 'Desktop',
|
||||
laptop: 'Laptop',
|
||||
tablet: 'Tablet',
|
||||
mobile: 'Mobile',
|
||||
};
|
||||
|
||||
export const BROWSERS = {
|
||||
aol: 'AOL',
|
||||
edge: 'Edge',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import firstBy from 'thenby';
|
||||
import { BROWSERS, ISO_COUNTRIES, DEVICES } from './constants';
|
||||
import { BROWSERS, ISO_COUNTRIES } from './constants';
|
||||
import { removeTrailingSlash, getDomainName } from './url';
|
||||
|
||||
export const urlFilter = (data, { raw }) => {
|
||||
@@ -118,15 +118,14 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
};
|
||||
|
||||
export const browserFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: BROWSERS[x], y })).filter(({ x }) => x);
|
||||
data.map(({ x, y }) => ({ x: BROWSERS[x] || x, y })).filter(({ x }) => x);
|
||||
|
||||
export const osFilter = data => data.filter(({ x }) => x);
|
||||
|
||||
export const deviceFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: DEVICES[x], y })).filter(({ x }) => x);
|
||||
export const deviceFilter = data => data.filter(({ x }) => x);
|
||||
|
||||
export const countryFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: ISO_COUNTRIES[x], y })).filter(({ x }) => x);
|
||||
data.map(({ x, y }) => ({ x: ISO_COUNTRIES[x] || x, y })).filter(({ x }) => x);
|
||||
|
||||
export const percentFilter = data => {
|
||||
const total = data.reduce((n, { y }) => n + y, 0);
|
||||
|
||||
Reference in New Issue
Block a user