Skip to content

Commit

Permalink
fix: PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
r4zendev committed Jan 1, 2025
1 parent 4b43766 commit ad4cf1f
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,6 @@ const engagementMetricsMapper = {

const PIE_COLORS = ['#007aff', '#65afff', '#98cafe', '#cde4ff', '#f0f9ff'];

const longDateFormatter = (value: string) => dayjs(value, 'MMMM YYYY').format('MMM YYYY');

const longNumberFormatter = (value: number) => {
if (value >= 1_000_000) {
return (value / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'mil';
}

if (value >= 1_000) {
return (value / 1_000).toFixed(1).replace(/\.0$/, '') + 'k';
}

return value.toString();
};

export const WebsiteCredibility: FunctionComponent<{
violations: Array<{
label: string;
Expand Down Expand Up @@ -157,8 +143,11 @@ export const WebsiteCredibility: FunctionComponent<{
barSize={46}
>
<CartesianGrid vertical={false} strokeDasharray="0" />
<XAxis dataKey="label" tickFormatter={longDateFormatter} />
<YAxis tickFormatter={longNumberFormatter} />
<XAxis
dataKey="label"
tickFormatter={value => dayjs(value, 'MMMM YYYY').format('MMM YYYY')}
/>
<YAxis tickFormatter={Intl.NumberFormat('en', { notation: 'compact' }).format} />
<RechartsTooltip
content={({ active, payload, label }) => {
if (active && payload && payload.length) {
Expand Down

0 comments on commit ad4cf1f

Please sign in to comment.