capitalize category name
This commit is contained in:
parent
dcbee729fb
commit
c9736ec0fa
|
@ -48,7 +48,7 @@ class Statistics extends Component {
|
|||
{getPercent(dnsQueries, blockedFiltering)}
|
||||
</div>
|
||||
<div className="card-title-stats">
|
||||
Blocked by Filters
|
||||
Blocked by <a href="#filters">Filters</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-chart-bg">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { getSourceData } from '../../helpers/trackers/trackers';
|
||||
import { captitalizeWords } from '../../helpers/helpers';
|
||||
|
||||
import './Popover.css';
|
||||
|
||||
|
@ -22,6 +23,8 @@ class Popover extends Component {
|
|||
</div>
|
||||
);
|
||||
|
||||
const categoryName = captitalizeWords(data.category);
|
||||
|
||||
return (
|
||||
<div className="popover-wrap">
|
||||
<div className="popover__trigger">
|
||||
|
@ -34,7 +37,7 @@ class Popover extends Component {
|
|||
</div>
|
||||
{tracker}
|
||||
<div className="popover__list-item">
|
||||
Category: <strong>{data.category}</strong>
|
||||
Category: <strong>{categoryName}</strong>
|
||||
</div>
|
||||
{source}
|
||||
</div>
|
||||
|
|
|
@ -81,3 +81,5 @@ export const getPercent = (amount, number) => {
|
|||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
export const captitalizeWords = text => text.split(/[ -_]/g).map(str => str.charAt(0).toUpperCase() + str.substr(1)).join(' ');
|
||||
|
|
Loading…
Reference in New Issue