diff --git a/web/components/bio/profile-bio.tsx b/web/components/bio/profile-bio.tsx index 99c759c2..fb51e2e9 100644 --- a/web/components/bio/profile-bio.tsx +++ b/web/components/bio/profile-bio.tsx @@ -1,11 +1,61 @@ import {Profile} from 'common/love/profile' -import {useEffect, useState} from 'react' +import React, {useEffect, useState} from 'react' import {Col} from 'web/components/layout/col' import {Subtitle} from '../widgets/profile-subtitle' import {BioBlock} from './profile-bio-block' import {MAX_INT, MIN_BIO_LENGTH} from "common/constants"; import {useTextEditor} from "web/components/widgets/editor"; import {JSONContent} from "@tiptap/core" +import {flip, offset, shift, useFloating} from "@floating-ui/react-dom"; + +export default function TooShortBio() { + const [open, setOpen] = useState(false); + const {y, refs, strategy} = useFloating({ + placement: "bottom", // place below the trigger + middleware: [ + offset(8), // small gap between ? and box + flip(), + shift({padding: 8}), // prevent viewport clipping + ], + }); + + return ( +
+ Bio too short. Profile may be filtered from search results.{" "} + setOpen(true)} + onMouseLeave={() => setOpen(false)} + ref={refs.setReference} + > + + ? + + + + {open && ( +
+ Since your bio is too short, Compass' algorithm filters out your + profile from search results (unless "Include short bios" is + selected). This ensures searches show meaningful profiles. +
+- Bio too short. Profile may be filtered from search results. - - Hover for details - -
-- Since your bio is too short, Compass' algorithm filters out your profile from search results (unless - "Include short bios" is selected). This ensures searches show meaningful profiles. -
-