mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
fix(website): hydration issues due to rendering on the server of client-side logic
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { getRecommendedDownload } from "../download-helper.js";
|
||||
import { getRecommendedDownload, RecommendedDownload } from "../download-helper.js";
|
||||
import "./DownloadButton.css";
|
||||
import Button from "./Button.js";
|
||||
import downloadIcon from "../assets/boxicons/bx-arrow-in-down-square-half.svg?raw";
|
||||
import packageJson from "../../../../package.json" with { type: "json" };
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
|
||||
interface DownloadButtonProps {
|
||||
big?: boolean;
|
||||
}
|
||||
|
||||
const recommendedDownload = getRecommendedDownload();
|
||||
|
||||
export default function DownloadButton({ big }: DownloadButtonProps) {
|
||||
const [ recommendedDownload, setRecommendedDownload ] = useState<RecommendedDownload | null>();
|
||||
useEffect(() => setRecommendedDownload(getRecommendedDownload()), []);
|
||||
|
||||
return (recommendedDownload &&
|
||||
<Button
|
||||
className={`download-button desktop-only ${big ? "big" : ""}`}
|
||||
|
||||
Reference in New Issue
Block a user