diff --git a/backend/src/services/platforms/tumblr.service.ts b/backend/src/services/platforms/tumblr.service.ts index 08e1c2a..12c5b49 100644 --- a/backend/src/services/platforms/tumblr.service.ts +++ b/backend/src/services/platforms/tumblr.service.ts @@ -6,7 +6,9 @@ import { ENV } from "../../config/env"; export class TumblrService { async getRequestToken(userId: string) { - const callbackUrl = `${ENV.APP.BACKEND_URL}/api/platform/tumblr/callback?state=${userId}`; + const baseUrl = ENV.APP.BACKEND_URL; + const apiPath = baseUrl.endsWith("/api") ? "" : "/api"; + const callbackUrl = `${baseUrl}${apiPath}/platform/tumblr/callback?state=${userId}`; const requestData = { url: `https://www.tumblr.com/oauth/request_token?oauth_callback=${encodeURIComponent(callbackUrl)}`, method: "POST", diff --git a/frontend/src/components/dashboard/PostDistributionChart.tsx b/frontend/src/components/dashboard/PostDistributionChart.tsx index c521fa0..7f7e24d 100644 --- a/frontend/src/components/dashboard/PostDistributionChart.tsx +++ b/frontend/src/components/dashboard/PostDistributionChart.tsx @@ -1,7 +1,7 @@ "use client"; import { useMemo } from "react"; -import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend } from "recharts"; +import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from "recharts"; const platformColors: Record = { mastodon: "#6364FF", @@ -51,14 +51,15 @@ export default function PostDistributionChart({ data }: PostDistributionChartPro

Total posts by platform

-
+ {/* Chart area — no Legend inside so SVG fills 100% and centering math works */} +
- ( - - {value} - - )} - /> - {/* Total Count in Center */} + {/* Total Count in Center — cy="50%" and top-[50%] now match exactly */}
{totalPosts} @@ -102,6 +90,19 @@ export default function PostDistributionChart({ data }: PostDistributionChartPro
+ + {/* Manual legend rendered outside the SVG */} +
+ {chartData.map((entry) => ( +
+ + {entry.name} +
+ ))} +
); }