import { Dialog, Transition } from "@headlessui/react";
import Link from "next/link";
import { Fragment, useEffect, useRef, useState } from "react";
const web = {
version: "v4.4.1"
};
const logs = [
{
version: "v4.4.1",
pre: false,
notes: null,
highlights: true,
changes: [
"New player layout for mobile devices",
"Added seek buttons in the player",
"Added previous and next episode buttons in the player",
"Added rate modal when user finished watching the whole series",
"Fix: only half of the episodes has episodes thumbnail",
"Fix: pressing back button in anime info page redirects user to the wrong page",
"Progressively migrate codebase to typescript"
]
}
// {
// version: "v4.4.0",
// pre: false,
// notes: null,
// highlights: false,
// changes: [
// "Added rate modal when user finished watching the whole series",
// "Fix: only half of the episodes has episodes thumbnail",
// "Fix: pressing back button in anime info page redirects user to the wrong page",
// "Progressively migrate codebase to typescript"
// ]
// }
// {
// version: "v4.3.1",
// pre: true,
// notes: null,
// highlights: false,
// changes: [
// "Fix: Auto Next Episode forcing to play sub even if dub is selected",
// "Fix: Episode metadata not showing after switching to dub",
// "Fix: Profile picture weirdly cropped",
// "Fix: Weird padding on the navbar in profile page",
// ],
// },
// {
// version: "v4.3.0",
// pre: true,
// notes: null,
// highlights: false,
// changes: [
// "Added changelogs section",
// "Added recommendations based on user lists",
// "New Player!",
// "And other minor bug fixes!",
// ],
// },
];
export default function ChangeLogs() {
let [isOpen, setIsOpen] = useState(false);
let completeButtonRef = useRef(null);
function closeModal() {
localStorage.setItem("version", web.version);
setIsOpen(false);
}
function getVersion() {
let version = localStorage.getItem("version");
if (version !== web.version) {
setIsOpen(true);
}
}
useEffect(() => {
getVersion();
}, []);
return (
<>
{version} {pre && ( pre )}
*{notes}
)} {children}