fix: lock body scroll + remove scrollbar on wrapup share card
Some checks failed
CI / Check / Test (push) Has been cancelled
Some checks failed
CI / Check / Test (push) Has been cancelled
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useRef, useState } from "react"
|
import { useEffect, useRef, useState } from "react"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { Download, Share2, X } from "lucide-react"
|
import { Download, Share2, X } from "lucide-react"
|
||||||
import html2canvas from "html2canvas-pro"
|
import html2canvas from "html2canvas-pro"
|
||||||
@@ -18,6 +18,11 @@ export function WrapUpShareCard({ report, onClose }: Props) {
|
|||||||
const cardRef = useRef<HTMLDivElement>(null)
|
const cardRef = useRef<HTMLDivElement>(null)
|
||||||
const [exporting, setExporting] = useState(false)
|
const [exporting, setExporting] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.body.style.overflow = "hidden"
|
||||||
|
return () => { document.body.style.overflow = "" }
|
||||||
|
}, [])
|
||||||
|
|
||||||
const watchHours = Math.round(report.total_watch_time_minutes / 60)
|
const watchHours = Math.round(report.total_watch_time_minutes / 60)
|
||||||
const topGenre = report.top_genres[0]?.genre
|
const topGenre = report.top_genres[0]?.genre
|
||||||
const topDirector = report.top_directors[0]?.name
|
const topDirector = report.top_directors[0]?.name
|
||||||
@@ -66,7 +71,7 @@ export function WrapUpShareCard({ report, onClose }: Props) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="max-h-[75vh] overflow-y-auto rounded-2xl">
|
<div className="max-h-[75vh] rounded-2xl">
|
||||||
<div
|
<div
|
||||||
ref={cardRef}
|
ref={cardRef}
|
||||||
className="relative w-[360px] overflow-hidden rounded-2xl"
|
className="relative w-[360px] overflow-hidden rounded-2xl"
|
||||||
|
|||||||
Reference in New Issue
Block a user