diff --git a/components/graphs/ContributionGraph.js b/components/graphs/ContributionGraph.js
index 3d72ea3..67f2475 100644
--- a/components/graphs/ContributionGraph.js
+++ b/components/graphs/ContributionGraph.js
@@ -1,5 +1,6 @@
import React from 'react'
import { LineChart, Line, Tooltip, YAxis, XAxis, ResponsiveContainer, CartesianGrid } from 'recharts';
+import CustomTooltip from '../reuse/CustomTooltip';
const ContributionGraph = ({ weeks,username }) => {
let contributions = []
@@ -20,25 +21,6 @@ const ContributionGraph = ({ weeks,username }) => {
36 + presentDay
);
- const CustomTooltip = ({ active, payload, label }) => {
- if (active && payload && payload.length) {
- return (
-
-
- {`Contribution : ${payload[0].value}`}
-
-
-
- {`Date : ${label}`}
-
-
-
- );
- }
-
- return null;
- };
-
const tickDate = value => {
const roundVal = new Date(value).getDate();
@@ -63,7 +45,7 @@ const ContributionGraph = ({ weeks,username }) => {
>
}
+ content={}
/>
{
width={24}
tickFormatter={tickFork}
/>
- } />
+ } />
diff --git a/components/graphs/MostStar.js b/components/graphs/MostStar.js
index 45bd637..aa785b6 100644
--- a/components/graphs/MostStar.js
+++ b/components/graphs/MostStar.js
@@ -44,7 +44,7 @@ const MostStar = ({ repos }) => {
width={24}
tickFormatter={tickFork}
/>
- } />
+ } />
diff --git a/components/reuse/CustomTooltip.js b/components/reuse/CustomTooltip.js
index 53081ee..dd99523 100644
--- a/components/reuse/CustomTooltip.js
+++ b/components/reuse/CustomTooltip.js
@@ -1,17 +1,17 @@
import React from 'react';
-const CustomTooltip = ({ active, payload }) => {
+const CustomTooltip = ({ active, payload, customLabel1, customLabel2, label }) => {
if (active && payload && payload.length) {
return (
- Repository :
- {payload[0].payload.name}
+ {customLabel1} :
+ {label}
- Star Count :
+ {customLabel2} :
{payload[0].value}