Skip to content

Commit

Permalink
[EASTER EGG] <HypothesisNode/> - hide hypothesis on ALT+click
Browse files Browse the repository at this point in the history
  • Loading branch information
lakesare committed Nov 4, 2024
1 parent 044b9b1 commit 07ca167
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@ const HypothesisNode = ({ withId = true, ...props }: HypothesisProps) => {

const isSearched = searchedHypIds.find((searchedId) => props.hypNode.id === searchedId)

const [isHidden, setIsHidden] = React.useState(false);

const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
if (e.altKey) {
e.preventDefault();
setIsHidden(true);
}
};

if (isHidden) return null;

return(
<Search hypNode={props.hypNode}>
<div
id={withId ? `hypothesis-${props.hypNode.id}` : undefined}
className={`hypothesis -hint ${!highlights || highlights.hypIds.includes(props.hypNode.id) ? "" : "-faded"} ${props.hypNode.isProof} ${isSearched ? '-is-searched' : ''}`}
onClick={handleClick}
>
<Hint>{props.hypNode}</Hint>
{name && <span className="name">{props.hypNode.name}</span>}
Expand Down

0 comments on commit 07ca167

Please sign in to comment.