Fix favicons and spelling in top sources

This commit is contained in:
Uku Taht 2021-08-18 15:21:47 +03:00
parent 3d3601c332
commit 128f8dbf2e
2 changed files with 8 additions and 6 deletions

View File

@ -8,7 +8,7 @@ import numberFormatter, {durationFormatter} from '../../number-formatter'
import {parseQuery} from '../../query'
const TITLES = {
sources: 'Top sources',
sources: 'Top Sources',
utm_mediums: 'Top UTM mediums',
utm_sources: 'Top UTM sources',
utm_campaigns: 'Top UTM campaigns'
@ -85,7 +85,10 @@ class SourcesModal extends React.Component {
return (
<tr className="text-sm dark:text-gray-200" key={source.name}>
<td className="p-2">
<img src={`https://icons.duckduckgo.com/ip3/${source.url}.ico`} referrerPolicy="no-referrer" className="h-4 w-4 mr-2 align-middle inline" />
<img
src={`/favicon/sources/${encodeURIComponent(source.name)}`}
className="h-4 w-4 mr-2 align-middle inline"
/>
<Link className="hover:underline" to={{search: query.toString(), pathname: '/' + encodeURIComponent(this.props.site.domain)}}>{ source.name }</Link>
</td>
<td className="p-2 w-32 font-medium" align="right">{numberFormatter(source.count)}</td>

View File

@ -59,8 +59,7 @@ class AllSources extends React.Component {
to={{search: query.toString()}}
>
<img
src={`/favicon/sources/${referrer.name}`}
referrerPolicy="no-referrer"
src={`/favicon/sources/${encodeURIComponent(referrer.name)}`}
className="inline w-4 h-4 mr-2 -mt-px align-middle"
/>
{ referrer.name }
@ -173,7 +172,7 @@ class UTMSources extends React.Component {
>
<span className="flex px-2 py-1.5 dark:text-gray-300 relative z-9 break-all">
<Link
<Link
className="md:truncate block hover:underline"
to={{search: query.toString()}}
>
@ -214,7 +213,7 @@ class UTMSources extends React.Component {
return (
<React.Fragment>
<div className="flex justify-between w-full">
<h3 className="font-bold dark:text-gray-100">Top sources</h3>
<h3 className="font-bold dark:text-gray-100">Top Sources</h3>
{ this.props.renderTabs() }
</div>
{ this.state.loading && <div className="mx-auto loading mt-44"><div></div></div> }