UNPKG

@conduction/components

Version:

React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)

16 lines (15 loc) 737 B
import { jsx as _jsx } from "react/jsx-runtime"; import * as styles from "./Logo.module.css"; import clsx from "clsx"; export const Logo = ({ onClick, layoutClassName, variant = "header", ariaLabel = "logo" }) => { const handleKeyDown = (event) => { if (onClick && (event.key === "Enter" || event.key === " ")) { event.preventDefault(); onClick(); } }; return (_jsx("div", { className: clsx(styles.container, styles[variant], [ onClick && styles.clickable, layoutClassName && layoutClassName, ]), role: onClick ? "button" : "img", "aria-label": ariaLabel, tabIndex: onClick ? 0 : undefined, onClick, ...(onClick && { onKeyDown: handleKeyDown }) })); };