UNPKG

@redocly/theme

Version:

Shared UI components lib

30 lines 1.31 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SidebarLogo = SidebarLogo; const react_1 = __importDefault(require("react")); const styled_components_1 = __importDefault(require("styled-components")); function SidebarLogo({ imageUrl, href, altText, backgroundColor, dataTestId, className, } = {}) { if (!imageUrl) { return null; } const logo = react_1.default.createElement(LogoImgEl, { src: imageUrl, alt: altText || 'logo' }); return (react_1.default.createElement(LogoWrap, { "data-testid": dataTestId, style: { backgroundColor }, "data-component-name": "SidebarLogo/SidebarLogo", className: className }, href ? react_1.default.createElement(Link, { href: href }, logo) : logo)); } const LogoImgEl = styled_components_1.default.img ` max-height: var(--sidebar-logo-max-height); max-width: var(--sidebar-logo-max-width); padding: var(--sidebar-logo-padding); width: 100%; display: block; `; const LogoWrap = styled_components_1.default.div ` text-align: center; line-height: 0; `; const Link = styled_components_1.default.a ` display: inline-block; `; //# sourceMappingURL=SidebarLogo.js.map