Skip to content

Instantly share code, notes, and snippets.

View meshulam's full-sized avatar

Matt Meshulam meshulam

  • University of Minnesota
  • Minneapolis, MN
View GitHub Profile
@meshulam
meshulam / CategoryFlyout-Before.tsx
Last active April 7, 2021 18:37
CategoryFlyout demo
export function CategoryFlyout({ visible }) {
const classes = classNames(
'category-flyout',
{ 'category-flyout--visible': visible },
);
return (
<div className={classes} role="dialog" aria-hidden={!visible}>
{/* heading, links, image, etc */}
</div>
export function CategoryFlyout({ visible }) {
+ // Always render links in the DOM for bots, for SEO purposes
+ const renderWhenHidden = currentUser().isBot;
+
+ if (!visible && !renderWhenHidden) {
+ return null;
+ }
+
const classes = classNames(
'category-flyout',