diff --git a/web/components/page.tsx b/web/components/page.tsx index c26980ab..1bb88746 100644 --- a/web/components/page.tsx +++ b/web/components/page.tsx @@ -1,6 +1,8 @@ import clsx from 'clsx' +import { useEffect } from 'react' import { BottomNavBar } from './nav/nav-bar' import Sidebar from './nav/sidebar' +import { initPreviews } from 'link-summoner' export function Page(props: { margin?: boolean @@ -10,6 +12,14 @@ export function Page(props: { children?: any }) { const { margin, assertUser, children, rightSidebar, suspend } = props + useEffect(() => { + if (typeof document !== 'undefined') { + // This seems to work... + console.log(document) + // But not this... + initPreviews() + } + }, []) return ( <> diff --git a/web/package.json b/web/package.json index a240d470..362f98df 100644 --- a/web/package.json +++ b/web/package.json @@ -29,6 +29,7 @@ "firebase": "9.6.0", "gridjs": "5.0.2", "gridjs-react": "5.0.2", + "link-summoner": "^1.2.0", "lodash": "4.17.21", "next": "12.1.2", "react": "17.0.2", diff --git a/yarn.lock b/yarn.lock index 98cdf4c2..a8d7d556 100644 --- a/yarn.lock +++ b/yarn.lock @@ -905,6 +905,11 @@ resolved "https://registry.yarnpkg.com/@panva/asn1.js/-/asn1.js-1.0.0.tgz#dd55ae7b8129e02049f009408b97c61ccf9032f6" integrity sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw== +"@popperjs/core@^2.9.0": + version "2.11.5" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64" + integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw== + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" @@ -3679,6 +3684,13 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +link-summoner@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/link-summoner/-/link-summoner-1.2.0.tgz#f9c69ed76c9e82c694e527d1ca598d8138cc9da5" + integrity sha512-awozkhDjboDAK8CbboMOucxAmhB9ioqheXnmBWHuV5nUHVh53SavEl93O124r5Bvaaiqi7mEBjxU8lCd6QOnnA== + dependencies: + tippy.js "^6.3.7" + lint-staged@12.1.3: version "12.1.3" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.1.3.tgz#a16e885c0a5e77de9cf559724d29a10348670e68" @@ -5362,6 +5374,13 @@ thunkify@^2.1.2: resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" integrity sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0= +tippy.js@^6.3.7: + version "6.3.7" + resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" + integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== + dependencies: + "@popperjs/core" "^2.9.0" + tmp@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14"