Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Profile tracking is not scrollable #286

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,7 @@ body {
height: 24px;
animation: spin 2s linear infinite;
}

.no-scroll {
overflow: hidden;
}
20 changes: 14 additions & 6 deletions components/ProfileTracking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Button } from "./ui/button";
import { IconTrendingUp } from "@tabler/icons-react";
import { useEffect, useState } from "react";
import { Doughnut, Line } from "react-chartjs-2";

import {
Chart as ChartJS,
CategoryScale,
Expand Down Expand Up @@ -141,6 +140,15 @@ export default function ProfileTracking({ username }: Props) {
getData();
}, []);

useEffect(() => {
const body = document.body;
body.classList.add("no-scroll");

return () => {
body.classList.remove("no-scroll");
};
}, []);

return (
<Dialog>
<DialogTrigger>
Expand All @@ -149,19 +157,19 @@ export default function ProfileTracking({ username }: Props) {
Profile Tracking
</Button>
</DialogTrigger>
<DialogContent className="overflow-hidden w-full h-[550px]">
<DialogHeader className=" overflow-hidden">
<DialogContent className="overflow-hidden w-full h-[750px]">
<DialogHeader className="overflow-hidden">
<DialogTitle className="flex gap-2 items-center justify-start">
Profile Tracking
<IconTrendingUp stroke={3} className="w-5 h-5" />
</DialogTitle>
</DialogHeader>
<DialogDescription className="flex w-full p-2 overflow-y-auto flex-col gap-2">
<DialogDescription className="flex w-full p-2 overflow-auto flex-col gap-2">
<div className="flex w-full flex-col gap-4">
<div className="w-full">
{PieChartData && (
<>
<h1 className=" font-medium text-base py-2 text-gray-200">
<h1 className="font-medium text-base py-2 text-gray-200">
Types of Events
</h1>
<Doughnut data={PieChartData} />
Expand All @@ -171,7 +179,7 @@ export default function ProfileTracking({ username }: Props) {
<div className="">
{LineChartData && (
<>
<h1 className=" font-medium text-base py-2 text-gray-200">
<h1 className="font-medium text-base py-2 text-gray-200">
Events over time
</h1>
<Line
Expand Down
Loading