Skip to content

Instantly share code, notes, and snippets.

@meshulam
Created April 7, 2021 18:38
Show Gist options
  • Save meshulam/d4b928290662cabb7018af8be2e53ecb to your computer and use it in GitHub Desktop.
Save meshulam/d4b928290662cabb7018af8be2e53ecb to your computer and use it in GitHub Desktop.
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',
{ 'category-flyout--visible': visible },
);
return (
<div className={classes} role="dialog" aria-hidden={!visible}>
{/* heading, links, image, etc */}
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment